Skip to content

Commit f287725

Browse files
committed
Minor smell-fixes and formatting in Shell class
1 parent 035c7d8 commit f287725

File tree

1 file changed

+7
-4
lines changed
  • src/main/java/io/github/bonigarcia/wdm/versions

1 file changed

+7
-4
lines changed

src/main/java/io/github/bonigarcia/wdm/versions/Shell.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.io.InputStream;
2626
import java.util.Arrays;
2727
import java.util.concurrent.CompletableFuture;
28+
import java.util.concurrent.ExecutionException;
2829
import java.util.concurrent.TimeUnit;
2930
import java.util.concurrent.atomic.AtomicInteger;
3031

@@ -103,7 +104,7 @@ public static String runAndWaitNoLog(int timeoutSeconds, File folder,
103104
}
104105
return StringUtils.EMPTY;
105106
}
106-
107+
107108
private static class StreamReader implements Runnable {
108109
private final CompletableFuture<String> output = new CompletableFuture<>();
109110
private final InputStream is;
@@ -115,7 +116,8 @@ private StreamReader(InputStream is) {
115116

116117
private static StreamReader consume(InputStream is, String streamName) {
117118
StreamReader streamReader = new StreamReader(is);
118-
Thread t = new Thread(streamReader, "streamReader-" + id.getAndIncrement() + "-" + streamName);
119+
Thread t = new Thread(streamReader,
120+
"streamReader-" + id.getAndIncrement() + "-" + streamName);
119121
t.setDaemon(true);
120122
t.start();
121123
return streamReader;
@@ -135,9 +137,10 @@ public void run() {
135137
} catch (Exception e) {
136138
output.completeExceptionally(e);
137139
}
138-
};
140+
}
139141

140-
public String getOutput() throws Exception {
142+
public String getOutput()
143+
throws InterruptedException, ExecutionException {
141144
return output.get();
142145
}
143146
}

0 commit comments

Comments
 (0)