akankshajain18 commented on a change in pull request #24:
URL:
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/24#discussion_r519341911
##########
File path:
src/main/java/org/apache/sling/resourceresolver/impl/CommonResourceResolverFactoryImpl.java
##########
@@ -472,6 +473,22 @@ public boolean hasVanityPathPrecedence() {
return configs;
}
+ @Override
+ public List<String> getAliasPath() {
+ final AtomicReferenceArray<String> includes =
this.activator.getOptimizedAliasResolutionAllowList();
+ if (includes == null) {
+ return Collections.emptyList();
+ }
+
+ final List<String> configs = new ArrayList<>();
Review comment:
@jsedding
"this.activator.getOptimizedAliasResolutionAllowList()" return
AtomicReferenceArray, as we require atomicity while reading data from config.
We can not make "this.activator.getOptimizedAliasResolutionAllowList()" return
String[] Since sonar bot suggestion does not allow to have **Non-primitive
fields as "volatile" and throw a bug in the PR.**
With AtomicReferenceArray, we can not use treeSet directly as it throw
"java.lang.ClassCastException:" we may require some comparable method to do so.
Manual iteration will be done to populate the treeset
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]