Fix the complete method in AbstractPromise
@@ -76,8 +76,9 @@ abstract class AbstractPromise<T> implements Promise<T> {
protected void completeExceptionally(@Nullable Throwable e) {
assert next != COMPLETED_PROMISE && next != COMPLETED_EXCEPTIONALLY_PROMISE;
if (next != null) {
+ Callback<? super T> next = this.next;
+ this.next = COMPLETED_EXCEPTIONALLY_PROMISE;
next.accept(null, e);
- next = COMPLETED_EXCEPTIONALLY_PROMISE;
}
}
