You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by jb...@apache.org on 2006/02/06 12:42:34 UTC

svn commit: r375255 - in /cocoon/branches/BRANCH_2_1_X: src/java/org/apache/cocoon/generation/DirectoryGenerator.java status.xml

Author: jbq
Date: Mon Feb  6 03:42:31 2006
New Revision: 375255

URL: http://svn.apache.org/viewcvs?rev=375255&view=rev
Log:
Fix COCOON-1681: Generator "directory": Caching too much

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/DirectoryGenerator.java
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/DirectoryGenerator.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/DirectoryGenerator.java?rev=375255&r1=375254&r2=375255&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/DirectoryGenerator.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/DirectoryGenerator.java Mon Feb  6 03:42:31 2006
@@ -516,28 +516,29 @@
 
         public int isValid() {
             if (System.currentTimeMillis() <= expiry) {
-                return 1;
+                return SourceValidity.VALID;
             }
 
-            expiry = System.currentTimeMillis() + delay;
             int len = files.size();
             for (int i = 0; i < len; i++) {
                 File f = (File)files.get(i);
                 if (!f.exists()) {
-                    return -1; // File was removed
+                    return SourceValidity.INVALID; // File was removed
                 }
 
                 long oldDate = ((Long)fileDates.get(i)).longValue();
                 long newDate = f.lastModified();
 
                 if (oldDate != newDate) {
-                    return -1;
+                    // File's last modified date has changed since last check
+                    // NOTE: this occurs on directories as well when a file is added
+                    return SourceValidity.INVALID;
                 }
             }
 
             // all content is up to date: update the expiry date
             expiry = System.currentTimeMillis() + delay;
-            return 1;
+            return SourceValidity.VALID;
         }
 
         public int isValid(SourceValidity newValidity) {

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?rev=375255&r1=375254&r2=375255&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Mon Feb  6 03:42:31 2006
@@ -180,6 +180,9 @@
   <release version="@version@" date="@date@">
 -->
   <release version="2.1.9" date="TBD">
+    <action dev="JBQ" type="fix" fixes-bug="COCOON-1681" due-to="Antonio Fiol" due-to-email="antonio.fiol@gmail.com">
+      Fix a bug in DirectoryGenerator: when using cocoon: changes were not detected
+    </action>
     <action dev="JBQ" type="fix" fixes-bug="COCOON-1238" due-to="Bart Molenkamp" due-to-email="b.molenkamp@bizzdesign.nl">
       CForms: Incompatible change for &lt;fb:custom&gt;: the base context is now passed instead of the relative context.
       <strong>Please change corresponding classes and use getXpath() to create the relative context yourself</strong>.