Fixed warnings reported by FindBugs
This commit is contained in:
parent
9d35088801
commit
81d29bafc2
@ -412,6 +412,7 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
return;
|
||||
} catch (Throwable t) {
|
||||
notifyHandlerException(e, t);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -184,6 +184,11 @@ class NioProviderMetadata {
|
||||
if (provider.equals("sun.nio.ch.PollSelectorProvider")) {
|
||||
return 1;
|
||||
}
|
||||
} else if (version.equals("1.6") || version.matches("^1\\.6\\D.*$")) {
|
||||
if (provider.equals("sun.nio.ch.EPollSelectorProvider") ||
|
||||
provider.equals("sun.nio.ch.PollSelectorProvider")) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
// BEA
|
||||
|
@ -53,7 +53,7 @@ public class ThroughputMonitor extends Thread {
|
||||
long newCounter = handler.getTransferredBytes();
|
||||
System.err.format(
|
||||
"%4.3f MiB/s%n",
|
||||
(newCounter - oldCounter) * 1000 / (endTime - startTime) /
|
||||
(newCounter - oldCounter) * 1000.0 / (endTime - startTime) /
|
||||
1048576.0);
|
||||
oldCounter = newCounter;
|
||||
startTime = endTime;
|
||||
|
@ -53,7 +53,7 @@ public class ThroughputMonitor extends Thread {
|
||||
long newCounter = handler.getTransferredBytes();
|
||||
System.err.format(
|
||||
"%4.3f MiB/s%n",
|
||||
(newCounter - oldCounter) * 1000 / (endTime - startTime) /
|
||||
(newCounter - oldCounter) * 1000.0 / (endTime - startTime) /
|
||||
1048576.0);
|
||||
oldCounter = newCounter;
|
||||
startTime = endTime;
|
||||
|
@ -178,7 +178,7 @@ class ReplayingDecoderBuffer implements ChannelBuffer {
|
||||
}
|
||||
|
||||
public int indexOf(int fromIndex, int toIndex, byte value) {
|
||||
int endIndex = indexOf(buffer.readerIndex(), buffer.writerIndex(), value);
|
||||
int endIndex = buffer.indexOf(buffer.readerIndex(), buffer.writerIndex(), value);
|
||||
if (endIndex < 0) {
|
||||
throw REPLAY;
|
||||
}
|
||||
@ -187,7 +187,7 @@ class ReplayingDecoderBuffer implements ChannelBuffer {
|
||||
|
||||
public int indexOf(int fromIndex, int toIndex,
|
||||
ChannelBufferIndexFinder indexFinder) {
|
||||
int endIndex = indexOf(buffer.readerIndex(), buffer.writerIndex(), indexFinder);
|
||||
int endIndex = buffer.indexOf(buffer.readerIndex(), buffer.writerIndex(), indexFinder);
|
||||
if (endIndex < 0) {
|
||||
throw REPLAY;
|
||||
}
|
||||
|
@ -37,6 +37,8 @@ import org.jboss.netty.channel.Channel;
|
||||
import org.jboss.netty.channel.ChannelEvent;
|
||||
import org.jboss.netty.channel.ChannelState;
|
||||
import org.jboss.netty.channel.ChannelStateEvent;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
import org.jboss.netty.logging.InternalLoggerFactory;
|
||||
import org.jboss.netty.util.LinkedTransferQueue;
|
||||
|
||||
/**
|
||||
@ -81,6 +83,9 @@ import org.jboss.netty.util.LinkedTransferQueue;
|
||||
*/
|
||||
public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
|
||||
|
||||
private static final InternalLogger logger =
|
||||
InternalLoggerFactory.getInstance(MemoryAwareThreadPoolExecutor.class);
|
||||
|
||||
private volatile Settings settings = new Settings(0, 0);
|
||||
|
||||
// XXX Can be changed in runtime now. Make it mutable in 3.1.
|
||||
@ -174,8 +179,11 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
|
||||
try {
|
||||
Method m = getClass().getMethod("allowCoreThreadTimeOut", new Class[] { boolean.class });
|
||||
m.invoke(this, Boolean.TRUE);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable t) {
|
||||
// Java 5
|
||||
logger.debug(
|
||||
"ThreadPoolExecutor.allowCoreThreadTimeOut() is not " +
|
||||
"supported in this platform.");
|
||||
}
|
||||
|
||||
setMaxChannelMemorySize(maxChannelMemorySize);
|
||||
|
@ -77,7 +77,6 @@ public class SslBufferPool {
|
||||
if (maxPoolSize % MAX_PACKET_SIZE != 0) {
|
||||
maxBufferCount ++;
|
||||
}
|
||||
maxPoolSize = maxBufferCount * MAX_PACKET_SIZE;
|
||||
|
||||
pool = new ByteBuffer[maxBufferCount];
|
||||
this.maxBufferCount = maxBufferCount;
|
||||
|
@ -616,6 +616,8 @@ public class SslHandler extends FrameDecoder {
|
||||
break;
|
||||
case FINISHED:
|
||||
setHandshakeSuccess(channel);
|
||||
wrap(ctx, channel);
|
||||
break loop;
|
||||
case NOT_HANDSHAKING:
|
||||
wrap(ctx, channel);
|
||||
break loop;
|
||||
|
@ -128,7 +128,7 @@ public class LinkedTransferQueue<E> extends AbstractQueue<E> implements Blocking
|
||||
private static final long serialVersionUID = 5925596372370723938L;
|
||||
|
||||
volatile QNode next;
|
||||
volatile Thread waiter; // to control park/unpark
|
||||
transient volatile Thread waiter; // to control park/unpark
|
||||
final boolean isData;
|
||||
|
||||
QNode(Object item, boolean isData) {
|
||||
|
Loading…
Reference in New Issue
Block a user