Return-Path: Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 73985 invoked by uid 500); 15 Jul 2003 09:05:55 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 73974 invoked by uid 500); 15 Jul 2003 09:05:54 -0000 Received: (qmail 73969 invoked from network); 15 Jul 2003 09:05:54 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 15 Jul 2003 09:05:54 -0000 Received: (qmail 94137 invoked by uid 1539); 15 Jul 2003 09:05:53 -0000 Date: 15 Jul 2003 09:05:53 -0000 Message-ID: <20030715090553.94136.qmail@icarus.apache.org> From: peterreilly@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant/src/etc/testcases/taskdefs/optional script.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N peterreilly 2003/07/15 02:05:53 Modified: src/main/org/apache/tools/ant Target.java src/etc/testcases/taskdefs/optional script.xml Log: use for loop instead of iterator when walking the list of tasks, this allows tasks to be added to the current list while the list is being walked. Revert the script test that failed when it was adding to the current task to test the change Revision Changes Path 1.40 +2 -3 ant/src/main/org/apache/tools/ant/Target.java Index: Target.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Target.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- Target.java 7 Jul 2003 08:20:52 -0000 1.39 +++ Target.java 15 Jul 2003 09:05:52 -0000 1.40 @@ -311,9 +311,8 @@ */ public void execute() throws BuildException { if (testIfCondition() && testUnlessCondition()) { - Iterator it = children.iterator(); - while (it.hasNext()) { - Object o = it.next(); + for (int i = 0; i < children.size(); ++i) { + Object o = children.get(i); if (o instanceof Task) { Task task = (Task) o; task.perform(); 1.4 +1 -1 ant/src/etc/testcases/taskdefs/optional/script.xml Index: script.xml =================================================================== RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/optional/script.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- script.xml 4 Jul 2003 19:20:53 -0000 1.3 +++ script.xml 15 Jul 2003 09:05:53 -0000 1.4 @@ -10,7 +10,7 @@ for (i=1; i<=10; i++) { echo = testproject.createTask("echo"); - example1.addTask(echo); + setup1.addTask(echo); echo.setMessage(i*i); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org