Remove unnecessary this, parenthesis, and semicolons
This commit is contained in:
parent
5d1690dfa7
commit
c3c75717db
@ -62,14 +62,14 @@ public class BigEndianHeapChannelBuffer extends HeapChannelBuffer {
|
||||
public int getUnsignedMedium(int index) {
|
||||
return (array[index] & 0xff) << 16 |
|
||||
(array[index + 1] & 0xff) << 8 |
|
||||
(array[index + 2] & 0xff);
|
||||
array[index + 2] & 0xff;
|
||||
}
|
||||
|
||||
public int getInt(int index) {
|
||||
return (array[index] & 0xff) << 24 |
|
||||
(array[index + 1] & 0xff) << 16 |
|
||||
(array[index + 2] & 0xff) << 8 |
|
||||
(array[index + 3] & 0xff);
|
||||
array[index + 3] & 0xff;
|
||||
}
|
||||
|
||||
public long getLong(int index) {
|
||||
@ -80,7 +80,7 @@ public class BigEndianHeapChannelBuffer extends HeapChannelBuffer {
|
||||
((long) array[index + 4] & 0xff) << 24 |
|
||||
((long) array[index + 5] & 0xff) << 16 |
|
||||
((long) array[index + 6] & 0xff) << 8 |
|
||||
((long) array[index + 7] & 0xff);
|
||||
(long) array[index + 7] & 0xff;
|
||||
}
|
||||
|
||||
public void setShort(int index, int value) {
|
||||
|
@ -99,7 +99,7 @@ public class ByteBufferBackedChannelBuffer extends AbstractChannelBuffer {
|
||||
public int getUnsignedMedium(int index) {
|
||||
return (getByte(index) & 0xff) << 16 |
|
||||
(getByte(index + 1) & 0xff) << 8 |
|
||||
(getByte(index + 2) & 0xff);
|
||||
getByte(index + 2) & 0xff;
|
||||
}
|
||||
|
||||
public int getInt(int index) {
|
||||
|
@ -60,20 +60,20 @@ public class LittleEndianHeapChannelBuffer extends HeapChannelBuffer {
|
||||
}
|
||||
|
||||
public int getUnsignedMedium(int index) {
|
||||
return (array[index] & 0xff) |
|
||||
return array[index] & 0xff |
|
||||
(array[index + 1] & 0xff) << 8 |
|
||||
(array[index + 2] & 0xff) << 16;
|
||||
}
|
||||
|
||||
public int getInt(int index) {
|
||||
return (array[index] & 0xff) |
|
||||
return array[index] & 0xff |
|
||||
(array[index + 1] & 0xff) << 8 |
|
||||
(array[index + 2] & 0xff) << 16 |
|
||||
(array[index + 3] & 0xff) << 24;
|
||||
}
|
||||
|
||||
public long getLong(int index) {
|
||||
return ((long) array[index] & 0xff) |
|
||||
return (long) array[index] & 0xff |
|
||||
((long) array[index + 1] & 0xff) << 8 |
|
||||
((long) array[index + 2] & 0xff) << 16 |
|
||||
((long) array[index + 3] & 0xff) << 24 |
|
||||
|
@ -109,5 +109,5 @@ public enum ChannelState {
|
||||
* Represents a {@link Channel}'s {@link Channel#getInterestOps() interestOps}
|
||||
* property
|
||||
*/
|
||||
INTEREST_OPS;
|
||||
INTEREST_OPS
|
||||
}
|
||||
|
@ -20,5 +20,5 @@ package org.jboss.netty.channel.socket;
|
||||
*/
|
||||
public enum InternetProtocolFamily {
|
||||
IPv4,
|
||||
IPv6;
|
||||
IPv6
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
|
||||
for (SelectionKey key: selector.keys()) {
|
||||
SelectableChannel ch = key.channel();
|
||||
try {
|
||||
if ((ch instanceof DatagramChannel && !((DatagramChannel) ch).isConnected()) ||
|
||||
if (ch instanceof DatagramChannel && !((DatagramChannel) ch).isConnected() ||
|
||||
ch instanceof SocketChannel && !((SocketChannel) ch).isConnected()) {
|
||||
notConnected = true;
|
||||
// cancel the key just to be on the safe side
|
||||
|
@ -15,11 +15,11 @@
|
||||
*/
|
||||
package org.jboss.netty.channel.socket.nio;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.jboss.netty.util.ExternalResourceReleasable;
|
||||
import org.jboss.netty.util.internal.ByteBufferUtil;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
final class SocketReceiveBufferAllocator implements ExternalResourceReleasable {
|
||||
|
||||
private ByteBuffer buf;
|
||||
@ -42,7 +42,7 @@ final class SocketReceiveBufferAllocator implements ExternalResourceReleasable {
|
||||
return newBuffer(size);
|
||||
} else if (buf.capacity() < size) {
|
||||
return newBuffer(size);
|
||||
} else if (((buf.capacity() / 100) * percentual) > size) {
|
||||
} else if (buf.capacity() * percentual / 100 > size) {
|
||||
if (++exceedCount == maxExceedCount) {
|
||||
return newBuffer(size);
|
||||
} else {
|
||||
|
@ -31,6 +31,7 @@ public final class WebSocketSslServerSslContext {
|
||||
|
||||
private static final InternalLogger logger = InternalLoggerFactory.getInstance(WebSocketSslServerSslContext.class);
|
||||
private static final String PROTOCOL = "TLS";
|
||||
|
||||
private final SSLContext _serverContext;
|
||||
|
||||
/**
|
||||
@ -54,6 +55,7 @@ public final class WebSocketSslServerSslContext {
|
||||
* Constructor for singleton
|
||||
*/
|
||||
private WebSocketSslServerSslContext() {
|
||||
SSLContext serverContext = null;
|
||||
try {
|
||||
// Key store (Server side certificate)
|
||||
String algorithm = Security.getProperty("ssl.KeyManagerFactory.algorithm");
|
||||
@ -61,7 +63,6 @@ public final class WebSocketSslServerSslContext {
|
||||
algorithm = "SunX509";
|
||||
}
|
||||
|
||||
SSLContext serverContext = null;
|
||||
try {
|
||||
String keyStoreFilePath = System.getProperty("keystore.file.path");
|
||||
String keyStoreFilePassword = System.getProperty("keystore.file.password");
|
||||
@ -82,13 +83,13 @@ public final class WebSocketSslServerSslContext {
|
||||
} catch (Exception e) {
|
||||
throw new Error("Failed to initialize the server-side SSLContext", e);
|
||||
}
|
||||
_serverContext = serverContext;
|
||||
} catch (Exception ex) {
|
||||
if (logger.isErrorEnabled()) {
|
||||
logger.error("Error initializing SslContextManager. " + ex.getMessage(), ex);
|
||||
}
|
||||
System.exit(1);
|
||||
|
||||
} finally {
|
||||
_serverContext = serverContext;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,5 +36,5 @@ public enum ZlibWrapper {
|
||||
* Try {@link #ZLIB} first and then {@link #NONE} if the first attempt fails.
|
||||
* Please note that you can specify this wrapper type only when decompressing.
|
||||
*/
|
||||
ZLIB_OR_NONE;
|
||||
ZLIB_OR_NONE
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
|
||||
READ_CHUNKED_CONTENT,
|
||||
READ_CHUNKED_CONTENT_AS_CHUNKS,
|
||||
READ_CHUNK_DELIMITER,
|
||||
READ_CHUNK_FOOTER;
|
||||
READ_CHUNK_FOOTER
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -299,7 +299,7 @@ public class ChunkedWriteHandler
|
||||
|
||||
}
|
||||
|
||||
if (acquired && ((!channel.isConnected() || channel.isWritable() && !queue.isEmpty() && !suspend)
|
||||
if (acquired && (!channel.isConnected() || channel.isWritable() && !queue.isEmpty() && !suspend
|
||||
|| flushNeeded)) {
|
||||
flush(ctx, fireNow);
|
||||
}
|
||||
|
@ -33,5 +33,5 @@ public enum IdleState {
|
||||
/**
|
||||
* No data was either received or sent for a while.
|
||||
*/
|
||||
ALL_IDLE;
|
||||
ALL_IDLE
|
||||
}
|
||||
|
@ -34,5 +34,5 @@ public enum InternalLogLevel {
|
||||
/**
|
||||
* 'ERROR' log level.
|
||||
*/
|
||||
ERROR;
|
||||
ERROR
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public final class JZlib {
|
||||
static final int MAX_BL_BITS = 7;
|
||||
|
||||
static enum WrapperType {
|
||||
NONE, ZLIB, GZIP, ZLIB_OR_NONE;
|
||||
NONE, ZLIB, GZIP, ZLIB_OR_NONE
|
||||
}
|
||||
|
||||
private JZlib() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user