From 4251ac54d710222151682a52e3438f76a31cdbc4 Mon Sep 17 00:00:00 2001 From: Hunter Mellema Date: Fri, 28 Jul 2023 09:54:05 -0600 Subject: [PATCH] Resolve spotbugs error --- config/spotbugs/filter.xml | 6 ++++++ .../java/software/amazon/smithy/cli/ProgressTracker.java | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config/spotbugs/filter.xml b/config/spotbugs/filter.xml index 3e4ed00a8e0..9ab37122607 100644 --- a/config/spotbugs/filter.xml +++ b/config/spotbugs/filter.xml @@ -188,4 +188,10 @@ + + + + + + diff --git a/smithy-cli/src/main/java/software/amazon/smithy/cli/ProgressTracker.java b/smithy-cli/src/main/java/software/amazon/smithy/cli/ProgressTracker.java index 7144bc4d948..daeb9f5a7ea 100644 --- a/smithy-cli/src/main/java/software/amazon/smithy/cli/ProgressTracker.java +++ b/smithy-cli/src/main/java/software/amazon/smithy/cli/ProgressTracker.java @@ -17,7 +17,7 @@ public final class ProgressTracker implements AutoCloseable { thread.setDaemon(true); return thread; }); - private final long intervalMillis = 400L; + private static final long INTERVAL_MILLIS = 400L; private final ScheduledFuture task; private final ProgressStyle style; private final Command.Env env; @@ -25,7 +25,7 @@ public final class ProgressTracker implements AutoCloseable { public ProgressTracker(Command.Env env, ProgressStyle style) { this.env = env; this.style = style; - task = EXECUTOR.scheduleAtFixedRate(this::write, 0, intervalMillis, TimeUnit.MILLISECONDS); + task = EXECUTOR.scheduleAtFixedRate(this::write, 0, INTERVAL_MILLIS, TimeUnit.MILLISECONDS); } @Override