see-quick commented on code in PR #21620:
URL: https://github.com/apache/kafka/pull/21620#discussion_r2889435306


##########
generator/src/main/java/org/apache/kafka/message/FieldSpec.java:
##########
@@ -88,7 +88,7 @@ public FieldSpec(@JsonProperty("name") String name,
                 name + " structure.");
         }
         this.fields = Collections.unmodifiableList(fields == null ?
-            Collections.emptyList() : new ArrayList<>(fields));
+            List.of() : new ArrayList<>(fields));

Review Comment:
   Hmm in that case I don't need to wrap into `unmodifiableList` cause both 
List.of() and List.copyOf(...) returns unmodifiableList.



##########
generator/src/main/java/org/apache/kafka/message/FieldSpec.java:
##########
@@ -88,7 +88,7 @@ public FieldSpec(@JsonProperty("name") String name,
                 name + " structure.");
         }
         this.fields = Collections.unmodifiableList(fields == null ?
-            Collections.emptyList() : new ArrayList<>(fields));
+            List.of() : new ArrayList<>(fields));

Review Comment:
   Hmm in that case we don't need to wrap into `unmodifiableList` cause both 
List.of() and List.copyOf(...) returns unmodifiableList.



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