ignored; instead an error was thrown. Bugzilla report 39954. Submitted by Ivan Ivanov. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@419276 13f79535-47bb-0310-9956-ffa450edef68master
@@ -238,9 +238,12 @@ Fixed bugs: | |||||
* If the class invoked by the <java> task threw a ClassNotFoundException, | * If the class invoked by the <java> task threw a ClassNotFoundException, | ||||
this was misinterpreted as the specified class itself not being found. | 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: | 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. | * Improve compatibility with GNU Classpath and java versions prior to 1.5. Bugzilla 39027. | ||||
@@ -12,6 +12,10 @@ | |||||
<echoproperties /> | <echoproperties /> | ||||
</target> | </target> | ||||
<target name="testEchoWithEmptyPrefixToLog" depends="setup"> | |||||
<echoproperties prefix=""/> | |||||
</target> | |||||
<target name="testEchoToLogXml" depends="setup"> | <target name="testEchoToLogXml" depends="setup"> | ||||
<echoproperties format="xml" /> | <echoproperties format="xml" /> | ||||
</target> | </target> | ||||
@@ -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"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -174,10 +174,12 @@ public class EchoProperties extends Task { | |||||
*@param prefix The new prefix value | *@param prefix The new prefix value | ||||
*/ | */ | ||||
public void setPrefix(String prefix) { | 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); | |||||
} | |||||
} | } | ||||
/** | /** | ||||
@@ -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"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -63,6 +63,10 @@ public class EchoPropertiesTest extends BuildFileTest { | |||||
expectLogContaining("testEchoToLog", "test.property="+TEST_VALUE); | expectLogContaining("testEchoToLog", "test.property="+TEST_VALUE); | ||||
} | } | ||||
public void testEchoWithEmptyPrefixToLog() { | |||||
expectLogContaining("testEchoWithEmptyPrefixToLog", "test.property="+TEST_VALUE); | |||||
} | |||||
public void testReadBadFile() { | public void testReadBadFile() { | ||||
expectBuildExceptionContaining( "testReadBadFile", | expectBuildExceptionContaining( "testReadBadFile", | ||||