mbien commented on code in PR #8826:
URL: https://github.com/apache/netbeans/pull/8826#discussion_r2369325544


##########
java/maven/src/org/netbeans/modules/maven/execute/ui/RunGoalsPanel.java:
##########
@@ -189,28 +188,33 @@ public void applyValues(NetbeansActionMapping mapp) {
     }
 
     public void applyValues(BeanRunConfig rc) {
-        StringTokenizer tok = new StringTokenizer(txtGoals.getText().trim());
+        StringTokenizer tok = new StringTokenizer(txtGoals.getText().strip());
         List<String> lst = new ArrayList<>();
         while (tok.hasMoreTokens()) {
             lst.add(tok.nextToken());
         }
         rc.setGoals(!lst.isEmpty() ? lst : List.of("install")); //NOI18N
-        tok = new StringTokenizer(txtProfiles.getText().trim());
+        tok = new StringTokenizer(txtProfiles.getText().strip());
         lst = new ArrayList<>();
         while (tok.hasMoreTokens()) {
             lst.add(tok.nextToken());
         }
         rc.setActivatedProfiles(lst);
 
+        // clear props in case of removal or changed order
+        for (String prop : new ArrayList<>(rc.getProperties().keySet())) {
+            rc.setProperty(prop, null);
+        }
         PropertySplitter split = new PropertySplitter(epProperties.getText());
         String token = split.nextPair();
         while (token != null) {
-            String[] prp = StringUtils.split(token, "=", 2); //NOI18N
-            if (prp.length == 2) {
+            String[] prp = token.split("=", 2); //NOI18N
+            if (prp.length == 2 && !prp[0].isBlank()) {
                 rc.setProperty(prp[0], prp[1]);
             }
             token = split.nextPair();
         }
+

Review Comment:
   @jglick this is the main fix



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