Fix a bug where DefaultPromise.setUncancellable() returns a wrong value
- Fixes #2220 - again - Missing negation
This commit is contained in:
parent
7e0e4c6325
commit
0e71da3082
@ -461,14 +461,14 @@ public class DefaultPromise<V> extends AbstractFuture<V> implements Promise<V> {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user