jglick commented on issue #3675:
URL: https://github.com/apache/netbeans/issues/3675#issuecomment-1310822597

   Long broken. Can be reproduced in trunk (running IDE on Java 17 if it 
matters):
   * Configure the Maven executable to be mvnd (0.8.2, running on Java 11 if it 
matters).
   * Configure non-test Maven executions to pass `-DskipTests`.
   * Check out & open https://github.com/jenkinsci/jenkins.
   * Clean & build. Error is thrown and log stops after
   ```
   …
   [cli] 
   [cli] 
   [cli] [INFO] 
   [cli] [INFO] --- maven-checkstyle-plugin:3.2.0:check (validate) @ cli ---
   [jenkins-bom] 
   [jenkins-bom] 
   [jenkins-bom] [INFO] 
   [jenkins-bom] [INFO] >>> spotbugs-maven-plugin:4.7.2.1:check (spotbugs) > 
:spotbugs @ jenkins-bom >>>
   
   --- spotbugs-maven-plugin:4.7.2.1:spotbugs (spotbugs) @ jenkins-bom ---
   ```
   
   Has something to do with the forked execution of 
https://spotbugs.github.io/spotbugs-maven-plugin/check-mojo.html.
   
   Unfortunately the obvious quick fixes like
   
   ```diff
   diff --git 
java/maven/src/org/netbeans/modules/maven/execute/cmd/ExecutionEventObject.java 
java/maven/src/org/netbeans/modules/maven/execute/cmd/ExecutionEventObject.java
   index 06f23c7faf..0e310e783c 100644
   --- 
java/maven/src/org/netbeans/modules/maven/execute/cmd/ExecutionEventObject.java
   +++ 
java/maven/src/org/netbeans/modules/maven/execute/cmd/ExecutionEventObject.java
   @@ -175,7 +175,9 @@ public class ExecutionEventObject {
                ExecutionEventObject.Tree parentProject = 
findParentNodeOfType(ExecutionEvent.Type.MojoStarted);
                if (parentProject != null) {
                    //in forked environment..
   -                assert parentProject.foldHandle != null;
   +                if (parentProject.foldHandle == null) {
   +                    return;
   +                }
                    this.foldHandle = 
parentProject.foldHandle.silentStartFold(true);
                    return;
                }
   ```
   
   do not work—you just get NPEs later from a variety of other methods here or 
in `CommandLineOutputHandler`. There is a lot of complex, sparsely commented 
logic here with numerous unchecked accesses to supposedly nullable fields, and 
no test coverage that I can find. Other than a small patch in #2309, the code 
all seems to predate the Apache donation.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to