Bug 54870 - Tree D&D may lost leaf nodes

Bugzilla Id: 54870

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1470027 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Philippe Mouawad 2013-04-19 20:31:01 +00:00
parent 8a3c9d4dcc
commit 22ce57a68b
2 changed files with 8 additions and 1 deletions

View File

@ -247,12 +247,18 @@ public class JMeterTreeTransferHandler extends TransferHandler {
// working on the original node would be harder as
// you'll have to deal with the insertion index offset if you re-order a node inside a parent
JMeterTreeNode copy = (JMeterTreeNode) nodes[i].clone();
// first copy the children as the call to copy.add will modify the collection we're iterating on
Enumeration<?> enumFrom = nodes[i].children();
List<JMeterTreeNode> tmp = new ArrayList<JMeterTreeNode>();
while (enumFrom.hasMoreElements()) {
JMeterTreeNode child = (JMeterTreeNode) enumFrom.nextElement();
copy.add(child);
tmp.add(child);
}
for (JMeterTreeNode jMeterTreeNode : tmp) {
copy.add(jMeterTreeNode);
}
guiInstance.getTreeModel().insertNodeInto(copy, target, index++);
nodesForRemoval.add(nodes[i]);
}

View File

@ -141,6 +141,7 @@ It was therefore necessary to change the shortcut.
<li><bugzilla>54504</bugzilla> - Resource string not found: [clipboard_node_read_error]</li>
<li><bugzilla>54538</bugzilla> - GUI: context menu is too big</li>
<li><bugzilla>54847</bugzilla> - Cut &amp; Paste is broken with tree multi-selection</li>
<li><bugzilla>54870</bugzilla> - Tree D&D may lost leaf nodes (affected nightly build)</li>
</ul>
<!-- =================== Improvements =================== -->