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


##########
oak-security-spi/src/main/java/org/apache/jackrabbit/oak/spi/security/privilege/ImmutablePrivilegeDefinition.java:
##########
@@ -37,11 +39,7 @@ public final class ImmutablePrivilegeDefinition implements 
PrivilegeDefinition {
     public ImmutablePrivilegeDefinition(@NotNull String name, boolean 
isAbstract, @Nullable Iterable<String> declaredAggregateNames) {
         this.name = name;
         this.isAbstract = isAbstract;
-        ImmutableSet.Builder<String> builder = ImmutableSet.builder();
-        if (declaredAggregateNames != null) {
-            builder.addAll(declaredAggregateNames);
-        }
-        this.declaredAggregateNames = builder.build();
+        this.declaredAggregateNames = declaredAggregateNames != null ? 
Collections.unmodifiableSet(SetUtils.toLinkedSet(declaredAggregateNames)) : 
Set.of();

Review Comment:
   Null case already handled.



-- 
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]

Reply via email to