ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r481041 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/types/FilterSet.java src/tests/antunit/types/filterset-test.xml
Date Thu, 30 Nov 2006 19:11:06 GMT
Author: mbenson
Date: Thu Nov 30 11:11:04 2006
New Revision: 481041

URL: http://svn.apache.org/viewvc?view=rev&rev=481041
Log:
fix NPE in recursive filtering. BZ 41086.

Added:
    ant/core/trunk/src/tests/antunit/types/filterset-test.xml   (with props)
Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/types/FilterSet.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=481041&r1=481040&r2=481041
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Nov 30 11:11:04 2006
@@ -28,6 +28,9 @@
 * dependset failed if the basedir of a target fileset did not exist.
   Bugzilla 40916.
 
+* Recursive filtering encountered NullPointerExceptions under certain
+  circumstances.  Bugzilla 41086.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/FilterSet.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/FilterSet.java?view=diff&rev=481041&r1=481040&r2=481041
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/FilterSet.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/FilterSet.java Thu Nov 30 11:11:04
2006
@@ -581,8 +581,8 @@
         }
         passedTokens.addElement(parent);
         String value = iReplaceTokens(line);
-        if (value.indexOf(beginToken) == -1 && !duplicateToken) {
-            duplicateToken = false;
+        if (value.indexOf(beginToken) == -1 && !duplicateToken
+                && recurseDepth == 1) {
             passedTokens = null;
         } else if (duplicateToken) {
             // should always be the case...

Added: ant/core/trunk/src/tests/antunit/types/filterset-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/types/filterset-test.xml?view=auto&rev=481041
==============================================================================
--- ant/core/trunk/src/tests/antunit/types/filterset-test.xml (added)
+++ ant/core/trunk/src/tests/antunit/types/filterset-test.xml Thu Nov 30 11:11:04 2006
@@ -0,0 +1,28 @@
+<project xmlns:au="antlib:org.apache.ant.antunit">
+
+  <property name="br" value="${line.separator}" />
+
+  <target name="testRecursionRegression">
+    <copy todir="${basedir}">
+      <string value="@a@${br}@b@${br}@c@${br}" />
+      <mergemapper to="filterset-output.txt" />
+      <filterset>
+        <filter token="a" value="aaa" />
+        <filter token="b" value="bbb" />
+        <filter token="c" value="@a@:@b@" />
+      </filterset>
+    </copy>
+
+    <au:assertTrue>
+      <resourcesmatch astext="true">
+        <file file="filterset-output.txt" />
+        <string value="aaa${br}bbb${br}aaa:bbb${br}" />
+      </resourcesmatch>
+    </au:assertTrue>
+  </target>
+
+  <target name="tearDown">
+    <delete file="filterset-output.txt" />
+  </target>
+
+</project>

Propchange: ant/core/trunk/src/tests/antunit/types/filterset-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message