This is an automated email from the ASF dual-hosted git repository.
mbien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 8819ee6aef fixes a NPE in TestOutputListenerProvider (maven output
handler).
new f63e03f9e6 Merge pull request #5645 from
mbien/maven-output-handler-npe-fix
8819ee6aef is described below
commit 8819ee6aef78011c770277d7a5932eb97b9fd598
Author: Michael Bien <[email protected]>
AuthorDate: Thu Mar 9 22:58:45 2023 +0100
fixes a NPE in TestOutputListenerProvider (maven output handler).
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.
---
.../maven/output/TestOutputListenerProvider.java | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git
a/java/maven/src/org/netbeans/modules/maven/output/TestOutputListenerProvider.java
b/java/maven/src/org/netbeans/modules/maven/output/TestOutputListenerProvider.java
index 0a7d6bfe08..ec06d407e9 100644
---
a/java/maven/src/org/netbeans/modules/maven/output/TestOutputListenerProvider.java
+++
b/java/maven/src/org/netbeans/modules/maven/output/TestOutputListenerProvider.java
@@ -124,12 +124,18 @@ public class TestOutputListenerProvider implements
OutputProcessor {
match = runningPattern2.matcher(line);
if (match.matches()) {
try {
- Object defaultValue =
PluginPropertyUtils.createEvaluator(visitor.getContext().getCurrentProject())
-
.evaluate("${project.build.directory}/surefire-reports");
- if (defaultValue instanceof String) {
- outputDir = (String) defaultValue;
- // don't want to create link on the surefire line
-// visitor.setOutputListener(new
TestOutputListener(runningTestClass, outputDir), true);
+ OutputVisitor.Context context = visitor.getContext();
+ if (context != null) {
+ Project currentProject = context.getCurrentProject();
+ if (currentProject != null) {
+ Object defaultValue =
PluginPropertyUtils.createEvaluator(currentProject)
+
.evaluate("${project.build.directory}/surefire-reports");
+ if (defaultValue instanceof String) {
+ outputDir = (String) defaultValue;
+ // don't want to create link on the surefire line
+ // visitor.setOutputListener(new
TestOutputListener(runningTestClass, outputDir), true);
+ }
+ }
}
return;
} catch (ExpressionEvaluationException ex) {
---------------------------------------------------------------------
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