diff --git a/WHATSNEW b/WHATSNEW index 85b0cd29c..d506d0549 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -128,6 +128,10 @@ Other changes: * is now usable as a single-element ResourceCollection. +* It is now possible to provide the value of a filter's + nested element as nested text instead of using the 'value' + attribute. + Changes from Ant 1.6.5 to Ant 1.7.0 =================================== diff --git a/src/main/org/apache/tools/ant/filters/StripLineComments.java b/src/main/org/apache/tools/ant/filters/StripLineComments.java index d9bd97df5..84ac8904f 100644 --- a/src/main/org/apache/tools/ant/filters/StripLineComments.java +++ b/src/main/org/apache/tools/ant/filters/StripLineComments.java @@ -219,5 +219,15 @@ public final class StripLineComments public final String getValue() { return value; } + + /** + * Alt. syntax to set the prefix for this type of line comment. + * + * @param comment The prefix for a line comment of this type. + * Must not be null. + */ + public void addText(String comment) { + setValue(comment); + } } } diff --git a/src/tests/antunit/filters/striplinecomments-test.xml b/src/tests/antunit/filters/striplinecomments-test.xml new file mode 100644 index 000000000..a1cafee6f --- /dev/null +++ b/src/tests/antunit/filters/striplinecomments-test.xml @@ -0,0 +1,58 @@ + + + + + + foo +#pound +bar +//java sl +baz +REMark + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + // + REM + + + +