ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgl...@apache.org
Subject svn commit: r359329 - in /ant/core/trunk: WHATSNEW src/etc/testcases/taskdefs/presetdef.xml src/main/org/apache/tools/ant/UnknownElement.java src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java
Date Wed, 28 Dec 2005 00:10:02 GMT
Author: jglick
Date: Tue Dec 27 16:09:58 2005
New Revision: 359329

URL: http://svn.apache.org/viewcvs?rev=359329&view=rev
Log:
#38056: NPE when using presetdef under obscure circumstances.

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/etc/testcases/taskdefs/presetdef.xml
    ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java
    ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewcvs/ant/core/trunk/WHATSNEW?rev=359329&r1=359328&r2=359329&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Tue Dec 27 16:09:58 2005
@@ -67,7 +67,8 @@
 
 Fixed bugs:
 -----------
-* Some potential NullPointerExceptions, Bugzilla Report 37765
+
+* Some potential NullPointerExceptions, Bugzilla Reports 37765 and 38056
 
 * Problem when adding multiple filter files, Bugzilla Report 37341
 

Modified: ant/core/trunk/src/etc/testcases/taskdefs/presetdef.xml
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/etc/testcases/taskdefs/presetdef.xml?rev=359329&r1=359328&r2=359329&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/presetdef.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/presetdef.xml Tue Dec 27 16:09:58 2005
@@ -118,4 +118,13 @@
     </javac>
   </target>
 
+    <target name="presetdef-with-nested-element-twice">
+        <copy todir=".">
+            <fileset dir="." includes="nonexistent"/>
+        </copy>
+        <presetdef name="copy">
+            <copy verbose="true"/>
+        </presetdef>
+    </target>
+
 </project>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java?rev=359329&r1=359328&r2=359329&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java Tue Dec 27 16:09:58 2005
@@ -41,7 +41,7 @@
     /**
      * Holds the namespace of the element.
      */
-    private String namespace;
+    private String namespace = "";
 
     /**
      * Holds the namespace qname of the element.
@@ -111,7 +111,7 @@
                 getProject());
             namespace = helper.getCurrentAntlibUri();
         }
-        this.namespace = namespace;
+        this.namespace = namespace == null ? "" : namespace;
     }
 
     /** Return the qname of the XML element associated with this component.

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java?rev=359329&r1=359328&r2=359329&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java Tue Dec
27 16:09:58 2005
@@ -80,6 +80,10 @@
             "correct_taskname_badel", "element message", "javac doesn't support the");
     }
     
+    public void testPresetdefWithNestedElementTwice() { // #38056
+        executeTarget("presetdef-with-nested-element-twice");
+        executeTarget("presetdef-with-nested-element-twice");
+    }
     
     /**
      * A test class to check default properties



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


Mime
View raw message