fix by moving the tolower method from unknownelement to introspectionhelper. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275505 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -39,8 +39,6 @@ | |||||
| <p> | <p> | ||||
| After the class has been written, it is added to the ant system | After the class has been written, it is added to the ant system | ||||
| by using <code><typedef></code>. | by using <code><typedef></code>. | ||||
| One thing to be aware of is that currently this will only work | |||||
| if the definition name is all lower case. | |||||
| </p> | </p> | ||||
| <h3><a name="customconditions">Custom Conditions</a></h3> | <h3><a name="customconditions">Custom Conditions</a></h3> | ||||
| <p> | <p> | ||||
| @@ -594,7 +594,8 @@ public final class IntrospectionHelper implements BuildListener { | |||||
| private NestedCreator getNestedCreator(Project project, Object parent, | private NestedCreator getNestedCreator(Project project, Object parent, | ||||
| String elementName) throws BuildException { | String elementName) throws BuildException { | ||||
| NestedCreator nc = (NestedCreator) nestedCreators.get(elementName); | |||||
| NestedCreator nc = (NestedCreator) nestedCreators.get( | |||||
| elementName.toLowerCase(Locale.US)); | |||||
| if (nc == null) { | if (nc == null) { | ||||
| nc = createAddTypeCreator(project, parent, elementName); | nc = createAddTypeCreator(project, parent, elementName); | ||||
| } | } | ||||
| @@ -696,7 +697,7 @@ public final class IntrospectionHelper implements BuildListener { | |||||
| * @return true if the given nested element is supported | * @return true if the given nested element is supported | ||||
| */ | */ | ||||
| public boolean supportsNestedElement(String elementName) { | public boolean supportsNestedElement(String elementName) { | ||||
| return nestedCreators.containsKey(elementName) | |||||
| return nestedCreators.containsKey(elementName.toLowerCase(Locale.US)) | |||||
| || DynamicConfigurator.class.isAssignableFrom(bean) | || DynamicConfigurator.class.isAssignableFrom(bean) | ||||
| || addTypeMethods.size() != 0; | || addTypeMethods.size() != 0; | ||||
| } | } | ||||
| @@ -726,7 +727,8 @@ public final class IntrospectionHelper implements BuildListener { | |||||
| if (elementName == null) { | if (elementName == null) { | ||||
| return; | return; | ||||
| } | } | ||||
| NestedCreator ns = (NestedCreator) nestedCreators.get(elementName); | |||||
| NestedCreator ns = (NestedCreator) nestedCreators.get( | |||||
| elementName.toLowerCase(Locale.US)); | |||||
| if (ns == null) { | if (ns == null) { | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -57,7 +57,6 @@ package org.apache.tools.ant; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Locale; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| /** | /** | ||||
| @@ -515,13 +514,8 @@ public class UnknownElement extends Task { | |||||
| private boolean handleChild(IntrospectionHelper ih, | private boolean handleChild(IntrospectionHelper ih, | ||||
| Object parent, UnknownElement child, | Object parent, UnknownElement child, | ||||
| RuntimeConfigurable childWrapper) { | RuntimeConfigurable childWrapper) { | ||||
| // backwards compatibility - element names of nested | |||||
| // elements have been all lower-case in Ant, except for | |||||
| // TaskContainers | |||||
| // This does not work too good for typedefed elements... | |||||
| String childName = | |||||
| ProjectHelper.genComponentName( | |||||
| child.getNamespace(), child.getTag().toLowerCase(Locale.US)); | |||||
| String childName = ProjectHelper.genComponentName( | |||||
| child.getNamespace(), child.getTag()); | |||||
| if (ih.supportsNestedElement(childName)) { | if (ih.supportsNestedElement(childName)) { | ||||
| IntrospectionHelper.Creator creator = | IntrospectionHelper.Creator creator = | ||||
| ih.getElementCreator(getProject(), parent, childName); | ih.getElementCreator(getProject(), parent, childName); | ||||