jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1853614 - in /jmeter/trunk: src/core/org/apache/jmeter/gui/action/ApplyNamingConvention.java xdocs/changes.xml
Date Fri, 15 Feb 2019 07:24:36 GMT
Author: pmouawad
Date: Fri Feb 15 07:24:36 2019
New Revision: 1853614

URL: http://svn.apache.org/viewvc?rev=1853614&view=rev
Log:
Bug 63180 - Apply Naming Policy allows multi selection but only considers first node
Bugzilla Id: 63180

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/ApplyNamingConvention.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/ApplyNamingConvention.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/ApplyNamingConvention.java?rev=1853614&r1=1853613&r2=1853614&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/action/ApplyNamingConvention.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/action/ApplyNamingConvention.java Fri Feb
15 07:24:36 2019
@@ -20,8 +20,10 @@ package org.apache.jmeter.gui.action;
 
 import java.awt.Toolkit;
 import java.awt.event.ActionEvent;
+import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.apache.jmeter.control.Controller;
@@ -52,20 +54,25 @@ public class ApplyNamingConvention exten
     @Override
     public void doAction(ActionEvent e) {
         GuiPackage guiPackage = GuiPackage.getInstance();
-        JMeterTreeNode currentNode = guiPackage.getTreeListener().getCurrentNode();
-        if (!(currentNode.getUserObject() instanceof Controller)) {
-            Toolkit.getDefaultToolkit().beep();
-            return;
+        JMeterTreeNode[] currentNodes = guiPackage.getTreeListener().getSelectedNodes();
+        List<JMeterTreeNode> filteredNodes = new ArrayList<>();
+        for (JMeterTreeNode jMeterTreeNode : currentNodes) {
+            if (jMeterTreeNode.getUserObject() instanceof Controller) {
+                filteredNodes.add(jMeterTreeNode);
+            } else {
+                log.warn("Applying naming policy, selected node {} is not a Controller,
will ignore it", jMeterTreeNode.getName());
+            }
         }
         try {
-            applyNamingPolicyToCurrentNode(guiPackage, currentNode);
+            for (JMeterTreeNode currentNode : filteredNodes) {
+                applyNamingPolicyToCurrentNode(guiPackage, currentNode);
+            }
             GuiPackage.getInstance().getMainFrame().repaint();
         } catch (Exception err) {
             Toolkit.getDefaultToolkit().beep();
             log.error("Failed to apply naming policy", err);
             JMeterUtils.reportErrorToUser("Failed to apply naming policy", err);
         }
-
     }
 
     /**

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1853614&r1=1853613&r2=1853614&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Fri Feb 15 07:24:36 2019
@@ -301,6 +301,7 @@ containing a fix to this issue, we decid
     <li><bug>63099</bug>Escape commata in function helper dialog only outside
of variable replacement structures.</li>
     <li><bug>63105</bug>Export Transactions for Report: fix 2 bugs</li>
     <li><bug>63106</bug>Apply naming policy does not refresh UI</li>
+    <li><bug>63180</bug>Apply Naming Policy allows multi selection but
only considers first node</li>
     <li><bug>63090</bug>Remove slf4j-ext due to CVE-2018-8088</li>
 </ul>
 



Mime
View raw message