priyeshkaratha commented on code in PR #10690:
URL: https://github.com/apache/ozone/pull/10690#discussion_r3549907208


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/io/ScmListCodec.java:
##########
@@ -69,6 +69,12 @@ public Object deserialize(ByteString value) throws 
InvalidProtocolBufferExceptio
           "Missing ListArgument.type: " + argument);
     }
 
+    // Empty list was serialized with type=Object.class.getName() as a 
sentinel.
+    // Skip element-type resolution — there are no elements to decode.
+    if (argument.getValueCount() == 0) {
+      return new ArrayList<>();

Review Comment:
   Thanks @Russole  for catching this. You are right and it is better to return 
new ArrayList<>() since class Collections$EmptyList cannot be cast to class 
ArrayList. I added test case also which validates this.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to