chia7712 commented on a change in pull request #9961:
URL: https://github.com/apache/kafka/pull/9961#discussion_r563535369



##########
File path: 
clients/src/test/java/org/apache/kafka/common/message/MessageTest.java
##########
@@ -1006,12 +977,6 @@ private void verifyWriteSucceeds(short version, Message 
message) {
         ByteBuffer buf = ByteBuffer.allocate(size * 2);
         ByteBufferAccessor byteBufferAccessor = new ByteBufferAccessor(buf);
         message.write(byteBufferAccessor, cache, version);
-        ByteBuffer alt = buf.duplicate();
-        alt.flip();
-        StringBuilder bld = new StringBuilder();
-        while (alt.hasRemaining()) {
-            bld.append(String.format(" %02x", alt.get()));
-        }

Review comment:
       It was unused when it was added by 
https://github.com/apache/kafka/commit/0de61a4683b92bdee803c51211c3277578ab3edf#diff-02a860dc8bbf9772338aaa85b35914b812577d05384eca3af4f5ddb8b5bda4bdR887
   
   ```
           message.write(byteBufferAccessor, cache, version);
            ByteBuffer alt = buf.duplicate();
            alt.flip();
            StringBuilder bld = new StringBuilder();
            while (alt.hasRemaining()) {
                bld.append(String.format(" %02x", alt.get()));
            }
            assertEquals("Expected the serialized size to be " + size +
                ", but it was " + buf.position(), size, buf.position());
   ```




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to