From d2cdd21fe5e70186b972633f590d96937e2f059a Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Wed, 27 Sep 2006 22:27:55 +0000 Subject: [PATCH] Bugzilla 40621: fix ordering of add and addconfigured git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@450605 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/RuntimeConfigurable.java | 35 ++----------------- .../org/apache/tools/ant/UnknownElement.java | 5 ++- 2 files changed, 7 insertions(+), 33 deletions(-) diff --git a/src/main/org/apache/tools/ant/RuntimeConfigurable.java b/src/main/org/apache/tools/ant/RuntimeConfigurable.java index 13c572cc5..c340ca4ab 100644 --- a/src/main/org/apache/tools/ant/RuntimeConfigurable.java +++ b/src/main/org/apache/tools/ant/RuntimeConfigurable.java @@ -350,12 +350,11 @@ public class RuntimeConfigurable implements Serializable { * @param p The project containing the wrapped element. * Must not be null. * - * @param configureChildren Whether to configure child elements as - * well. if true, child elements will be configured after the - * wrapped element. + * @param configureChildren ignored. + * * @exception BuildException if the configuration fails, for instance due - * to invalid attributes or children, or text being added to + * to invalid attributes , or text being added to * an element which doesn't accept it. */ public synchronized void maybeConfigure(Project p, boolean configureChildren) @@ -408,34 +407,6 @@ public class RuntimeConfigurable implements Serializable { ProjectHelper.addText(p, wrappedObject, characters.substring(0)); } - Enumeration e = getChildren(); - while (e.hasMoreElements()) { - RuntimeConfigurable child = (RuntimeConfigurable) e.nextElement(); - synchronized (child) { - if (child.wrappedObject instanceof Task) { - Task childTask = (Task) child.wrappedObject; - childTask.setRuntimeConfigurableWrapper(child); - } - if ((child.creator != null) && configureChildren) { - child.maybeConfigure(p); - child.creator.store(); - continue; - } - /* - * backwards compatibility - element names of nested - * elements have been all lower-case in Ant, except for - * tasks in TaskContainers. - * - * For TaskContainers, we simply skip configuration here. - */ - String tag = child.getElementTag().toLowerCase(Locale.US); - if (configureChildren && ih.supportsNestedElement(tag)) { - child.maybeConfigure(p); - ProjectHelper.storeChild(p, target, child.wrappedObject, tag); - } - } - } - if (id != null) { p.addReference(id, wrappedObject); } diff --git a/src/main/org/apache/tools/ant/UnknownElement.java b/src/main/org/apache/tools/ant/UnknownElement.java index d11fb0e9b..31011c3d3 100644 --- a/src/main/org/apache/tools/ant/UnknownElement.java +++ b/src/main/org/apache/tools/ant/UnknownElement.java @@ -183,7 +183,6 @@ public class UnknownElement extends Task { } } - handleChildren(realThing, getWrapper()); // configure attributes of the object and it's children. If it is // a task container, defer the configuration till the task container @@ -194,6 +193,8 @@ public class UnknownElement extends Task { } else { getWrapper().maybeConfigure(getProject()); } + + handleChildren(realThing, getWrapper()); } /** @@ -555,7 +556,9 @@ public class UnknownElement extends Task { if (realChild instanceof ProjectComponent) { ((ProjectComponent) realChild).setLocation(child.getLocation()); } + childWrapper.maybeConfigure(getProject()); child.handleChildren(realChild, childWrapper); + creator.store(); return true; } return false;