diff --git a/src/main/java/net/spy/memcached/MemcachedConnection.java b/src/main/java/net/spy/memcached/MemcachedConnection.java index 09f7c49ce..096b5b049 100644 --- a/src/main/java/net/spy/memcached/MemcachedConnection.java +++ b/src/main/java/net/spy/memcached/MemcachedConnection.java @@ -999,7 +999,7 @@ protected void queueReconnect(final MemcachedNode node) { * * @param ops the list of operations to cancel. */ - private void cancelOperations(final Collection ops) { + private static void cancelOperations(final Collection ops) { for (Operation op : ops) { op.cancel(); } diff --git a/src/main/java/net/spy/memcached/TapClient.java b/src/main/java/net/spy/memcached/TapClient.java index 5f4993ee4..f404c9aca 100644 --- a/src/main/java/net/spy/memcached/TapClient.java +++ b/src/main/java/net/spy/memcached/TapClient.java @@ -240,7 +240,7 @@ public void complete() { return ts; } - private void tapAck(TapConnectionProvider conn, MemcachedNode node, + private static void tapAck(TapConnectionProvider conn, MemcachedNode node, TapOpcode opcode, int opaque, OperationCallback cb) { final Operation op = conn.getOpFactory().tapAck(opcode, opaque, cb); conn.addTapAckOp(node, op); diff --git a/src/main/java/net/spy/memcached/ops/BaseOperationFactory.java b/src/main/java/net/spy/memcached/ops/BaseOperationFactory.java index 0100fe71f..017c865d2 100644 --- a/src/main/java/net/spy/memcached/ops/BaseOperationFactory.java +++ b/src/main/java/net/spy/memcached/ops/BaseOperationFactory.java @@ -39,7 +39,7 @@ */ public abstract class BaseOperationFactory implements OperationFactory { - private String first(Collection keys) { + private static String first(Collection keys) { return keys.iterator().next(); } diff --git a/src/main/java/net/spy/memcached/protocol/binary/ObserveOperationImpl.java b/src/main/java/net/spy/memcached/protocol/binary/ObserveOperationImpl.java index 97cd5071a..600673f32 100644 --- a/src/main/java/net/spy/memcached/protocol/binary/ObserveOperationImpl.java +++ b/src/main/java/net/spy/memcached/protocol/binary/ObserveOperationImpl.java @@ -61,7 +61,7 @@ public String toString() { protected void decodePayload(byte[] pl) { final short keylen = (short) decodeShort(pl, 2); keystate = (byte) decodeByte(pl, keylen+4); - retCas = (long) decodeLong(pl, keylen+5); + retCas = decodeLong(pl, keylen+5); ObserveResponse r = ObserveResponse.valueOf(keystate); ((ObserveOperation.Callback) getCallback()).gotData(key, retCas, getHandlingNode(), r); diff --git a/src/main/java/net/spy/memcached/transcoders/WhalinV1Transcoder.java b/src/main/java/net/spy/memcached/transcoders/WhalinV1Transcoder.java index cc91d9507..38e112eb5 100644 --- a/src/main/java/net/spy/memcached/transcoders/WhalinV1Transcoder.java +++ b/src/main/java/net/spy/memcached/transcoders/WhalinV1Transcoder.java @@ -165,7 +165,7 @@ private Short decodeShort(byte[] data) { return Short.valueOf((short) decodeInteger(data).intValue()); } - private Byte decodeByte(byte[] in) { + private static Byte decodeByte(byte[] in) { assert in.length == 2 : "Wrong length for a byte"; byte value = in[1]; return Byte.valueOf(value); @@ -190,12 +190,12 @@ private Double decodeDouble(byte[] in) { return Double.valueOf(Double.longBitsToDouble(l.longValue())); } - private Boolean decodeBoolean(byte[] in) { + private static Boolean decodeBoolean(byte[] in) { assert in.length == 2 : "Wrong length for a boolean"; return Boolean.valueOf(in[1] == 1); } - private Long decodeLong(byte[] in) { + private static Long decodeLong(byte[] in) { long rv = 0L; for (int idx = 1; idx < in.length; idx++) { byte i = in[idx]; @@ -216,14 +216,14 @@ private String decodeW1String(byte[] b) { } } - private byte[] encodeByte(Byte value) { + private static byte[] encodeByte(Byte value) { byte[] b = new byte[2]; b[0] = SPECIAL_BYTE; b[1] = value.byteValue(); return b; } - private byte[] encodeBoolean(Boolean value) { + private static byte[] encodeBoolean(Boolean value) { byte[] b = new byte[2]; b[0] = SPECIAL_BOOLEAN; b[1] = (byte) (value.booleanValue() ? 1 : 0); @@ -295,7 +295,7 @@ private byte[] encodeW1String(String value) { return result; } - private byte[] encodeNum(long l, int maxBytes) { + private static byte[] encodeNum(long l, int maxBytes) { byte[] rv = new byte[maxBytes + 1]; for (int i = 0; i < rv.length - 1; i++) {