diff --git a/src/main/java/net/spy/memcached/compat/log/SLF4JLogger.java b/src/main/java/net/spy/memcached/compat/log/SLF4JLogger.java index 65427a306..573cec886 100644 --- a/src/main/java/net/spy/memcached/compat/log/SLF4JLogger.java +++ b/src/main/java/net/spy/memcached/compat/log/SLF4JLogger.java @@ -89,10 +89,8 @@ public void log(Level level, Object message, Throwable e) { case WARN: logger.warn(message.toString(), e); break; - case ERROR: - logger.error(message.toString(), e); - break; case FATAL: + case ERROR: logger.error(message.toString(), e); break; default: diff --git a/src/main/java/net/spy/memcached/compat/log/SunLogger.java b/src/main/java/net/spy/memcached/compat/log/SunLogger.java index af57d517e..2386f053e 100644 --- a/src/main/java/net/spy/memcached/compat/log/SunLogger.java +++ b/src/main/java/net/spy/memcached/compat/log/SunLogger.java @@ -88,8 +88,6 @@ public void log(Level level, Object message, Throwable e) { sLevel = java.util.logging.Level.WARNING; break; case ERROR: - sLevel = java.util.logging.Level.SEVERE; - break; case FATAL: sLevel = java.util.logging.Level.SEVERE; break; diff --git a/src/main/java/net/spy/memcached/ops/BaseOperationFactory.java b/src/main/java/net/spy/memcached/ops/BaseOperationFactory.java index 0100fe71f..6b4150b0b 100644 --- a/src/main/java/net/spy/memcached/ops/BaseOperationFactory.java +++ b/src/main/java/net/spy/memcached/ops/BaseOperationFactory.java @@ -51,9 +51,7 @@ public Collection clone(KeyedOperation op) { assert !op.hasErrored() : "Attempted to clone an errored op"; Collection rv = new ArrayList(op.getKeys().size()); - if (op instanceof GetOperation) { - rv.addAll(cloneGet(op)); - } else if (op instanceof ReplicaGetOperation) { + if (op instanceof GetOperation || op instanceof ReplicaGetOperation) { rv.addAll(cloneGet(op)); } else if (op instanceof ReplicaGetsOperation) { ReplicaGetsOperation.Callback callback = diff --git a/src/main/java/net/spy/memcached/protocol/BaseOperationImpl.java b/src/main/java/net/spy/memcached/protocol/BaseOperationImpl.java index 24d690899..0960821ff 100644 --- a/src/main/java/net/spy/memcached/protocol/BaseOperationImpl.java +++ b/src/main/java/net/spy/memcached/protocol/BaseOperationImpl.java @@ -189,8 +189,6 @@ protected void handleError(OperationErrorType eType, String line) exception = new OperationException(); break; case SERVER: - exception = new OperationException(eType, line); - break; case CLIENT: exception = new OperationException(eType, line); break; diff --git a/src/main/java/net/spy/memcached/protocol/binary/OperationImpl.java b/src/main/java/net/spy/memcached/protocol/binary/OperationImpl.java index a56463620..b7f2568f1 100644 --- a/src/main/java/net/spy/memcached/protocol/binary/OperationImpl.java +++ b/src/main/java/net/spy/memcached/protocol/binary/OperationImpl.java @@ -231,14 +231,12 @@ protected OperationStatus getStatusForErrorCode(int errCode, byte[] errPl) switch (errCode) { case ERR_NOT_FOUND: + case ERR_NOT_STORED: return new CASOperationStatus(false, new String(errPl), CASResponse.NOT_FOUND, statusCode); case ERR_EXISTS: return new CASOperationStatus(false, new String(errPl), CASResponse.EXISTS, statusCode); - case ERR_NOT_STORED: - return new CASOperationStatus(false, new String(errPl), - CASResponse.NOT_FOUND, statusCode); case ERR_2BIG: case ERR_INTERNAL: handleError(OperationErrorType.SERVER, new String(errPl)); diff --git a/src/main/java/net/spy/memcached/tapmessage/ResponseMessage.java b/src/main/java/net/spy/memcached/tapmessage/ResponseMessage.java index 1cd7734c4..14a9e07a2 100644 --- a/src/main/java/net/spy/memcached/tapmessage/ResponseMessage.java +++ b/src/main/java/net/spy/memcached/tapmessage/ResponseMessage.java @@ -108,7 +108,8 @@ public ResponseMessage(byte[] b) { key = new byte[keylength]; System.arraycopy(b, 32 + engineprivate, key, 0, keylength); value = new byte[0]; - } else if (opcode.equals(TapOpcode.VBUCKETSET)) { + } else if (opcode.equals(TapOpcode.VBUCKETSET) + || opcode.equals(TapOpcode.OPAQUE)) { itemflags = 0; itemexpiry = 0; vbucketstate = decodeInt(b, ITEM_FLAGS_OFFSET); @@ -125,14 +126,6 @@ public ResponseMessage(byte[] b) { key = new byte[0]; value = new byte[0]; revid = new byte[0]; - } else if (opcode.equals(TapOpcode.OPAQUE)) { - itemflags = 0; - itemexpiry = 0; - vbucketstate = decodeInt(b, ITEM_FLAGS_OFFSET); - checkpoint = 0; - key = new byte[0]; - value = new byte[0]; - revid = new byte[0]; } else { itemflags = 0; itemexpiry = 0; diff --git a/src/main/java/net/spy/memcached/tapmessage/TapOpcode.java b/src/main/java/net/spy/memcached/tapmessage/TapOpcode.java index 24eec15c1..6a50cb1d3 100644 --- a/src/main/java/net/spy/memcached/tapmessage/TapOpcode.java +++ b/src/main/java/net/spy/memcached/tapmessage/TapOpcode.java @@ -102,9 +102,7 @@ public byte getOpcode() { } public static TapOpcode getOpcodeByByte(byte b) { - if (b == TapOpcode.DELETE.opcode) { - return TapOpcode.DELETE; - } else if (b == TapOpcode.FLUSH.opcode) { + if (b == TapOpcode.DELETE.opcode || b == TapOpcode.FLUSH.opcode) { return TapOpcode.DELETE; } else if (b == TapOpcode.MUTATION.opcode) { return TapOpcode.MUTATION;