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 715395e7eb..0aa94501e7 100644 --- a/common/src/main/java/io/netty/util/concurrent/DefaultPromise.java +++ b/common/src/main/java/io/netty/util/concurrent/DefaultPromise.java @@ -60,7 +60,7 @@ public class DefaultPromise extends AbstractFuture implements Promise { * * Threading - synchronized(this). We must support adding listeners when there is no EventExecutor. */ - private volatile Object listeners; + private Object listeners; /** * Threading - synchronized(this). We are required to hold the monitor to use Java's underlying wait()/notifyAll(). */ @@ -417,13 +417,6 @@ public class DefaultPromise extends AbstractFuture implements Promise { } private void notifyListeners() { - if (listeners == null) { - return; - } - notifyListenersWithStackOverFlowProtection(); - } - - private void notifyListenersWithStackOverFlowProtection() { EventExecutor executor = executor(); if (executor.inEventLoop()) { final InternalThreadLocalMap threadLocals = InternalThreadLocalMap.get(); @@ -448,7 +441,7 @@ public class DefaultPromise extends AbstractFuture implements Promise { } /** - * The logic in this method should be identical to {@link #notifyListenersWithStackOverFlowProtection()} but + * The logic in this method should be identical to {@link #notifyListeners()} but * cannot share code because the listener(s) cannot be cached for an instance of {@link DefaultPromise} since the * listener(s) may be changed and is protected by a synchronized operation. */