rishabhdaim commented on code in PR #2320: URL: https://github.com/apache/jackrabbit-oak/pull/2320#discussion_r2116160039
########## oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/composite/CompositeAccessControlManager.java: ########## @@ -81,24 +80,23 @@ public Privilege[] getSupportedPrivileges(String absPath) throws RepositoryExcep @Override public AccessControlPolicy[] getPolicies(String absPath) throws RepositoryException { - ImmutableList.Builder<AccessControlPolicy> policies = ImmutableList.builder(); + List<AccessControlPolicy> policies = new ArrayList<>(); Review Comment: No need for Immutability here, since the List is never exposed outside the method. ########## oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/composite/CompositeAccessControlManager.java: ########## @@ -81,24 +80,23 @@ public Privilege[] getSupportedPrivileges(String absPath) throws RepositoryExcep @Override public AccessControlPolicy[] getPolicies(String absPath) throws RepositoryException { - ImmutableList.Builder<AccessControlPolicy> policies = ImmutableList.builder(); + List<AccessControlPolicy> policies = new ArrayList<>(); for (AccessControlManager acMgr : acMgrs) { - policies.add(acMgr.getPolicies(absPath)); + policies.addAll(Arrays.asList(acMgr.getPolicies(absPath))); } - List<AccessControlPolicy> l = policies.build(); - return l.toArray(new AccessControlPolicy[0]); + return policies.toArray(new AccessControlPolicy[0]); } @Override public AccessControlPolicy[] getEffectivePolicies(String absPath) throws RepositoryException { - ImmutableList.Builder<AccessControlPolicy> policies = ImmutableList.builder(); + List<AccessControlPolicy> policies = new ArrayList<>(); Review Comment: same as above -- 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: oak-dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org