elharo commented on code in PR #399:
URL:
https://github.com/apache/maven-shared-utils/pull/399#discussion_r3703185333
##########
src/main/java/org/apache/maven/shared/utils/cli/CommandLineUtils.java:
##########
@@ -274,34 +274,18 @@ public Integer call() throws CommandLineException {
int returnValue = p.waitFor();
- // TODO Find out if waitUntilDone needs to be called using
a try-finally construct. The method may
- // throw an
- // InterruptedException so that calls to
waitUntilDone may be skipped.
- // try
- // {
- // if ( inputFeeder != null )
- // {
- // inputFeeder.waitUntilDone();
- // }
- // }
- // finally
- // {
- // try
- // {
- // outputPumper.waitUntilDone();
- // }
- // finally
- // {
- // errorPumper.waitUntilDone();
- // }
- // }
- if (inputFeeder != null) {
- inputFeeder.waitUntilDone();
+ try {
+ if (inputFeeder != null) {
+ inputFeeder.waitUntilDone();
+ }
+ } finally {
+ try {
+ outputPumper.waitUntilDone();
+ } finally {
+ errorPumper.waitUntilDone();
+ }
Review Comment:
Makes sense, but I think I;m going to leave that for a future PR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]