From cf821683f8fafef38b8711c28d0e71745f7c55b6 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Mon, 10 Feb 2014 11:47:54 -0800 Subject: [PATCH] Fix a bug where DefaultPromise.setUncancellable() returns a wrong value - Fixes #2220 - again - Missing negation --- .../main/java/io/netty/util/concurrent/DefaultPromise.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/io/netty/util/concurrent/DefaultPromise.java b/common/src/main/java/io/netty/util/concurrent/DefaultPromise.java index 2f396d1aac..fcacd61832 100644 --- a/common/src/main/java/io/netty/util/concurrent/DefaultPromise.java +++ b/common/src/main/java/io/netty/util/concurrent/DefaultPromise.java @@ -461,14 +461,14 @@ public class DefaultPromise extends AbstractFuture implements Promise { public boolean setUncancellable() { Object result = this.result; if (isDone0(result)) { - return isCancelled0(result); + return !isCancelled0(result); } synchronized (this) { // Allow only once. result = this.result; if (isDone0(result)) { - return isCancelled0(result); + return !isCancelled0(result); } this.result = UNCANCELLABLE;