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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]