m1a2st commented on code in PR #20091:
URL: https://github.com/apache/kafka/pull/20091#discussion_r2180169462


##########
tools/src/main/java/org/apache/kafka/tools/AclCommand.java:
##########
@@ -272,8 +270,8 @@ private static Map<ResourcePatternFilter, 
Set<AccessControlEntry>> getConsumerRe
         Set<ResourcePatternFilter> groups = filters.stream().filter(f -> 
f.resourceType() == ResourceType.GROUP).collect(Collectors.toSet());
 
         //Read, Describe on topic, Read on consumerGroup
-        Set<AccessControlEntry> topicAcls = getAcl(opts, new 
HashSet<>(Arrays.asList(READ, DESCRIBE)));
-        Set<AccessControlEntry> groupAcls = getAcl(opts, 
Collections.singleton(READ));
+        Set<AccessControlEntry> topicAcls = getAcl(opts, new 
HashSet<>(List.of(READ, DESCRIBE)));

Review Comment:
   Could these properties be made immutable?
   ```suggestion
           Set<AccessControlEntry> topicAcls = getAcl(opts, new Set.of(READ, 
DESCRIBE));
   ```



##########
tools/src/main/java/org/apache/kafka/tools/AclCommand.java:
##########
@@ -249,8 +247,8 @@ private static Map<ResourcePatternFilter, 
Set<AccessControlEntry>> getProducerRe
         Set<ResourcePatternFilter> transactionalIds = 
filters.stream().filter(f -> f.resourceType() == 
ResourceType.TRANSACTIONAL_ID).collect(Collectors.toSet());
         boolean enableIdempotence = opts.options.has(opts.idempotentOpt);
 
-        Set<AccessControlEntry> topicAcls = getAcl(opts, new 
HashSet<>(Arrays.asList(WRITE, DESCRIBE, CREATE)));
-        Set<AccessControlEntry> transactionalIdAcls = getAcl(opts, new 
HashSet<>(Arrays.asList(WRITE, DESCRIBE)));
+        Set<AccessControlEntry> topicAcls = getAcl(opts, new 
HashSet<>(List.of(WRITE, DESCRIBE, CREATE)));
+        Set<AccessControlEntry> transactionalIdAcls = getAcl(opts, new 
HashSet<>(List.of(WRITE, DESCRIBE)));

Review Comment:
   Could these properties be made immutable?
   ```suggestion
           Set<AccessControlEntry> topicAcls = getAcl(opts, Set.of(WRITE, 
DESCRIBE, CREATE));
           Set<AccessControlEntry> transactionalIdAcls = getAcl(opts, 
Set.of(WRITE, DESCRIBE));
   ```



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to