rishabhdaim commented on code in PR #2320:
URL: https://github.com/apache/jackrabbit-oak/pull/2320#discussion_r2116160566


##########
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<>();

Review Comment:
   same as above.



##########
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<>();

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

Reply via email to