Skip to content

Commit

Permalink
Resolve spotbugs error
Browse files Browse the repository at this point in the history
  • Loading branch information
hpmellema committed Jul 28, 2023
1 parent cfeb72b commit 4251ac5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions config/spotbugs/filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,10 @@
<Bug pattern="SF_SWITCH_FALLTHROUGH"/>
</Match>

<!-- It is not worth catching if the closing task of a progress bar fails to execute -->
<Match>
<Class name="software.amazon.smithy.cli.ProgressTracker"/>
<Bug pattern="DE_MIGHT_IGNORE"/>
</Match>

</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ 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;

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
Expand Down

0 comments on commit 4251ac5

Please sign in to comment.