X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=common%2Futil%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Futil%2Fconcurrent%2FAsyncNotifyingListenableFutureTask.java;h=53629b033055c47f9d84018c240888e2226df7fd;hb=1eb87c819cc6881ca7be74917a5d0bb7a9cad41f;hp=0e36b74da3dc9c8d50721388ee438197cfa84fb0;hpb=8db9e47c66243774ad4291dcbed9012e70f33503;p=yangtools.git diff --git a/common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/AsyncNotifyingListenableFutureTask.java b/common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/AsyncNotifyingListenableFutureTask.java index 0e36b74da3..53629b0330 100644 --- a/common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/AsyncNotifyingListenableFutureTask.java +++ b/common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/AsyncNotifyingListenableFutureTask.java @@ -136,11 +136,10 @@ public class AsyncNotifyingListenableFutureTask extends FutureTask impleme */ public static AsyncNotifyingListenableFutureTask create(final Callable callable, @Nullable final Executor listenerExecutor) { - if (listenerExecutor != null) { - return new DelegatingAsyncNotifyingListenableFutureTask<>(callable, listenerExecutor); - } else { + if (listenerExecutor == null) { return new AsyncNotifyingListenableFutureTask<>(callable); } + return new DelegatingAsyncNotifyingListenableFutureTask<>(callable, listenerExecutor); } /** @@ -155,11 +154,10 @@ public class AsyncNotifyingListenableFutureTask extends FutureTask impleme */ public static AsyncNotifyingListenableFutureTask create(final Runnable runnable, @Nullable final V result, @Nullable final Executor listenerExecutor) { - if (listenerExecutor != null) { - return new DelegatingAsyncNotifyingListenableFutureTask<>(runnable, result, listenerExecutor); - } else { + if (listenerExecutor == null) { return new AsyncNotifyingListenableFutureTask<>(runnable, result); } + return new DelegatingAsyncNotifyingListenableFutureTask<>(runnable, result, listenerExecutor); } @Override