You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by sebb <se...@gmail.com> on 2012/02/20 02:39:35 UTC

Re: svn commit: r1244707 - in /jmeter/trunk: src/core/org/apache/jmeter/gui/action/ChangeParent.java xdocs/changes.xml

On 15 February 2012 20:50,  <pm...@apache.org> wrote:
> Author: pmouawad
> Date: Wed Feb 15 20:50:29 2012
> New Revision: 1244707
>
> URL: http://svn.apache.org/viewvc?rev=1244707&view=rev
> Log:
> Bug 52672 - Change Controller action deletes all but one child samplers
>
> Modified:
>    jmeter/trunk/src/core/org/apache/jmeter/gui/action/ChangeParent.java
>    jmeter/trunk/xdocs/changes.xml
>
> Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/ChangeParent.java
> URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/ChangeParent.java?rev=1244707&r1=1244706&r2=1244707&view=diff
> ==============================================================================
> --- jmeter/trunk/src/core/org/apache/jmeter/gui/action/ChangeParent.java (original)
> +++ jmeter/trunk/src/core/org/apache/jmeter/gui/action/ChangeParent.java Wed Feb 15 20:50:29 2012
> @@ -21,7 +21,6 @@ package org.apache.jmeter.gui.action;
>  import java.awt.Component;
>  import java.awt.Toolkit;
>  import java.awt.event.ActionEvent;
> -import java.util.Enumeration;
>  import java.util.HashSet;
>  import java.util.Set;
>
> @@ -78,13 +77,12 @@ public class ChangeParent implements Com
>         int index = parentNode.getIndex(currentNode);
>         treeModel.insertNodeInto(newNode, parentNode, index);
>         treeModel.removeNodeFromParent(currentNode);
> -        Enumeration<JMeterTreeNode> nodes = currentNode.children();
> -        while(nodes.hasMoreElements()) {
> -            JMeterTreeNode node = nodes.nextElement();
> +        int childCount = currentNode.getChildCount();
> +        for (int i = 0; i < childCount; i++) {
> +            JMeterTreeNode node = (JMeterTreeNode) currentNode.getChildAt(0);

Seems odd not to use the index variable "i" - should this be getChildAt(i) ?

If (0) is correct, it needs documenting.

>             treeModel.removeNodeFromParent(node);
>             treeModel.insertNodeInto(node, newNode, newNode.getChildCount());
>         }
> -
>     }
>
>  }
>
> Modified: jmeter/trunk/xdocs/changes.xml
> URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1244707&r1=1244706&r2=1244707&view=diff
> ==============================================================================
> --- jmeter/trunk/xdocs/changes.xml (original)
> +++ jmeter/trunk/xdocs/changes.xml Wed Feb 15 20:50:29 2012
> @@ -100,6 +100,7 @@ or a Debug Sampler with all fields set t
>  <h3>General</h3>
>  <ul>
>  <li>Bug 52639 - JSplitPane divider for log panel should be hidden if log is not activated</li>
> +<li>Bug 52672 - Change Controller action deletes all but one child samplers</li>
>  </ul>
>
>  <!-- =================== Improvements =================== -->
>
>