rreddy-22 commented on code in PR #16088:
URL: https://github.com/apache/kafka/pull/16088#discussion_r1619888416


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/OptimizedUniformAssignmentBuilder.java:
##########
@@ -53,8 +42,17 @@
  * The assignment builder prioritizes the properties in the following order:
  *      Balance > Stickiness.
  */
-public class OptimizedUniformAssignmentBuilder extends 
AbstractUniformAssignmentBuilder {
-    private static final Logger LOG = 
LoggerFactory.getLogger(OptimizedUniformAssignmentBuilder.class);
+public class OptimizedUniformAssignmentBuilder {
+    private static final Class<?> UNMODIFIALBE_MAP_CLASS = 
Collections.unmodifiableMap(new HashMap<>()).getClass();
+    private static final Class<?> EMPTY_MAP_CLASS = 
Collections.emptyMap().getClass();
+
+    /**
+     * @return True if the provided map is an UnmodifiableMap or EmptyMap. 
Those classes are not
+     * public hence we cannot use the `instanceof` operator.
+     */
+    private static boolean isImmutableMap(Map<?, ?> map) {
+        return UNMODIFIALBE_MAP_CLASS.isInstance(map) || 
EMPTY_MAP_CLASS.isInstance(map);

Review Comment:
   nit: UNMODIFIABLE *



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