ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r573539 - in /ant/core/branches/ANT_17_BRANCH: WHATSNEW src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
Date Fri, 07 Sep 2007 10:53:05 GMT
Author: peterreilly
Date: Fri Sep  7 03:53:04 2007
New Revision: 573539

URL: http://svn.apache.org/viewvc?rev=573539&view=rev
Log:
sync the fix

Modified:
    ant/core/branches/ANT_17_BRANCH/WHATSNEW
    ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java

Modified: ant/core/branches/ANT_17_BRANCH/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/WHATSNEW?rev=573539&r1=573538&r2=573539&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/WHATSNEW (original)
+++ ant/core/branches/ANT_17_BRANCH/WHATSNEW Fri Sep  7 03:53:04 2007
@@ -117,6 +117,9 @@
 * FilterMapper could throw an NPE.
   Bugzilla 43292.
 
+* Regession nested macrodefs with elements could cause StackOverFlow.
+  Bugzilla 43324.
+
 Other changes:
 --------------
 * <script> now has basic support for JavaFX scripts

Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java?rev=573539&r1=573538&r2=573539&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
Fri Sep  7 03:53:04 2007
@@ -242,7 +242,7 @@
         this.text = text;
     }
 
-    private UnknownElement copy(UnknownElement ue) {
+    private UnknownElement copy(UnknownElement ue, boolean nested) {
         UnknownElement ret = new UnknownElement(ue.getTag());
         ret.setNamespace(ue.getNamespace());
         ret.setProject(getProject());
@@ -281,8 +281,8 @@
             }
             MacroDef.TemplateElement templateElement =
                 (MacroDef.TemplateElement) getNsElements().get(tag);
-            if (templateElement == null) {
-                UnknownElement child = copy(unknownElement);
+            if (templateElement == null || nested) {
+                UnknownElement child = copy(unknownElement, nested);
                 rc.addChild(child.getWrapper());
                 ret.addChild(child);
             } else if (templateElement.isImplicit()) {
@@ -293,7 +293,8 @@
                 }
                 for (Iterator i = unknownElements.iterator();
                      i.hasNext();) {
-                    UnknownElement child = copy((UnknownElement) i.next());
+                    UnknownElement child
+                        = copy((UnknownElement) i.next(), true);
                     rc.addChild(child.getWrapper());
                     ret.addChild(child);
                 }
@@ -317,7 +318,8 @@
                 if (list != null) {
                     for (Iterator i = list.iterator();
                          i.hasNext();) {
-                        UnknownElement child = copy((UnknownElement) i.next());
+                        UnknownElement child
+                            = copy((UnknownElement) i.next(), true);
                         rc.addChild(child.getWrapper());
                         ret.addChild(child);
                     }
@@ -386,7 +388,7 @@
         }
 
         // need to set the project on unknown element
-        UnknownElement c = copy(macroDef.getNestedTask());
+        UnknownElement c = copy(macroDef.getNestedTask(), false);
         c.init();
         try {
             c.perform();



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


Mime
View raw message