[hotfix] Fix checkstyle violations in FutureUtils
Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/17fde338 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/17fde338 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/17fde338 Branch: refs/heads/release-1.6 Commit: 17fde3386de8f05f331f77f213148774e46f6617 Parents: 2343567 Author: Till Rohrmann <trohrm...@apache.org> Authored: Sun Jul 22 20:20:53 2018 +0200 Committer: Till Rohrmann <trohrm...@apache.org> Committed: Tue Jul 24 00:06:31 2018 +0200 ---------------------------------------------------------------------- .../apache/flink/runtime/concurrent/FutureUtils.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/17fde338/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java b/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java index 3a7e800..d4a65de 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java @@ -22,7 +22,6 @@ import org.apache.flink.api.common.time.Deadline; import org.apache.flink.api.common.time.Time; import org.apache.flink.runtime.util.ExecutorThreadFactory; import org.apache.flink.util.ExceptionUtils; -import org.apache.flink.util.Preconditions; import org.apache.flink.util.function.RunnableWithException; import org.apache.flink.util.function.SupplierWithException; @@ -786,7 +785,7 @@ public class FutureUtils { private final CompletableFuture<?> future; private Timeout(CompletableFuture<?> future) { - this.future = Preconditions.checkNotNull(future); + this.future = checkNotNull(future); } @Override @@ -800,8 +799,9 @@ public class FutureUtils { * * <p>This class creates a singleton scheduler used to run the provided actions. */ - private static final class Delayer { - static final ScheduledThreadPoolExecutor delayer = new ScheduledThreadPoolExecutor( + private enum Delayer { + ; + static final ScheduledThreadPoolExecutor DELAYER = new ScheduledThreadPoolExecutor( 1, new ExecutorThreadFactory("FlinkCompletableFutureDelayScheduler")); @@ -814,10 +814,10 @@ public class FutureUtils { * @return Future of the scheduled action */ private static ScheduledFuture<?> delay(Runnable runnable, long delay, TimeUnit timeUnit) { - Preconditions.checkNotNull(runnable); - Preconditions.checkNotNull(timeUnit); + checkNotNull(runnable); + checkNotNull(timeUnit); - return delayer.schedule(runnable, delay, timeUnit); + return DELAYER.schedule(runnable, delay, timeUnit); } } }