PR: 26225 Reported by: John Sichi git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275929 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -98,6 +98,9 @@ | |||||
| The contents of the nested elements of the task instance | The contents of the nested elements of the task instance | ||||
| are placed in the templated task at the tag name. | are placed in the templated task at the tag name. | ||||
| </p> | </p> | ||||
| <p> | |||||
| The case of the element name is ignored. | |||||
| </p> | |||||
| <h3>Parameters</h3> | <h3>Parameters</h3> | ||||
| <table border="1" cellpadding="2" cellspacing="0"> | <table border="1" cellpadding="2" cellspacing="0"> | ||||
| <tr> | <tr> | ||||
| @@ -86,4 +86,19 @@ | |||||
| <ignore myattribute="a"/> | <ignore myattribute="a"/> | ||||
| <ignore Myattribute="b"/> | <ignore Myattribute="b"/> | ||||
| </target> | </target> | ||||
| <target name="ignore-element-case"> | |||||
| <macrodef name="ignore"> | |||||
| <element name="MyElement"/> | |||||
| <sequential> | |||||
| <myElement/> | |||||
| <MyElEmEnT/> | |||||
| </sequential> | |||||
| </macrodef> | |||||
| <ignore> | |||||
| <MYELEMENT> | |||||
| <echo>nested element</echo> | |||||
| </MYELEMENT> | |||||
| </ignore> | |||||
| </target> | |||||
| </project> | </project> | ||||
| @@ -395,7 +395,7 @@ public class MacroDef extends AntlibDefinition { | |||||
| throw new BuildException( | throw new BuildException( | ||||
| "Illegal name [" + name + "] for attribute"); | "Illegal name [" + name + "] for attribute"); | ||||
| } | } | ||||
| this.name = name; | |||||
| this.name = name.toLowerCase(Locale.US); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -277,7 +277,7 @@ public class MacroInstance extends Task implements DynamicConfigurator { | |||||
| while (e.hasMoreElements()) { | while (e.hasMoreElements()) { | ||||
| RuntimeConfigurable r = (RuntimeConfigurable) e.nextElement(); | RuntimeConfigurable r = (RuntimeConfigurable) e.nextElement(); | ||||
| UnknownElement unknownElement = (UnknownElement) r.getProxy(); | UnknownElement unknownElement = (UnknownElement) r.getProxy(); | ||||
| String tag = unknownElement.getTaskType(); | |||||
| String tag = unknownElement.getTaskType().toLowerCase(Locale.US); | |||||
| MacroDef.TemplateElement templateElement = | MacroDef.TemplateElement templateElement = | ||||
| (MacroDef.TemplateElement) getNsElements().get(tag); | (MacroDef.TemplateElement) getNsElements().get(tag); | ||||
| if (templateElement == null) { | if (templateElement == null) { | ||||
| @@ -109,5 +109,11 @@ public class MacroDefTest extends BuildFileTest { | |||||
| "ignorecase", | "ignorecase", | ||||
| "a is ab is b"); | "a is ab is b"); | ||||
| } | } | ||||
| public void testIgnoreElementCase() { | |||||
| expectLog( | |||||
| "ignore-element-case", | |||||
| "nested elementnested element"); | |||||
| } | |||||
| } | } | ||||