mjsax commented on code in PR #21165:
URL: https://github.com/apache/kafka/pull/21165#discussion_r2626786834


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopicManager.java:
##########
@@ -194,18 +194,19 @@ public ValidationResult validate(final Map<String, 
InternalTopicConfig> topicCon
                         (streamsSide, brokerSide) -> 
validateCleanupPolicy(validationResult, streamsSide, brokerSide)
                     );
                 }
-                
+
+                final Set<String> topicsStillToValidate = new HashSet<>();
+                topicsStillToValidate.addAll(topicDescriptionsStillToValidate);
+                topicsStillToValidate.addAll(topicConfigsStillToValidate);
+
                 maybeThrowTimeout(new TimeoutContext(
-                        new HashSet<String>() {{

Review Comment:
   > Its like an array init, within the declaration, right?
   
   Yes. Similar.
   
   > Does is make an performance difference, or is it just error prone, thus 
some kind of community convent to avoid?
   
   It's not considered best practice. Overlooked during code-review. From 
Copilot:
   
   ```
   Using double-brace initialization creates an anonymous inner class and can 
lead to memory leaks. Consider using a standard HashSet construction with 
addAll() calls or collect the items into a set using streams.
   ````



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