rishabhdaim commented on code in PR #2320: URL: https://github.com/apache/jackrabbit-oak/pull/2320#discussion_r2116161244
########## oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/composite/CompositeAccessControlManager.java: ########## @@ -138,49 +136,46 @@ public void removePolicy(String absPath, AccessControlPolicy policy) throws Repo @NotNull @Override public JackrabbitAccessControlPolicy[] getApplicablePolicies(@NotNull Principal principal) throws RepositoryException { - ImmutableList.Builder<JackrabbitAccessControlPolicy> policies = ImmutableList.builder(); + List<JackrabbitAccessControlPolicy> policies = new ArrayList<>(); for (AccessControlManager acMgr : acMgrs) { if (acMgr instanceof JackrabbitAccessControlManager && acMgr instanceof PolicyOwner) { - policies.add(((JackrabbitAccessControlManager) acMgr).getApplicablePolicies(principal)); + policies.addAll(Arrays.asList(((JackrabbitAccessControlManager) acMgr).getApplicablePolicies(principal))); } } - List<JackrabbitAccessControlPolicy> l = policies.build(); - return l.toArray(new JackrabbitAccessControlPolicy[0]); + return policies.toArray(new JackrabbitAccessControlPolicy[0]); } @NotNull @Override public JackrabbitAccessControlPolicy[] getPolicies(@NotNull Principal principal) throws RepositoryException { - ImmutableList.Builder<JackrabbitAccessControlPolicy> policies = ImmutableList.builder(); + List<JackrabbitAccessControlPolicy> policies = new ArrayList<>(); for (AccessControlManager acMgr : acMgrs) { if (acMgr instanceof JackrabbitAccessControlManager) { - policies.add(((JackrabbitAccessControlManager) acMgr).getPolicies(principal)); + policies.addAll(Arrays.asList(((JackrabbitAccessControlManager) acMgr).getPolicies(principal))); } } - List<JackrabbitAccessControlPolicy> l = policies.build(); - return l.toArray(new JackrabbitAccessControlPolicy[0]); + return policies.toArray(new JackrabbitAccessControlPolicy[0]); } @NotNull @Override public AccessControlPolicy[] getEffectivePolicies(@NotNull Set<Principal> principals) throws RepositoryException { - ImmutableList.Builder<AccessControlPolicy> policies = ImmutableList.builder(); + List<AccessControlPolicy> policies = new ArrayList<>(); for (AccessControlManager acMgr : acMgrs) { if (acMgr instanceof JackrabbitAccessControlManager) { JackrabbitAccessControlManager jAcMgr = (JackrabbitAccessControlManager) acMgr; - policies.add(jAcMgr.getEffectivePolicies(principals)); + policies.addAll(Arrays.asList(jAcMgr.getEffectivePolicies(principals))); if (aggregationFilter.stop(jAcMgr, principals)) { break; } } } - List<AccessControlPolicy> l = policies.build(); - return l.toArray(new AccessControlPolicy[0]); + return policies.toArray(new AccessControlPolicy[0]); } @Override public @NotNull Iterator<AccessControlPolicy> getEffectivePolicies(@NotNull Set<Principal> principals, @Nullable String... absPaths) throws AccessDeniedException, AccessControlException, UnsupportedRepositoryOperationException, RepositoryException { - ImmutableList.Builder<Iterator<AccessControlPolicy>> iterators = ImmutableList.builder(); + List<Iterator<AccessControlPolicy>> iterators = 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