From 74cd10551fb3b2e9e9b3472ea6d483e41087ac2f Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 6 Apr 2021 23:10:41 -0700 Subject: [PATCH] Automatic code cleanup. PiperOrigin-RevId: 367157244 --- .../util/io/LineWrappingAnsiTerminalWriterTest.java | 12 ++++++------ .../util/io/StreamMultiplexerParallelStressTest.java | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/test/java/com/google/devtools/build/lib/util/io/LineWrappingAnsiTerminalWriterTest.java b/src/test/java/com/google/devtools/build/lib/util/io/LineWrappingAnsiTerminalWriterTest.java index 0a2b5a64bbeeda..9e55a698add55a 100644 --- a/src/test/java/com/google/devtools/build/lib/util/io/LineWrappingAnsiTerminalWriterTest.java +++ b/src/test/java/com/google/devtools/build/lib/util/io/LineWrappingAnsiTerminalWriterTest.java @@ -33,21 +33,21 @@ public class LineWrappingAnsiTerminalWriterTest { @Test public void testSimpleLineWrapping() throws IOException { LoggingTerminalWriter terminal = new LoggingTerminalWriter(); - (new LineWrappingAnsiTerminalWriter(terminal, 5, '+')).append("abcdefghij"); + new LineWrappingAnsiTerminalWriter(terminal, 5, '+').append("abcdefghij"); assertThat(terminal.getTranscript()).isEqualTo("abcd+" + NL + "efgh+" + NL + "ij"); } @Test public void testAlwaysWrap() throws IOException { LoggingTerminalWriter terminal = new LoggingTerminalWriter(); - (new LineWrappingAnsiTerminalWriter(terminal, 5, '+')).append("12345").newline(); + new LineWrappingAnsiTerminalWriter(terminal, 5, '+').append("12345").newline(); assertThat(terminal.getTranscript()).isEqualTo("1234+" + NL + "5" + NL); } @Test public void testWrapLate() throws IOException { LoggingTerminalWriter terminal = new LoggingTerminalWriter(); - (new LineWrappingAnsiTerminalWriter(terminal, 5, '+')).append("1234"); + new LineWrappingAnsiTerminalWriter(terminal, 5, '+').append("1234"); // Lines are only wrapped, once a character is written that cannot fit in the current line, and // not already once the last usable character of a line is used. Hence, in this example, we do // not want to see the continuation character. @@ -57,14 +57,14 @@ public void testWrapLate() throws IOException { @Test public void testNewlineTranslated() throws IOException { LoggingTerminalWriter terminal = new LoggingTerminalWriter(); - (new LineWrappingAnsiTerminalWriter(terminal, 80, '+')).append("foo\nbar\n"); + new LineWrappingAnsiTerminalWriter(terminal, 80, '+').append("foo\nbar\n"); assertThat(terminal.getTranscript()).isEqualTo("foo" + NL + "bar" + NL); } @Test public void testNewlineResetsCount() throws IOException { LoggingTerminalWriter terminal = new LoggingTerminalWriter(); - (new LineWrappingAnsiTerminalWriter(terminal, 5, '+')) + new LineWrappingAnsiTerminalWriter(terminal, 5, '+') .append("123") .newline() .append("abc") @@ -78,7 +78,7 @@ public void testNewlineResetsCount() throws IOException { @Test public void testEventsPassedThrough() throws IOException { LoggingTerminalWriter terminal = new LoggingTerminalWriter(); - (new LineWrappingAnsiTerminalWriter(terminal, 80, '+')) + new LineWrappingAnsiTerminalWriter(terminal, 80, '+') .okStatus() .append("ok") .failStatus() diff --git a/src/test/java/com/google/devtools/build/lib/util/io/StreamMultiplexerParallelStressTest.java b/src/test/java/com/google/devtools/build/lib/util/io/StreamMultiplexerParallelStressTest.java index 5b4793ff8f1478..b37db461f2bdf1 100644 --- a/src/test/java/com/google/devtools/build/lib/util/io/StreamMultiplexerParallelStressTest.java +++ b/src/test/java/com/google/devtools/build/lib/util/io/StreamMultiplexerParallelStressTest.java @@ -96,7 +96,8 @@ public Object call() throws Exception { case 4: out = streams[random.nextInt(3)]; break; - } + default: // fall out + } } return null; }