DESCRIPTION

Made cmd variable a byte for binary operations.

This variable should have never been an int since it is defined in
the protocol as a byte. The reason for the change is that when we
have opcode that is greater have 127 the value of a byte and an int
are different (Ex. int = 128 byte = -127). This was causing an
assertion to fail, in this case for the getl command (0x94).

Change-Id: Ia6b32a4af94ed2e8dc973237132f3fd291655634


COMMENTS

author: Kenny Maynard
date: 2011-09-08 22:16:08.762000000

Patch Set 1: Verified



-------------------------------------
author: Andreas Short
date: 2011-09-09 18:13:30.086000000

Patch Set 1: Do not submit

(5 inline comments)

There are some assertions that would immediately fail here if the codepath was called.  

Also, there are some incorrect conversions to byte.

Finally, I think it might be good to have some constant that defines UNEXPECTED_OPCODE (or something shorter) rather than having to constanly read (byte)0xFF and know that we're using that as a sentinel interally.  Since the other changes are needed, this might be a good change to add.

Line:112, src/main/java/net/spy/memcached/protocol/binary/OperationImpl.java -> This may be able to be replaced by a constant

Line:35, src/main/java/net/spy/memcached/protocol/binary/OptimizedSetImpl.java -> Another possible constant to use?

Line:108, src/main/java/net/spy/memcached/protocol/binary/OptimizedSetImpl.java -> I don't think a change is called for here.  You're sticking with int, not using byte here.  -1 as a sentinel is fine.  Here, you're using 148 as a sentinel.

Line:24, src/main/java/net/spy/memcached/protocol/binary/ConcatenationOperationImpl.java -> you need to update the assertion too.  I'm surprised the IDE didn't catch this one.

Line:36, src/main/java/net/spy/memcached/protocol/binary/StoreOperationImpl.java -> another incorrect check here.

-------------------------------------
author: Tate Garrett
date: 2011-09-20 05:53:50.390000000

Your change could not be merged due to a path conflict.

Please merge (or rebase) the change locally and upload the resolution for review.

-------------------------------------
