Skip to content

fixes a NPE in TestOutputListenerProvider (maven output handler).#5645

Merged
mbien merged 1 commit intoapache:masterfrom
mbien:maven-output-handler-npe-fix
Mar 10, 2023
Merged

fixes a NPE in TestOutputListenerProvider (maven output handler).#5645
mbien merged 1 commit intoapache:masterfrom
mbien:maven-output-handler-npe-fix

Conversation

@mbien
Copy link
Member

@mbien mbien commented Mar 9, 2023

java.lang.NullPointerException: Cannot invoke "org.netbeans.modules.maven.api.output.OutputVisitor$Context.getCurrentProject()" because the return value of "org.netbeans.modules.maven.api.output.OutputVisitor.getContext()" is null
	at org.netbeans.modules.maven.output.TestOutputListenerProvider.processLine(TestOutputListenerProvider.java:127)
	at org.netbeans.modules.maven.execute.AbstractOutputHandler.processLine(AbstractOutputHandler.java:293)
	at org.netbeans.modules.maven.execute.CommandLineOutputHandler$Output.run(CommandLineOutputHandler.java:338)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)

This can be reproduced when building something while having the -T 1 flag set. Which is a no-op for maven but makes NB think that the build is multithreaded and puts it into a fallback mode without the maven event spy active beside other things.

Cannot invoke
"org.netbeans.modules.maven.api.output.OutputVisitor
 $Context.getCurrentProject()"
because the return value of
"org.netbeans.modules.maven.api.output.OutputVisitor.getContext()"
is null.
@mbien mbien added the Maven [ci] enable "build tools" tests label Mar 9, 2023
@mbien mbien added this to the NB18 milestone Mar 9, 2023
Copy link
Contributor

@lkishalmi lkishalmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@mbien mbien merged commit f63e03f into apache:master Mar 10, 2023
@jglick jglick mentioned this pull request Apr 18, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maven [ci] enable "build tools" tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants