inside ClientCnxn.SendThread we have

    final ByteBuffer lenBuffer = ByteBuffer.allocateDirect(4);
    ByteBuffer incomingBuffer = lenBuffer;

So incomingBuffer and lenBuffer do refer to the same object. There are several 
other places where lenBuffer is again assigned to incomingBuffer.

Now inside the doIO() method we got

            if (incomingBuffer == lenBuffer) {
            } else if (!initialized) {

incomingBuffer is never assigned anything else then lenBuffer, lenBuffer stays 
the same all the time. So as far as my knowledge of java reaches (which may 
not be too far) incomingBuffer == lenBuffer _always_ evaluates to true. Isn't 
that true?

So effectively we've got dead code in the elseif and else branches, didn't we?

Best regards,

Thomas Koch, http://www.koch.ro

Reply via email to