Pankraz76 commented on code in PR #2440: URL: https://github.com/apache/maven/pull/2440#discussion_r2132454289
########## impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java: ########## @@ -407,11 +407,7 @@ protected Consumer<String> doDetermineWriter(C context) { } else { // Given the terminal creation has been offloaded to a different thread, // do not pass directly the terminal writer - return msg -> { - PrintWriter pw = context.terminal.writer(); - pw.println(msg); - pw.flush(); - }; + return msg -> context.terminal.writer().println(msg); Review Comment: whats the purpose of not using delegation, therefore considered promoting boilerplate? it will be flushed, when closed triggered within finallize by `gc`. we should not make explicit, what already there (done by someone else). ########## impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java: ########## @@ -407,11 +407,7 @@ protected Consumer<String> doDetermineWriter(C context) { } else { // Given the terminal creation has been offloaded to a different thread, // do not pass directly the terminal writer - return msg -> { - PrintWriter pw = context.terminal.writer(); - pw.println(msg); - pw.flush(); - }; + return msg -> context.terminal.writer().println(msg); Review Comment: whats the purpose of not using delegation? it will be flushed, when closed triggered within finallize by `gc`. we should not make explicit, what already there (done by someone else). -- 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: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org