Permalink
Browse files

NETTY-418 isCompleteFailure() and isCompleteSuccess() are both true a…

…t the same time

* Fixed incorrect isPartialSuccess(), isPartialFailure(), isCompleteFailure() implementation
  • Loading branch information...
1 parent acb1ac8 commit 95f3af0a02c664f4a73c7ba4f1a32c11aecd28f0 @trustin trustin committed Jul 31, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/main/java/org/jboss/netty/channel/group/DefaultChannelGroupFuture.java
@@ -152,17 +152,18 @@ public synchronized boolean isCompleteSuccess() {
@Override
public synchronized boolean isPartialSuccess() {
- return !futures.isEmpty() && successCount != 0;
+ return successCount != 0 && successCount != futures.size();
}
@Override
public synchronized boolean isPartialFailure() {
- return !futures.isEmpty() && failureCount != 0;
+ return failureCount != 0 && failureCount != futures.size();
}
@Override
public synchronized boolean isCompleteFailure() {
- return failureCount == futures.size();
+ int futureCnt = futures.size();
+ return futureCnt != 0 && failureCount == futureCnt;
}
@Override

0 comments on commit 95f3af0

Please sign in to comment.