From e713682ea69123ef5ca4935776b817a2b81645cf Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Mon, 18 Aug 2008 14:48:51 +0000 Subject: [PATCH] sometimes an infinite recursion of filters is flagged when there is none. PR 44226. Submitted by Adam Bryzak. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@686775 13f79535-47bb-0310-9956-ffa450edef68 --- CONTRIBUTORS | 1 + WHATSNEW | 4 ++++ contributors.xml | 4 ++++ .../org/apache/tools/ant/types/FilterSet.java | 3 +++ src/tests/antunit/types/filterset-test.xml | 18 ++++++++++-------- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index e5b49d6c8..e46faa80b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1,6 +1,7 @@ Amongst other, the following people contributed to ant: Adam Blinkinsop +Adam Bryzak Aleksandr Ishutin Alexey Panchenko Alexey Solofnenko diff --git a/WHATSNEW b/WHATSNEW index f0aaec5bb..35b562a5b 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -154,6 +154,10 @@ Fixed bugs: was not set. Bugzilla Report 45245. + * sometimes incorrectly flagged infinite recursions of + filter tokens + Bugzilla Report 44226. + Other changes: -------------- diff --git a/contributors.xml b/contributors.xml index a26661234..b76c1d252 100644 --- a/contributors.xml +++ b/contributors.xml @@ -34,6 +34,10 @@ Adam Blinkinsop + + Adam + Bryzak + Aleksandr Ishutin diff --git a/src/main/org/apache/tools/ant/types/FilterSet.java b/src/main/org/apache/tools/ant/types/FilterSet.java index 592725b6c..63c829886 100644 --- a/src/main/org/apache/tools/ant/types/FilterSet.java +++ b/src/main/org/apache/tools/ant/types/FilterSet.java @@ -593,6 +593,9 @@ public class FilterSet extends DataType implements Cloneable { duplicateToken = false; } } + } else if (passedTokens.size() > 0) { + // remove last seen token when crawling out of recursion + passedTokens.remove(passedTokens.size() - 1); } recurseDepth--; return value; diff --git a/src/tests/antunit/types/filterset-test.xml b/src/tests/antunit/types/filterset-test.xml index 7287aab4b..7e32b7488 100644 --- a/src/tests/antunit/types/filterset-test.xml +++ b/src/tests/antunit/types/filterset-test.xml @@ -15,27 +15,29 @@ See the License for the specific language governing permissions and limitations under the License. --> - + + + - + + - - - - - - + + +