diff --git a/WHATSNEW b/WHATSNEW index c6372a369..5697cded6 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -90,6 +90,9 @@ Fixed bugs: * and didn't honor the defaultexcludes attribute for the implicit fileset. Bugzilla Report 18637. +* The 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 diff --git a/src/main/org/apache/tools/ant/filters/ReplaceTokens.java b/src/main/org/apache/tools/ant/filters/ReplaceTokens.java index 92c547e37..1a3dc8126 100644 --- a/src/main/org/apache/tools/ant/filters/ReplaceTokens.java +++ b/src/main/org/apache/tools/ant/filters/ReplaceTokens.java @@ -190,8 +190,10 @@ public final class ReplaceTokens 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;