From 81fe6f68b641eb7ef61366d110af55671b1fdf8a Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 11 Apr 2017 16:22:34 +0200 Subject: [PATCH 1/2] fix order if sections --- WHATSNEW | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index ae2cb15a8..1f03df5f2 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -1,13 +1,6 @@ Changes from Ant 1.9.9 TO Ant 1.9.10 ==================================== -Other changes: --------------- - - * Added forceCsvQuoteChar option to task. When enabled the - values always get quoted. - Github Pull Request #32 - Fixed bugs: ----------- @@ -15,6 +8,13 @@ Fixed bugs: value. Bugzilla Report 60767 +Other changes: +-------------- + + * Added forceCsvQuoteChar option to task. When enabled the + values always get quoted. + Github Pull Request #32 + Changes from Ant 1.9.8 TO Ant 1.9.9 =================================== From 53474759846a9ade58ddbd6f24b1649f16e3233f Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 11 Apr 2017 16:29:41 +0200 Subject: [PATCH 2/2] add regexp attribute to linecontainsregexp https://bz.apache.org/bugzilla/show_bug.cgi?id=60968 --- WHATSNEW | 3 +++ manual/Types/filterchain.html | 7 ++++++- .../tools/ant/filters/LineContainsRegExp.java | 15 +++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 1f03df5f2..9dac4536c 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -15,6 +15,9 @@ Other changes: values always get quoted. Github Pull Request #32 + * added "regexp" attribute to + Bugzilla Report 60968 + Changes from Ant 1.9.8 TO Ant 1.9.9 =================================== diff --git a/manual/Types/filterchain.html b/manual/Types/filterchain.html index 90dd74bef..c83b1066d 100644 --- a/manual/Types/filterchain.html +++ b/manual/Types/filterchain.html @@ -422,7 +422,12 @@ regular expression matching strings. regexp - Regular expression to be searched for. + Regular expression to be searched for.
+ Starting with 1.9.10 this also works as an attribute + on linecontainsregexp, in earlier versions of Ant + you must use a nested element when using the convenience + method. + Yes diff --git a/src/main/org/apache/tools/ant/filters/LineContainsRegExp.java b/src/main/org/apache/tools/ant/filters/LineContainsRegExp.java index 23a2005dd..09dce7759 100644 --- a/src/main/org/apache/tools/ant/filters/LineContainsRegExp.java +++ b/src/main/org/apache/tools/ant/filters/LineContainsRegExp.java @@ -219,6 +219,16 @@ public final class LineContainsRegExp return negate; } + /** + * Set the regular expression as an attribute. + * @since Ant 1.9.10 + */ + public void setRegexp(String pattern) { + RegularExpression regexp = new RegularExpression(); + regexp.setPattern(pattern); + regexps.addElement(regexp); + } + /** * Parses parameters to add user defined regular expressions. */ @@ -227,10 +237,7 @@ public final class LineContainsRegExp if (params != null) { for (int i = 0; i < params.length; i++) { if (REGEXP_KEY.equals(params[i].getType())) { - String pattern = params[i].getValue(); - RegularExpression regexp = new RegularExpression(); - regexp.setPattern(pattern); - regexps.addElement(regexp); + setRegexp(params[i].getValue()); } else if (NEGATE_KEY.equals(params[i].getType())) { setNegate(Project.toBoolean(params[i].getValue())); } else if (CS_KEY.equals(params[i].getType())) {