ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs MacroDefTest.java
Date Mon, 19 Jan 2004 09:51:02 GMT
peterreilly    2004/01/19 01:51:02

  Modified:    src/main/org/apache/tools/ant/taskdefs MacroDef.java
                        MacroInstance.java
               docs/manual/CoreTasks macrodef.html
               src/etc/testcases/taskdefs macrodef.xml
               src/testcases/org/apache/tools/ant/taskdefs
                        MacroDefTest.java
  Log:
  macrodef element names are case insensentive due to use of DynamicConfigurator
  PR: 26225
  Reported by: John Sichi
  
  Revision  Changes    Path
  1.18      +1 -1      ant/src/main/org/apache/tools/ant/taskdefs/MacroDef.java
  
  Index: MacroDef.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/MacroDef.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- MacroDef.java	12 Jan 2004 08:01:41 -0000	1.17
  +++ MacroDef.java	19 Jan 2004 09:51:01 -0000	1.18
  @@ -395,7 +395,7 @@
                   throw new BuildException(
                       "Illegal name [" + name + "] for attribute");
               }
  -            this.name = name;
  +            this.name = name.toLowerCase(Locale.US);
           }
   
           /**
  
  
  
  1.15      +1 -1      ant/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
  
  Index: MacroInstance.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- MacroInstance.java	22 Dec 2003 09:46:23 -0000	1.14
  +++ MacroInstance.java	19 Jan 2004 09:51:01 -0000	1.15
  @@ -277,7 +277,7 @@
           while (e.hasMoreElements()) {
               RuntimeConfigurable r = (RuntimeConfigurable) e.nextElement();
               UnknownElement unknownElement = (UnknownElement) r.getProxy();
  -            String tag = unknownElement.getTaskType();
  +            String tag = unknownElement.getTaskType().toLowerCase(Locale.US);
               MacroDef.TemplateElement templateElement =
                   (MacroDef.TemplateElement) getNsElements().get(tag);
               if (templateElement == null) {
  
  
  
  1.10      +3 -0      ant/docs/manual/CoreTasks/macrodef.html
  
  Index: macrodef.html
  ===================================================================
  RCS file: /home/cvs/ant/docs/manual/CoreTasks/macrodef.html,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- macrodef.html	12 Jan 2004 08:01:41 -0000	1.9
  +++ macrodef.html	19 Jan 2004 09:51:01 -0000	1.10
  @@ -98,6 +98,9 @@
         The contents of the nested elements of the task instance
         are placed in the templated task at the tag name.
       </p>
  +    <p>
  +      The case of the element name is ignored.
  +    </p>
       <h3>Parameters</h3>
       <table border="1" cellpadding="2" cellspacing="0">
         <tr>
  
  
  
  1.7       +15 -0     ant/src/etc/testcases/taskdefs/macrodef.xml
  
  Index: macrodef.xml
  ===================================================================
  RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/macrodef.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- macrodef.xml	22 Dec 2003 09:46:23 -0000	1.6
  +++ macrodef.xml	19 Jan 2004 09:51:02 -0000	1.7
  @@ -86,4 +86,19 @@
       <ignore myattribute="a"/>
       <ignore Myattribute="b"/>
     </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>
  
  
  
  1.7       +6 -0      ant/src/testcases/org/apache/tools/ant/taskdefs/MacroDefTest.java
  
  Index: MacroDefTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/MacroDefTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MacroDefTest.java	22 Dec 2003 09:46:23 -0000	1.6
  +++ MacroDefTest.java	19 Jan 2004 09:51:02 -0000	1.7
  @@ -109,5 +109,11 @@
               "ignorecase",
               "a is ab is b");
       }
  +
  +    public void testIgnoreElementCase() {
  +        expectLog(
  +            "ignore-element-case",
  +            "nested elementnested element");
  +    }
   }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message