From 6329cbe94080df5e72a398e61b3733a026be8390 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Tue, 9 Dec 2008 00:46:29 +0000 Subject: [PATCH] Fixed some findbugs warnings --- .../channel/socket/nio/NioClientSocketPipelineSink.java | 2 +- .../org/jboss/netty/group/DefaultChannelGroupFuture.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketPipelineSink.java b/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketPipelineSink.java index 4ab4ecb537..be0c575843 100644 --- a/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketPipelineSink.java +++ b/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketPipelineSink.java @@ -338,7 +338,7 @@ class NioClientSocketPipelineSink extends AbstractChannelSink { } } - private final class RegisterTask implements Runnable { + private static final class RegisterTask implements Runnable { private final Boss boss; private final NioSocketChannel channel; diff --git a/src/main/java/org/jboss/netty/group/DefaultChannelGroupFuture.java b/src/main/java/org/jboss/netty/group/DefaultChannelGroupFuture.java index 830907d7ef..3f546a9b2c 100644 --- a/src/main/java/org/jboss/netty/group/DefaultChannelGroupFuture.java +++ b/src/main/java/org/jboss/netty/group/DefaultChannelGroupFuture.java @@ -65,19 +65,21 @@ public class DefaultChannelGroupFuture implements ChannelGroupFuture { private final ChannelFutureListener childListener = new ChannelFutureListener() { public void operationComplete(ChannelFuture future) throws Exception { boolean success = future.isSuccess(); + boolean callSetDone = false; synchronized (DefaultChannelGroupFuture.this) { if (success) { successCount ++; } else { failureCount ++; } + + callSetDone = successCount + failureCount == futures.size(); + assert successCount + failureCount <= futures.size(); } - if (successCount + failureCount == futures.size()) { + if (callSetDone) { setDone(); } - - assert successCount + failureCount <= futures.size(); } };