Should the cache attribute of BaseResourceCollectionContainer not
be defaulted to false. I fear that there may be other similar cases -
id a collection, print a collection, change the collection, use the collection.

Index: 
src/main/org/apache/tools/ant/types/resources/BaseResourceCollectionContainer.java
===================================================================
--- 
src/main/org/apache/tools/ant/types/resources/BaseResourceCollectionContainer.java
(revision 485230)
+++ 
src/main/org/apache/tools/ant/types/resources/BaseResourceCollectionContainer.java
(working copy)
@@ -38,7 +38,7 @@
    extends DataType implements ResourceCollection, Cloneable {
    private List rc = new ArrayList();
    private Collection coll = null;
-    private boolean cache = true;
+    private boolean cache = false;

    /**
     * Set whether to cache collections.

Peter
On 12/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Author: mbenson
Date: Mon Dec 11 14:36:06 2006
New Revision: 485926

URL: http://svn.apache.org/viewvc?view=rev&rev=485926
Log:
Regression: <path> was evaluating nested content only once, so that it could
not e.g. pick up files that didn't exist the first time through.
Bugzilla 41151.

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

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=485926&r1=485925&r2=485926
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Dec 11 14:36:06 2006
@@ -42,8 +42,11 @@
 * XmlProperty overrides previously set property value when handling duplicate
   elements. Bugzilla 41080.

-* Having many tasks causes OOM.
-  Bugzilla 41049.
+* Having many tasks causes OOM.  Bugzilla 41049.
+
+* Regression: <path> was evaluating nested content only once, so that it could
+  not e.g. pick up files that didn't exist the first time through.
+  Bugzilla 41151.

 Other changes:
 --------------

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java?view=diff&rev=485926&r1=485925&r2=485926
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java Mon Dec 11 
14:36:06 2006
@@ -277,6 +277,7 @@
         if (union == null) {
             union = new Union();
             union.setProject(getProject());
+            union.setCache(false);
         }
         union.add(c);
         setChecked(false);

Added: ant/core/trunk/src/tests/antunit/types/resources/latepath-test.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/types/resources/latepath-test.xml?view=auto&rev=485926
==============================================================================
--- ant/core/trunk/src/tests/antunit/types/resources/latepath-test.xml (added)
+++ ant/core/trunk/src/tests/antunit/types/resources/latepath-test.xml Mon Dec 
11 14:36:06 2006
@@ -0,0 +1,17 @@
+<project xmlns:au="antlib:org.apache.ant.antunit">
+
+  <target name="testLatePath" depends="tearDown">
+    <path id="p">
+      <fileset file="testLatePath" />
+    </path>
+    <pathconvert refid="p" />
+    <touch file="testLatePath" />
+    <au:assertTrue>
+      <resourcecount when="eq" count="1" refid="p" />
+    </au:assertTrue>
+  </target>
+
+  <target name="tearDown">
+    <delete file="testLatePath" />
+  </target>
+</project>

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to