desruisseaux commented on code in PR #1027:
URL:
https://github.com/apache/maven-compiler-plugin/pull/1027#discussion_r2756432578
##########
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:
> yes but I think it is cleaner to ensure we have a listener
`DiagnosticListener` is used only by `javax.tools.JavaCompiler` in tasks
that are created only by `ToolExecutor`. The logic was that the `ToolExecutor`
constructor is a mandatory passage before the listener is used, therefore
creating a default listener in `ToolExecutor` constructor guarantees that we
have a listener in the class that needs it. By contrast, `AbstractCompilerMojo`
does nothing with the listener.
--
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]