A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Untitled - Stikked
From Buff Lemur, 7 Years ago, written in Java 5.
Embed
  1.     /*
  2.      * Step 2: Once there is a mismatch in authcontext, get the list of resource
  3.      * associated to the particular product
  4.      */
  5.     @SuppressWarnings("unchecked")
  6.     private Map<String, Set<String>> getResourcesByProductId(String productId, Mono<Set<String>> listOfResourcesMappedtoAuthContext) {
  7.         String cacheKey = productId + RESOURCE_BY_PRODUCT;
  8.         Object cacheData = productResourcesCache.get(cacheKey);
  9.    
  10.         Map<String, Set<String>> listOfResourcesForAllProductsForUser = Maps.newHashMap();
  11.         return Mono
  12.         .just(productResourcesCache)
  13.         .map(cache -> cache.get(cacheKey))
  14.         .map(Objects::isNull)
  15.         .flatMap(cacheIsNull -> {
  16.             if (cacheIsNull) {
  17.                 return Mono
  18.                   .just(buildGetResourcesByProductIdRequest(productId))
  19.                   .flatMap(requestObj -> getResourceByProductId(requestObj))
  20.                   .map(resourceListResponseObj -> {
  21.                       if(!CollectionUtils.isEmpty(resourceListResponseObj)) {
  22.                           productResourcesCache.put(cacheKey, resourceListResponseObj);
  23.                       }
  24.                       return resourceListResponseObj;
  25.                   });
  26.             }
  27.             else {
  28.                 return Mono.just((Set<String>)cacheData);
  29.             }
  30.         })
  31.         .flatMap(resourceListResponseObj -> Mono.just((Set<String>)Sets.intersection(resourceListResponseObj, listOfResourcesMappedtoAuthContext.block())))
  32.         .map(resourcesList -> {
  33.             listOfResourcesForAllProductsForUser.put(productId, resourcesList);
  34.             return listOfResourcesForAllProductsForUser;
  35.         }).block();
  36.     }
  37.        
  38.     private Mono<Set<String>> getResourceByProductId(GetResourcesByProductIdRequest request) {
  39.         Set<String> resourceResp = new HashSet<>();
  40.         try {
  41.             GetResourcesByProductIdResponse resp = productLifeCycleProxy.getResourcesByProductId(request);
  42.             resp.getResource().parallelStream().forEach(resource -> {
  43.                 resourceResp.add(resource.getResourceId());
  44.             });
  45.             return Mono.just(resourceResp);
  46.         } catch (ProductException | NoResourcesFoundException | NoResourcesFoundForRoleException | ProductNotFoundException exception) {
  47.             LOGGER.error("Exception occured while retrieving resource by productid, message: {} , exception: {}", exception.getMessage(), exception);
  48.             return Mono.just(resourceResp);
  49.         }
  50.     }