You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/01/25 07:07:43 UTC

[GitHub] [kafka] chia7712 opened a new pull request #9961: MINOR: remove unused code from MessageTest

chia7712 opened a new pull request #9961:
URL: https://github.com/apache/kafka/pull/9961


   noticed this issue when reviewing #9960
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] chia7712 merged pull request #9961: MINOR: remove unused code from MessageTest

Posted by GitBox <gi...@apache.org>.
chia7712 merged pull request #9961:
URL: https://github.com/apache/kafka/pull/9961


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] chia7712 commented on pull request #9961: MINOR: remove unused code from MessageTest

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #9961:
URL: https://github.com/apache/kafka/pull/9961#issuecomment-767379392


   ```
   Build / JDK 15 / org.apache.kafka.clients.consumer.internals.ConsumerNetworkClientTest.blockWhenPollConditionNotSatisfied()
   Build / JDK 15 / org.apache.kafka.clients.consumer.internals.FetcherTest.testEarlierOffsetResetArrivesLate()
   Build / JDK 15 / org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationSSLTest.testOneWayReplicationWithAutoOffsetSync()
   ```
   
   unrelated error


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] chia7712 commented on a change in pull request #9961: MINOR: remove unused code from MessageTest

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [kafka] ijuma commented on a change in pull request #9961: MINOR: remove unused code from MessageTest

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #9961:
URL: https://github.com/apache/kafka/pull/9961#discussion_r563528446



##########
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:
       Was this meant to be used in an assert that checks the buffer content?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] chia7712 commented on a change in pull request #9961: MINOR: remove unused code from MessageTest

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [kafka] ijuma commented on a change in pull request #9961: MINOR: remove unused code from MessageTest

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #9961:
URL: https://github.com/apache/kafka/pull/9961#discussion_r563528446



##########
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:
       Was this meant to be used in an assert that checks the buffer content?




----------------------------------------------------------------
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:
users@infra.apache.org