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 @@ --> + + Fix a bug in DirectoryGenerator: when using cocoon: changes were not detected + CForms: Incompatible change for <fb:custom>: the base context is now passed instead of the relative context. Please change corresponding classes and use getXpath() to create the relative context yourself.