showuon commented on code in PR #13261:
URL: https://github.com/apache/kafka/pull/13261#discussion_r1113935551


##########
clients/src/main/java/org/apache/kafka/common/protocol/types/Type.java:
##########
@@ -688,8 +688,10 @@ public Object read(ByteBuffer buffer) {
             if (size > buffer.remaining())
                 throw new SchemaException("Error reading bytes of size " + 
size + ", only " + buffer.remaining() + " bytes available");
 
+            int limit = buffer.limit();
+            buffer.limit(buffer.position() + size);

Review Comment:
   nit: Since we will use `buffer.position() + size` twice, should we make it 
as a variable?



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