You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by jt...@apache.org on 2021/03/28 17:20:41 UTC

[netbeans] branch master updated: Avoid NPE when executing talk2compiler project

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

jtulach 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 c9b605b  Avoid NPE when executing talk2compiler project
     new 9147055  Merge pull request #2833 from JaroslavTulach/jtulach/Talk2CompilerAvoidNPE
c9b605b is described below

commit c9b605b7012a9c82d447e929238c27f474f7f534
Author: Jaroslav Tulach <ja...@apidesign.org>
AuthorDate: Sun Mar 28 09:23:35 2021 +0200

    Avoid NPE when executing talk2compiler project
---
 .../src/org/netbeans/modules/maven/runjar/MavenExecuteUtils.java    | 6 +++---
 .../src/org/netbeans/modules/maven/runjar/RunJarStartupArgs.java    | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/java/maven/src/org/netbeans/modules/maven/runjar/MavenExecuteUtils.java b/java/maven/src/org/netbeans/modules/maven/runjar/MavenExecuteUtils.java
index f41b202..614f4e8 100644
--- a/java/maven/src/org/netbeans/modules/maven/runjar/MavenExecuteUtils.java
+++ b/java/maven/src/org/netbeans/modules/maven/runjar/MavenExecuteUtils.java
@@ -615,9 +615,9 @@ public final class MavenExecuteUtils {
      * @return
      */
     public static String[] splitAll(String argline, boolean filterClassPath) {
-        String jvm = splitJVMParams(argline, false);
-        String mainClazz = splitMainClass(argline);
-        String args = splitParams(argline);
+        String jvm = argline == null ? null : splitJVMParams(argline, false);
+        String mainClazz = argline == null ? null : splitMainClass(argline);
+        String args = argline == null ? null : splitParams(argline);
         if (filterClassPath && jvm != null && jvm.contains("-classpath %classpath")) {
             jvm = jvm.replace("-classpath %classpath", "");
         }
diff --git a/java/maven/src/org/netbeans/modules/maven/runjar/RunJarStartupArgs.java b/java/maven/src/org/netbeans/modules/maven/runjar/RunJarStartupArgs.java
index 4787a07..3f32b56 100644
--- a/java/maven/src/org/netbeans/modules/maven/runjar/RunJarStartupArgs.java
+++ b/java/maven/src/org/netbeans/modules/maven/runjar/RunJarStartupArgs.java
@@ -21,6 +21,7 @@ package org.netbeans.modules.maven.runjar;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Stream;
@@ -136,7 +137,7 @@ public class RunJarStartupArgs implements LateBoundPrerequisitesChecker {
             if (mainClass.length == 0) {
                 // accept userargs, since we don't know where the division is, make it fixed in the processing.
                 joinedArgs.addAll(appArgsValue);
-                appArgsValue = null;
+                appArgsValue = Collections.emptyList();
             } else {
                 joinedArgs.addAll(Arrays.asList(mainClass));
             }

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