Skip to content

Commit

Permalink
Make progress tracker package private
Browse files Browse the repository at this point in the history
  • Loading branch information
hpmellema committed Jul 31, 2023
1 parent 7cac57e commit f52d26a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/spotbugs/filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
import software.amazon.smithy.cli.ColorTheme;
import software.amazon.smithy.cli.Command;
import software.amazon.smithy.cli.HelpPrinter;
import software.amazon.smithy.cli.ProgressStyle;
import software.amazon.smithy.cli.ProgressTracker;
import software.amazon.smithy.cli.StandardOptions;
import software.amazon.smithy.model.node.Node;
import software.amazon.smithy.model.node.ObjectNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
* SPDX-License-Identifier: Apache-2.0
*/

package software.amazon.smithy.cli;
package software.amazon.smithy.cli.commands;

import software.amazon.smithy.cli.ColorBuffer;
import software.amazon.smithy.cli.ColorTheme;
import software.amazon.smithy.cli.Command;
import software.amazon.smithy.utils.StringUtils;


public interface ProgressStyle {
interface ProgressStyle {

void updateAction(Command.Env env);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
* SPDX-License-Identifier: Apache-2.0
*/

package software.amazon.smithy.cli;
package software.amazon.smithy.cli.commands;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import software.amazon.smithy.cli.Command;

public final class ProgressTracker implements AutoCloseable {
final class ProgressTracker implements AutoCloseable {
private static final ScheduledThreadPoolExecutor EXECUTOR = new ScheduledThreadPoolExecutor(1, runnable -> {
Thread thread = Executors.defaultThreadFactory().newThread(runnable);
thread.setDaemon(true);
Expand All @@ -23,7 +24,7 @@ public final class ProgressTracker implements AutoCloseable {
private final Command.Env env;
private final boolean quiet;

public ProgressTracker(Command.Env env, ProgressStyle style, boolean quiet) {
ProgressTracker(Command.Env env, ProgressStyle style, boolean quiet) {
this.env = env;
this.style = style;
this.quiet = quiet;
Expand Down

0 comments on commit f52d26a

Please sign in to comment.