diff --git a/cli/src/main/java/de/jplag/cli/logger/DelayablePrinter.java b/cli/src/main/java/de/jplag/cli/logger/DelayablePrinter.java index eb00c87e0..f8b1d5fce 100644 --- a/cli/src/main/java/de/jplag/cli/logger/DelayablePrinter.java +++ b/cli/src/main/java/de/jplag/cli/logger/DelayablePrinter.java @@ -35,7 +35,7 @@ private DelayablePrinter() { * Prints the given string to the terminal appending a line-break * @param output The string to print */ - synchronized public void println(String output) { + public synchronized void println(String output) { this.outputQueue.offer(output); this.printQueue(); } @@ -43,14 +43,14 @@ synchronized public void println(String output) { /** * Stops printing to the terminal until {@link #resume()} is called */ - synchronized public void delay() { + public synchronized void delay() { this.isDelayed = true; } /** * Resumes printing if {@link #delay()} was called */ - synchronized public void resume() { + public synchronized void resume() { this.isDelayed = false; this.printQueue(); } @@ -62,7 +62,7 @@ public void setOutputStream(PrintStream printStream) { this.targetStream = printStream; } - synchronized private void printQueue() { + private synchronized void printQueue() { if (!this.isDelayed) { while (!this.outputQueue.isEmpty()) { this.targetStream.println(this.outputQueue.poll()); diff --git a/cli/src/test/java/de/jplag/cli/logger/DelayablePrinterTest.java b/cli/src/test/java/de/jplag/cli/logger/DelayablePrinterTest.java index 51063b465..540f9ca08 100644 --- a/cli/src/test/java/de/jplag/cli/logger/DelayablePrinterTest.java +++ b/cli/src/test/java/de/jplag/cli/logger/DelayablePrinterTest.java @@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test; class DelayablePrinterTest { - private final static String TEST_MESSAGE = "Hello World"; + private static final String TEST_MESSAGE = "Hello World"; private static ByteArrayOutputStream outputStream;