Author: mbenson
Date: Wed Jul  5 09:47:56 2006
New Revision: 419276

URL: http://svn.apache.org/viewvc?rev=419276&view=rev
Log:
<echoproperties> setPrefix javadoc claimed null or empty prefix would be
ignored; instead an error was thrown.  Bugzilla report 39954.
Submitted by Ivan Ivanov.

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/etc/testcases/taskdefs/optional/echoproperties.xml
    
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
    
ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=419276&r1=419275&r2=419276&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Wed Jul  5 09:47:56 2006
@@ -238,9 +238,12 @@
 * If the class invoked by the <java> task threw a ClassNotFoundException,
   this was misinterpreted as the specified class itself not being found.
 
+* <echoproperties> setPrefix javadoc claimed null or empty prefix would be
+  ignored; instead an error was thrown.  Bugzilla report 39954.
+
 Other changes:
 --------------
-* took in bugzilla report 39320.
+* Took in bugzilla report 39320.
 
 * Improve compatibility with GNU Classpath and java versions prior to 1.5. 
Bugzilla 39027.
 

Modified: ant/core/trunk/src/etc/testcases/taskdefs/optional/echoproperties.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/optional/echoproperties.xml?rev=419276&r1=419275&r2=419276&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/optional/echoproperties.xml 
(original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/optional/echoproperties.xml Wed 
Jul  5 09:47:56 2006
@@ -12,6 +12,10 @@
     <echoproperties />
   </target>
 
+  <target name="testEchoWithEmptyPrefixToLog" depends="setup">
+    <echoproperties prefix=""/>
+  </target>
+
   <target name="testEchoToLogXml" depends="setup">
     <echoproperties format="xml" />
   </target>

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java?rev=419276&r1=419275&r2=419276&view=diff
==============================================================================
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
 Wed Jul  5 09:47:56 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2002-2005 The Apache Software Foundation
+ * Copyright 2002-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -174,10 +174,12 @@
      [EMAIL PROTECTED]  prefix  The new prefix value
      */
     public void setPrefix(String prefix) {
-        PropertySet ps = new PropertySet();
-        ps.setProject(getProject());
-        ps.appendPrefix(prefix);
-        addPropertyset(ps);
+        if (prefix != null && prefix.length() != 0) {
+            PropertySet ps = new PropertySet();
+            ps.setProject(getProject());
+            ps.appendPrefix(prefix);
+            addPropertyset(ps);
+        }
     }
 
     /**

Modified: 
ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java?rev=419276&r1=419275&r2=419276&view=diff
==============================================================================
--- 
ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java
 (original)
+++ 
ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java
 Wed Jul  5 09:47:56 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2000-2005 The Apache Software Foundation
+ * Copyright 2000-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -61,6 +61,10 @@
 
     public void testEchoToLog() {
         expectLogContaining("testEchoToLog", "test.property="+TEST_VALUE);
+    }
+
+    public void testEchoWithEmptyPrefixToLog() {
+        expectLogContaining("testEchoWithEmptyPrefixToLog", 
"test.property="+TEST_VALUE);
     }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to