Author: peterreilly Date: Wed Sep 27 15:27:55 2006 New Revision: 450605 URL: http://svn.apache.org/viewvc?view=rev&rev=450605 Log: Bugzilla 40621: fix ordering of add and addconfigured
Modified: ant/core/trunk/src/main/org/apache/tools/ant/RuntimeConfigurable.java ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/RuntimeConfigurable.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/RuntimeConfigurable.java?view=diff&rev=450605&r1=450604&r2=450605 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/RuntimeConfigurable.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/RuntimeConfigurable.java Wed Sep 27 15:27:55 2006 @@ -350,12 +350,11 @@ * @param p The project containing the wrapped element. * Must not be <code>null</code>. * - * @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) @@ -406,34 +405,6 @@ if (characters != null) { 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) { Modified: ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java?view=diff&rev=450605&r1=450604&r2=450605 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java Wed Sep 27 15:27:55 2006 @@ -183,7 +183,6 @@ } } - 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 @@ } else { getWrapper().maybeConfigure(getProject()); } + + handleChildren(realThing, getWrapper()); } /** @@ -555,7 +556,9 @@ if (realChild instanceof ProjectComponent) { ((ProjectComponent) realChild).setLocation(child.getLocation()); } + childWrapper.maybeConfigure(getProject()); child.handleChildren(realChild, childWrapper); + creator.store(); return true; } return false; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]