bodewig 2003/04/28 05:42:47
Modified: src/main/org/apache/tools/ant RuntimeConfigurable.java
UnknownElement.java
Log:
Only tasks should be case-sensitive inside TaskContainers - simply the
code a little.
Revision Changes Path
1.33 +10 -20
ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java
Index: RuntimeConfigurable.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- RuntimeConfigurable.java 28 Apr 2003 12:19:17 -0000 1.32
+++ RuntimeConfigurable.java 28 Apr 2003 12:42:47 -0000 1.33
@@ -348,26 +348,16 @@
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);
1.48 +10 -9 ant/src/main/org/apache/tools/ant/UnknownElement.java
Index: UnknownElement.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/UnknownElement.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- UnknownElement.java 28 Apr 2003 12:19:18 -0000 1.47
+++ UnknownElement.java 28 Apr 2003 12:42:47 -0000 1.48
@@ -273,15 +273,16 @@
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;