desruisseaux commented on code in PR #1027:
URL: 
https://github.com/apache/maven-compiler-plugin/pull/1027#discussion_r2753790894


##########
src/main/java/org/apache/maven/plugin/compiler/ToolExecutor.java:
##########
@@ -222,12 +218,8 @@ public class ToolExecutor {
     protected ToolExecutor(final AbstractCompilerMojo mojo, 
DiagnosticListener<? super JavaFileObject> listener)
             throws IOException {
 
+        this.listener = requireNonNull(listener, "DiagnosticListener can't be 
null in ToolExecutor");

Review Comment:
   With this change, we are forcing all callers to create the 
`DiagnosticListener` themselves instead of creating the default instance in one 
single place. A `useOrCreateListener` method was added in another change, but 
it forgot that `ToolExecutor` is extended by `ToolExecutorForTest`. The latter 
is now broken.
   
   If the goal was to access the `messageLogType` field, it was not necessary 
to move this code. It can be accessed as `mojo.messageLogType`.



-- 
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]

Reply via email to