bodewig 2003/04/09 08:37:57
Modified: . WHATSNEW src/main/org/apache/tools/ant/filters ReplaceTokens.java Log: Don't die on empty values. PR: 18625 Revision Changes Path 1.393 +3 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.392 retrieving revision 1.393 diff -u -r1.392 -r1.393 --- WHATSNEW 9 Apr 2003 13:36:32 -0000 1.392 +++ WHATSNEW 9 Apr 2003 15:37:57 -0000 1.393 @@ -90,6 +90,9 @@ * <tar> and <zip> didn't honor the defaultexcludes attribute for the implicit fileset. Bugzilla Report 18637. +* The <replacetokens> filter would throw an exception if the token's + value was an empty string. Bugzilla Report 18625. + Other changes: -------------- * Shipped XML parser is now Xerces 2.4.0 1.11 +4 -2 ant/src/main/org/apache/tools/ant/filters/ReplaceTokens.java Index: ReplaceTokens.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/ReplaceTokens.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- ReplaceTokens.java 19 Feb 2003 14:40:37 -0000 1.10 +++ ReplaceTokens.java 9 Apr 2003 15:37:57 -0000 1.11 @@ -190,8 +190,10 @@ final String replaceWith = (String) hash.get(key.toString()); if (replaceWith != null) { - replaceData = replaceWith; - replaceIndex = 0; + if (replaceWith.length() > 0) { + replaceData = replaceWith; + replaceIndex = 0; + } return read(); } else { String newData = key.toString() + endToken;