joerghoh commented on code in PR #173:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/173#discussion_r2065788126


##########
src/main/java/org/apache/sling/resourceresolver/impl/mapping/AliasHandler.java:
##########
@@ -130,31 +132,30 @@ protected boolean initializeAliases() {
                     } else if (!conflictingAliases.isEmpty()) {
                         log.warn("There are {} conflicting aliases: {}", 
conflictingAliases.size(), conflictingAliases);
                     }
+
                     if (invalidAliases.size() >= MAX_REPORT_DEFUNCT_ALIASES) {
                         log.warn("There are {} invalid aliases; excerpt: {}", 
invalidAliases.size(), invalidAliases);
                     } else if (!invalidAliases.isEmpty()) {
                         log.warn("There are {} invalid aliases: {}", 
invalidAliases.size(), invalidAliases);
                     }
                 } catch (final Exception e) {
-
+                    this.aliasMapsMap = new ConcurrentHashMap<>();

Review Comment:
   You are correct. While before in the case of an exception 
``this.aliasMapsMap`` was left with whatever was already stored there, 
``mapEntries.isOptimizedAliasResolutionEnabled()``was returning false in this 
case and the ``aliasMapsMap`` was never consulted.
   
   For that this is just a resource optimizations, and you could achieve the 
same with just a clearing of this map.
   ```suggestion
                       // Get rid of whatever is already stored here, it will 
never get used again
                       this.aliasMapsMap.clear();
   ```
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to