You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by lk...@apache.org on 2020/07/07 15:17:23 UTC

[netbeans] branch release120 updated: [NETBEANS-4410] Fixed NPE on Certain Gradle Test Executions.

This is an automated email from the ASF dual-hosted git repository.

lkishalmi pushed a commit to branch release120
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/release120 by this push:
     new abc559e  [NETBEANS-4410] Fixed NPE on Certain Gradle Test Executions.
abc559e is described below

commit abc559e45c5c3a63c81efed2f7085eadacdaf957
Author: Laszlo Kishalmi <la...@gmail.com>
AuthorDate: Mon Jun 15 07:58:44 2020 -0700

    [NETBEANS-4410] Fixed NPE on Certain Gradle Test Executions.
---
 groovy/gradle.test/manifest.mf                         |  2 +-
 .../gradle/test/GradleTestProgressListener.java        | 18 ++++++++++++------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/groovy/gradle.test/manifest.mf b/groovy/gradle.test/manifest.mf
index c236217..591f710 100644
--- a/groovy/gradle.test/manifest.mf
+++ b/groovy/gradle.test/manifest.mf
@@ -2,4 +2,4 @@ Manifest-Version: 1.0
 AutoUpdate-Show-In-Client: false
 OpenIDE-Module: org.netbeans.modules.gradle.test
 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/gradle/test/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.4
+OpenIDE-Module-Specification-Version: 1.4.1
diff --git a/groovy/gradle.test/src/org/netbeans/modules/gradle/test/GradleTestProgressListener.java b/groovy/gradle.test/src/org/netbeans/modules/gradle/test/GradleTestProgressListener.java
index 1261dd2..7e20b06 100644
--- a/groovy/gradle.test/src/org/netbeans/modules/gradle/test/GradleTestProgressListener.java
+++ b/groovy/gradle.test/src/org/netbeans/modules/gradle/test/GradleTestProgressListener.java
@@ -134,12 +134,18 @@ public final class GradleTestProgressListener implements ProgressListener, Gradl
         TestOutputDescriptor desc = evt.getDescriptor();
         OperationDescriptor parent = desc.getParent();
         CoreManager manager = getManager();
-        if (manager != null) {
-            manager.displayOutput(session, desc.getMessage(), desc.getDestination().equals(Destination.StdErr));
-        }
-        if ((parent != null) && (parent instanceof JvmTestOperationDescriptor)) {
-            Testcase tc = runningTests.get(getTestOpKey((JvmTestOperationDescriptor) parent));
-            tc.addOutputLines(Arrays.asList(desc.getMessage().split("\\R")));
+        String msg = desc.getMessage();
+        if (msg != null && msg.endsWith("\n")) {
+            msg = msg.substring(0, msg.length() - 1);
+            if (manager != null) {
+                manager.displayOutput(session, msg, desc.getDestination().equals(Destination.StdErr));
+            }
+            if ((parent != null) && (parent instanceof JvmTestOperationDescriptor)) {
+                Testcase tc = runningTests.get(getTestOpKey((JvmTestOperationDescriptor) parent));
+                if (tc != null) {
+                    tc.addOutputLines(Arrays.asList(msg.split("\\R")));
+                }
+            }
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

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