jsalvata 2003/11/30 17:01:52 Modified: src/core/org/apache/jmeter/gui/tree JMeterTreeModel.java Log: Fix bug: getNodeOf would fail except in the most favorable circumstances. CVS: ---------------------------------------------------------------------- CVS: PR: CVS: If this change addresses a PR in the problem report tracking CVS: database, then enter the PR number(s) here. CVS: Obtained from: CVS: If this change has been taken from another system, such as NCSA, CVS: then name the system in this line, otherwise delete it. CVS: Submitted by: CVS: If this code has been contributed to Apache by someone else; i.e., CVS: they sent us a patch or a new module, then include their name/email CVS: address here. If this is your work then delete this line. CVS: Reviewed by: CVS: If we are doing pre-commit code reviews and someone else has CVS: reviewed your changes, include their name(s) here. CVS: If you have not had it reviewed then delete this line. Revision Changes Path 1.21 +5 -7 jakarta-jmeter/src/core/org/apache/jmeter/gui/tree/JMeterTreeModel.java Index: JMeterTreeModel.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/tree/JMeterTreeModel.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- JMeterTreeModel.java 5 Oct 2003 01:05:31 -0000 1.20 +++ JMeterTreeModel.java 1 Dec 2003 01:01:52 -0000 1.21 @@ -105,11 +105,9 @@ */ public JMeterTreeNode getNodeOf(TestElement userObject) { - List nodeList = new LinkedList(); return traverseAndFind( userObject, - (JMeterTreeNode) this.getRoot(), - nodeList); + (JMeterTreeNode)getRoot()); } /** @@ -225,8 +223,7 @@ private JMeterTreeNode traverseAndFind( TestElement userObject, - JMeterTreeNode node, - List nodeList) + JMeterTreeNode node) { if (userObject == node.getUserObject()) { @@ -236,7 +233,8 @@ while (enum.hasMoreElements()) { JMeterTreeNode child = (JMeterTreeNode) enum.nextElement(); - return traverseAndFind(userObject, child, nodeList); + JMeterTreeNode result= traverseAndFind(userObject, child); + if (result != null) return result; } return null; }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]