You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2004/08/17 20:13:50 UTC

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs MacroInstance.java

peterreilly    2004/08/17 11:13:50

  Modified:    .        WHATSNEW
               src/main/org/apache/tools/ant/taskdefs MacroInstance.java
  Log:
  fix for multiple macro instance use to fail
  
  Revision  Changes    Path
  1.647     +4 -1      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.646
  retrieving revision 1.647
  diff -u -r1.646 -r1.647
  --- WHATSNEW	16 Aug 2004 21:58:53 -0000	1.646
  +++ WHATSNEW	17 Aug 2004 18:13:49 -0000	1.647
  @@ -65,7 +65,10 @@
   
   * Impossible to use implicit classpath for <taskdef>
     when Ant core loader != Java application loader and Path.systemClassPath taken from ${java.class.path}
  -  Bugzilla 30161.  
  +  Bugzilla 30161.
  +
  +* MacroInstance did not clean up nested elements correctly in the execute method, causing
  +  multiple use of the same marco instance with nested elements to fail.
   
   Changes from Ant 1.6.1 to Ant 1.6.2
   ===================================
  
  
  
  1.28      +5 -2      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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- MacroInstance.java	27 May 2004 14:38:46 -0000	1.27
  +++ MacroInstance.java	17 Aug 2004 18:13:50 -0000	1.28
  @@ -48,8 +48,8 @@
       private MacroDef macroDef;
       private Map      map = new HashMap();
       private Map      nsElements = null;
  -    private Map      presentElements = new HashMap();
  -    private Hashtable localProperties = new Hashtable();
  +    private Map      presentElements;
  +    private Hashtable localProperties;
       private String    text = null;
       private String    implicitTag =     null;
       private List      unknownElements = new ArrayList();
  @@ -321,6 +321,7 @@
        *
        */
       public void execute() {
  +        presentElements = new HashMap();
           getNsElements();
           processTasks();
           localProperties = new Hashtable();
  @@ -379,5 +380,7 @@
               throw ProjectHelper.addLocationToBuildException(
                   ex, getLocation());
           }
  +        presentElements = null;
  +        localProperties = null;
       }
   }
  
  
  

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