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

Remove Useless parentheses #41

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
2 changes: 1 addition & 1 deletion src/main/java/net/spy/memcached/compat/SpyObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ protected Logger getLogger() {
if (logger == null) {
logger = LoggerFactory.getLogger(getClass());
}
return (logger);
return logger;
}
}
2 changes: 1 addition & 1 deletion src/main/java/net/spy/memcached/compat/SpyThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ protected Logger getLogger() {
if (logger == null) {
logger = LoggerFactory.getLogger(getClass());
}
return (logger);
return logger;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected AbstractLogger(String nm) {
* Get the name of this logger.
*/
public String getName() {
return (name);
return name;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/spy/memcached/compat/log/DefaultLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ public DefaultLogger(String name) {
*/
@Override
public boolean isTraceEnabled() {
return (false);
return false;
}

/**
* Always returns false, debug is not enabled on the DefaultLogger.
*/
@Override
public boolean isDebugEnabled() {
return (false);
return false;
}

/**
* Always returns true, info is always enabled on the DefaultLogger.
*/
@Override
public boolean isInfoEnabled() {
return (true);
return true;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/spy/memcached/compat/log/Level.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ public enum Level {
*/
@Override
public String toString() {
return ("{LogLevel: " + name() + "}");
return "{LogLevel: " + name() + "}";
}
}
6 changes: 3 additions & 3 deletions src/main/java/net/spy/memcached/compat/log/Log4JLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ public Log4JLogger(String name) {

@Override
public boolean isTraceEnabled() {
return (l4jLogger.isTraceEnabled());
return l4jLogger.isTraceEnabled();
}

@Override
public boolean isDebugEnabled() {
return (l4jLogger.isDebugEnabled());
return l4jLogger.isDebugEnabled();
}

@Override
public boolean isInfoEnabled() {
return (l4jLogger.isInfoEnabled());
return l4jLogger.isInfoEnabled();
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/net/spy/memcached/compat/log/LoggerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private static void init() {
* @return a Logger instance
*/
public static Logger getLogger(Class<?> clazz) {
return (getLogger(clazz.getName()));
return getLogger(clazz.getName());
}

/**
Expand All @@ -84,7 +84,7 @@ public static Logger getLogger(String name) {
throw new NullPointerException("Logger name may not be null.");
}
init();
return (instance.internalGetLogger(name));
return instance.internalGetLogger(name);
}

// Get an instance of Logger from internal mechanisms.
Expand All @@ -105,7 +105,7 @@ private Logger internalGetLogger(String name) {
rv = tmp == null ? newLogger : tmp;
}

return (rv);
return rv;
}

private Logger getNewInstance(String name) throws InstantiationException,
Expand All @@ -117,7 +117,7 @@ private Logger getNewInstance(String name) throws InstantiationException,
Object[] args = { name };
Logger rv = instanceConstructor.newInstance(args);

return (rv);
return rv;
}

// Find the appropriate constructor
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/spy/memcached/compat/log/SunLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ public SunLogger(String name) {

@Override
public boolean isTraceEnabled() {
return (sunLogger.isLoggable(java.util.logging.Level.FINEST));
return sunLogger.isLoggable(java.util.logging.Level.FINEST);
}

@Override
public boolean isDebugEnabled() {
return (sunLogger.isLoggable(java.util.logging.Level.FINE));
return sunLogger.isLoggable(java.util.logging.Level.FINE);
}

@Override
public boolean isInfoEnabled() {
return (sunLogger.isLoggable(java.util.logging.Level.INFO));
return sunLogger.isLoggable(java.util.logging.Level.INFO);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ public final boolean isActive() {
* @see net.spy.memcached.MemcachedNode#isAuthenticated()
*/
public boolean isAuthenticated() {
return (0 == authLatch.getCount());
return 0 == authLatch.getCount();
}

/*
Expand Down Expand Up @@ -624,7 +624,7 @@ public final void setupForAuth() {
reconnectBlocked = new ArrayList<Operation>(inputQueue.size() + 1);
inputQueue.drainTo(reconnectBlocked);
}
assert (inputQueue.size() == 0);
assert inputQueue.size() == 0;
setupResend();
} else {
authLatch = new CountDownLatch(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ static int decodeShort(byte[] data, int i) {
}

static int decodeByte(byte[] data, int i) {
return (data[i] & 0xff);
return data[i] & 0xff;
}
static int decodeInt(byte[] data, int i) {
return (data[i] & 0xff) << 24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void initialize() {
protected void decodePayload(byte[] pl) {
final int flags = decodeInt(pl, 0);
final byte[] data = new byte[pl.length - EXTRA_HDR_LEN - keyLen];
System.arraycopy(pl, (EXTRA_HDR_LEN + keyLen), data, 0,
System.arraycopy(pl, EXTRA_HDR_LEN + keyLen, data, 0,
pl.length - EXTRA_HDR_LEN - keyLen);
ReplicaGetOperation.Callback gcb =
(ReplicaGetOperation.Callback) getCallback();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ public void setNotMyVbucketNodes(Collection<MemcachedNode> nodes) {
}

public void setVBucket(String k, short vb) {
assert k.equals(key) : (k + " doesn't match the key " + key
+ " for this operation");
assert k.equals(key) : k + " doesn't match the key " + key
+ " for this operation";
vbucket = vb;
}

public short getVBucket(String k) {
assert k.equals(key) : (k + " doesn't match the key " + key
+ " for this operation");
assert k.equals(key) : k + " doesn't match the key " + key
+ " for this operation";
return vbucket;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public ResponseMessage(byte[] b) {
key = new byte[keylength];
System.arraycopy(b, KEY_OFFSET + engineprivate, key, 0, keylength);
value = new byte[b.length - keylength - engineprivate - KEY_OFFSET];
System.arraycopy(b, (b.length - value.length), value, 0, value.length);
System.arraycopy(b, b.length - value.length, value, 0, value.length);
} else if (opcode.equals(TapOpcode.DELETE)) {
itemflags = 0;
itemexpiry = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ public class SerializingTranscoder extends BaseSerializingTranscoder implements

// Special flags for specially handled types.
private static final int SPECIAL_MASK = 0xff00;
static final int SPECIAL_BOOLEAN = (1 << 8);
static final int SPECIAL_INT = (2 << 8);
static final int SPECIAL_LONG = (3 << 8);
static final int SPECIAL_DATE = (4 << 8);
static final int SPECIAL_BYTE = (5 << 8);
static final int SPECIAL_FLOAT = (6 << 8);
static final int SPECIAL_DOUBLE = (7 << 8);
static final int SPECIAL_BYTEARRAY = (8 << 8);
static final int SPECIAL_BOOLEAN = 1 << 8;
static final int SPECIAL_INT = 2 << 8;
static final int SPECIAL_LONG = 3 << 8;
static final int SPECIAL_DATE = 4 << 8;
static final int SPECIAL_BYTE = 5 << 8;
static final int SPECIAL_FLOAT = 6 << 8;
static final int SPECIAL_DOUBLE = 7 << 8;
static final int SPECIAL_BYTEARRAY = 8 << 8;

private final TranscoderUtils tu = new TranscoderUtils(true);

Expand Down