Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two branches with same conditional structure #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/main/java/net/spy/memcached/compat/log/SLF4JLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/net/spy/memcached/compat/log/SunLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ public Collection<Operation> clone(KeyedOperation op) {
assert !op.hasErrored() : "Attempted to clone an errored op";

Collection<Operation> rv = new ArrayList<Operation>(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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
11 changes: 2 additions & 9 deletions src/main/java/net/spy/memcached/tapmessage/ResponseMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/net/spy/memcached/tapmessage/TapOpcode.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down