File tree Expand file tree Collapse file tree 2 files changed +5
-17
lines changed
platform-tooling-support-tests/src/main/java/platform/tooling/support/process Expand file tree Collapse file tree 2 files changed +5
-17
lines changed Original file line number Diff line number Diff line change 1313import java .io .ByteArrayOutputStream ;
1414import java .nio .charset .Charset ;
1515
16- public class WatchedOutput {
16+ record WatchedOutput ( Thread thread , ByteArrayOutputStream stream ) {
1717
1818 private static final Charset CHARSET = Charset .forName (System .getProperty ("native.encoding" ));
1919
20- private final Thread thread ;
21- private final ByteArrayOutputStream stream ;
22-
23- WatchedOutput (Thread thread , ByteArrayOutputStream stream ) {
24- this .thread = thread ;
25- this .stream = stream ;
26- }
27-
28- void join () throws InterruptedException {
29- thread .join ();
30- }
31-
32- public String getStreamAsString () {
20+ String streamAsString () {
3321 return stream .toString (CHARSET );
3422 }
3523}
Original file line number Diff line number Diff line change @@ -36,13 +36,13 @@ ProcessResult waitFor() throws InterruptedException {
3636 }
3737 finally {
3838 try {
39- out .join ();
39+ out .thread (). join ();
4040 }
4141 finally {
42- err .join ();
42+ err .thread (). join ();
4343 }
4444 }
45- return new ProcessResult (exitCode , out .getStreamAsString (), err .getStreamAsString ());
45+ return new ProcessResult (exitCode , out .streamAsString (), err .streamAsString ());
4646 }
4747 finally {
4848 process .destroyForcibly ();
You can’t perform that action at this time.
0 commit comments