From c2e2310e718f046b21292a187713d838b4dd6249 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Mon, 28 Apr 2003 12:42:47 +0000 Subject: [PATCH] Only tasks should be case-sensitive inside TaskContainers - simply the code a little. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274527 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/RuntimeConfigurable.java | 30 +++++++------------ .../org/apache/tools/ant/UnknownElement.java | 19 ++++++------ 2 files changed, 20 insertions(+), 29 deletions(-) diff --git a/src/main/org/apache/tools/ant/RuntimeConfigurable.java b/src/main/org/apache/tools/ant/RuntimeConfigurable.java index f782315a0..19a69a6dd 100644 --- a/src/main/org/apache/tools/ant/RuntimeConfigurable.java +++ b/src/main/org/apache/tools/ant/RuntimeConfigurable.java @@ -348,26 +348,16 @@ public class RuntimeConfigurable implements Serializable { childTask.setRuntimeConfigurableWrapper(child); } - if (configureChildren) { - /* - * backwards compatibility - element names of nested - * elements have been all lower-case in Ant, except for - * TaskContainers - */ - - /* XXX - * - * For some reason we don't throw an exception here if - * we find the nested element is unsupported, probably - * because this will happen somewhere else. - */ - String tag = child.getElementTag(); - if (ih.supportsNestedElement(tag.toLowerCase(Locale.US))) { - tag = tag.toLowerCase(Locale.US); - } else if (!ih.supportsNestedElement(tag)) { - 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); diff --git a/src/main/org/apache/tools/ant/UnknownElement.java b/src/main/org/apache/tools/ant/UnknownElement.java index c183637e3..5f0d4dd3d 100644 --- a/src/main/org/apache/tools/ant/UnknownElement.java +++ b/src/main/org/apache/tools/ant/UnknownElement.java @@ -273,15 +273,16 @@ public class UnknownElement extends Task { RuntimeConfigurable childWrapper = parentWrapper.getChild(i); UnknownElement child = (UnknownElement) children.elementAt(i); Object realChild = null; - - if (handleChild(ih, parent, child, - child.getTag().toLowerCase(Locale.US), - childWrapper)) { - } else if (!(parent instanceof TaskContainer)) { - ih.throwNotSupported(getProject(), parent, child.getTag()); - } else { - if (!handleChild(ih, parent, child, child.getTag(), - childWrapper)) { + + // backwards compatibility - element names of nested + // elements have been all lower-case in Ant, except for + // TaskContainers + if (!handleChild(ih, parent, child, + child.getTag().toLowerCase(Locale.US), + childWrapper)) { + if (!(parent instanceof TaskContainer)) { + ih.throwNotSupported(getProject(), parent, child.getTag()); + } else { // a task container - anything could happen - just add the // child to the container TaskContainer container = (TaskContainer) parent;