You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/01/17 14:04:42 UTC

[GitHub] sschepens commented on a change in pull request #996: DoubleByteBuf fix for Netty > 4.1.12

sschepens commented on a change in pull request #996: DoubleByteBuf fix for Netty > 4.1.12
URL: https://github.com/apache/bookkeeper/pull/996#discussion_r162058273
 
 

 ##########
 File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/util/DoubleByteBuf.java
 ##########
 @@ -370,7 +371,10 @@ public ByteBuffer nioBuffer(int index, int length) {
 
     @Override
     public ByteBuffer[] nioBuffers(int index, int length) {
-        return new ByteBuffer[] { nioBuffer(index, length) };
+        if (b1.nioBufferCount() == 1 && b2.nioBufferCount() == 1) {
+            return new ByteBuffer[] { b1.nioBuffer(), b2.nioBuffer() };
+        }
+        return ObjectArrays.concat(b1.nioBuffers(), b2.nioBuffers(), ByteBuffer.class);
 
 Review comment:
   yup, this is incorrect, seems I failed somewhere, this logic has to be in `public ByteBuffer[] nioBuffers()`, gonna change it

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services