ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r481078 - in /ant/core/trunk: CONTRIBUTORS WHATSNEW contributors.xml src/main/org/apache/tools/ant/taskdefs/XmlProperty.java src/tests/antunit/taskdefs/xmlproperty-test.xml
Date Thu, 30 Nov 2006 21:03:19 GMT
Author: peterreilly
Date: Thu Nov 30 13:03:17 2006
New Revision: 481078

URL: http://svn.apache.org/viewvc?view=rev&rev=481078
Log:
BZ:41080 xmlproperty multi-values overwrite properties

Modified:
    ant/core/trunk/CONTRIBUTORS
    ant/core/trunk/WHATSNEW
    ant/core/trunk/contributors.xml
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java
    ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml

Modified: ant/core/trunk/CONTRIBUTORS
URL: http://svn.apache.org/viewvc/ant/core/trunk/CONTRIBUTORS?view=diff&rev=481078&r1=481077&r2=481078
==============================================================================
Binary files - no diff available.

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=481078&r1=481077&r2=481078
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Nov 30 13:03:17 2006
@@ -31,6 +31,9 @@
 * Recursive filtering encountered NullPointerExceptions under certain
   circumstances.  Bugzilla 41086.
 
+* XmlProperty overrides previously set property value when handling duplicate 
+  elements. Bugzilla 41080.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/contributors.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/contributors.xml?view=diff&rev=481078&r1=481077&r2=481078
==============================================================================
--- ant/core/trunk/contributors.xml (original)
+++ ant/core/trunk/contributors.xml Thu Nov 30 13:03:17 2006
@@ -39,6 +39,10 @@
     <last>Urazov</last>
   </name>
   <name>
+    <first>Andy</first>
+    <last>Wood</last>
+  </name>
+  <name>
     <first>Anil</first>
     <middle>K.</middle>
     <last>Vijendran</last>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java?view=diff&rev=481078&r1=481077&r2=481078
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java Thu Nov 30 13:03:17
2006
@@ -499,10 +499,13 @@
             // to allow other properties to reference them.
             value = (String) addedAttributes.get(name) + "," + value;
             getProject().setProperty(name, value);
-        } else {
+            addedAttributes.put(name, value);
+        } else if (getProject().getProperty(name) == null) {
             getProject().setNewProperty(name, value);
+            addedAttributes.put(name, value);
+        } else {
+            log("Override ignored for property " + name, Project.MSG_VERBOSE);
         }
-        addedAttributes.put(name, value);
         if (id != null) {
             getProject().addReference(id, value);
         }

Modified: ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml?view=diff&rev=481078&r1=481077&r2=481078
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml Thu Nov 30 13:03:17 2006
@@ -6,5 +6,12 @@
       <equals arg1="" arg2="${project.description}"/>
     </au:assertTrue>
   </target>
+  <target name="test-multi">
+    <property name="root.element.value" value="original"/>
+    <xmlproperty file="xmlproperty.multi.xml" collapseAttributes="yes"/>
+    <au:assertTrue>
+      <equals arg1="original" arg2="${root.element.value}"/>
+    </au:assertTrue>
+  </target>
 </project>
 



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


Mime
View raw message