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


##########
clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java:
##########
@@ -151,15 +152,15 @@ private SerializationStrategy 
parseSerializationStrategyFlag(final int serializa
         return SerializationStrategy.VALUES[serializationStrategyFlag];
     }
 
-    private List<Integer> deserializeNullIndexList(final DataInputStream dis, 
final int length) throws IOException {
+    private Set<Integer> deserializeNullIndexList(final DataInputStream dis, 
final int length) throws IOException {
         int nullIndexListSize = dis.readInt();
         if (nullIndexListSize < 0) {
             throw new SerializationException("Corrupted byte[]. The number of 
null list entries cannot be negative.");
         }
         if (nullIndexListSize > length / Integer.BYTES) {
             throw new SerializationException("Corrupted byte[]. The number of 
null list entries cannot be larger than overall number of elements.");
         }
-        List<Integer> nullIndexList = new ArrayList<>(nullIndexListSize);
+        Set<Integer> nullIndexList = new HashSet<>(nullIndexListSize);

Review Comment:
   ```suggestion
           Set<Integer> nullIndexes = new HashSet<>(nullIndexListSize);
   ```



##########
clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java:
##########
@@ -179,7 +180,7 @@ public List<Inner> deserialize(String topic, Headers 
headers, byte[] data) {
         }
         try (final DataInputStream dis = new DataInputStream(new 
ByteArrayInputStream(data))) {
             SerializationStrategy serStrategy = 
parseSerializationStrategyFlag(dis.readByte());
-            List<Integer> nullIndexList = null;
+            Set<Integer> nullIndexList = null;

Review Comment:
   ```suggestion
               Set<Integer> nullIndexes = null;
   ```



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