joerghoh commented on code in PR #173:
URL:
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/173#discussion_r2059849313
##########
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<>();
logDisableAliasOptimization(e);
-
- // disable optimize alias resolution
- isOptimizeAliasResolutionEnabled = false;
}
}
doUpdateConfiguration.run();
sendChangeEvent.run();
-
- return isOptimizeAliasResolutionEnabled;
-
} finally {
this.initializing.unlock();
}
}
+ boolean usesCache() {
Review Comment:
I wonder if this method name is correct, as it returns the value of the
variable ``mapsIsInitialized``... (or maybe the name of the variable should be
improved?)
##########
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:
That means, that in a case of an exception anywhere in this above code (most
likely only in the ``loadAliases`` part) we have zero aliases? That could be
considered as a breaking change.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]