From 8d3002cf8ab1b9f87d38b0b4e5682d15ffb7002a Mon Sep 17 00:00:00 2001 From: Conor MacNeill Date: Wed, 2 Apr 2003 11:43:41 +0000 Subject: [PATCH] Tweak the handling of config of tasks in task containers. Tasks in task containers are not configured until they are used. Other elements in Task containers (which is now supported by 1.6) will be configured when the task container itself is configured. Remove override in Sequential as it is no longer necessary git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274370 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/RuntimeConfigurable.java | 7 ++++++- src/main/org/apache/tools/ant/UnknownElement.java | 7 +------ .../org/apache/tools/ant/taskdefs/Sequential.java | 15 --------------- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/main/org/apache/tools/ant/RuntimeConfigurable.java b/src/main/org/apache/tools/ant/RuntimeConfigurable.java index cdc848b01..9e63ddc97 100644 --- a/src/main/org/apache/tools/ant/RuntimeConfigurable.java +++ b/src/main/org/apache/tools/ant/RuntimeConfigurable.java @@ -339,7 +339,12 @@ public class RuntimeConfigurable implements Serializable { if (configureChildren) { if (child.wrappedObject instanceof Task) { Task childTask = (Task) child.wrappedObject; - childTask.maybeConfigure(); + + // we don't configure tasks of task containers These + // we be configured at the time they are used. + if (!(target instanceof TaskContainer)) { + childTask.maybeConfigure(); + } } else { child.maybeConfigure(p); } diff --git a/src/main/org/apache/tools/ant/UnknownElement.java b/src/main/org/apache/tools/ant/UnknownElement.java index 005216878..d9b5a03f3 100644 --- a/src/main/org/apache/tools/ant/UnknownElement.java +++ b/src/main/org/apache/tools/ant/UnknownElement.java @@ -144,8 +144,7 @@ public class UnknownElement extends Task { // configure attributes of the object and it's children. If it is // a task container, defer the configuration till the task container // attempts to use the task - getWrapper().maybeConfigure(getProject(), - !(realThing instanceof TaskContainer)); + getWrapper().maybeConfigure(getProject()); } /** @@ -305,10 +304,6 @@ public class UnknownElement extends Task { } child.handleChildren(realChild, childWrapper); - -// if (parent instanceof TaskContainer) { -// ((Task) realChild).maybeConfigure(); -// } } } diff --git a/src/main/org/apache/tools/ant/taskdefs/Sequential.java b/src/main/org/apache/tools/ant/taskdefs/Sequential.java index 52a09d685..d362aea33 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Sequential.java +++ b/src/main/org/apache/tools/ant/taskdefs/Sequential.java @@ -82,21 +82,6 @@ public class Sequential extends Task /** Optional Vector holding the nested tasks */ private Vector nestedTasks = new Vector(); - /** - * Override {@link org.apache.tools.ant.Task#maybeConfigure - * maybeConfigure} in a way that leaves the nested tasks - * unconfigured until they get executed. - * - * @since Ant 1.5 - */ - public void maybeConfigure() throws BuildException { - if (isInvalid()) { - super.maybeConfigure(); - } else { - getRuntimeConfigurableWrapper().maybeConfigure(getProject(), false); - } - } - /** * Add a nested task to Sequential. *