cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: r125098 - /cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java
Date Thu, 13 Jan 2005 20:36:11 GMT
Author: tim
Date: Thu Jan 13 12:36:08 2005
New Revision: 125098

URL: http://svn.apache.org/viewcvs?view=rev&rev=125098
Log:
Add some comments
Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java?view=diff&rev=125098&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java&r1=125097&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java&r2=125098
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java
Thu Jan 13 12:36:08 2005
@@ -59,15 +59,18 @@
         String key = prefix + source.getURI();
         SourceValidity newValidity = source.getValidity();
 
+        // If source is not valid then remove object from cache and return null
         if (newValidity == null) {
             cache.remove(key);
             return null;
         }
 
+        // If object is not in cache then return null
         Object[] objectAndValidity = (Object[])cache.get(key);
         if (objectAndValidity == null)
             return null;
 
+       // Check stored validity against current source validity
         SourceValidity storedValidity = (SourceValidity)objectAndValidity[1];
         int valid = storedValidity.isValid();
         boolean isValid;
@@ -78,11 +81,13 @@
             isValid = (valid == 1);
         }
 
+        // If stored object is not valid then remove object from cache and return null
         if (!isValid) {
             cache.remove(key);
             return null;
         }
 
+        // If valid then return cached object
         return objectAndValidity[0];
     }
 

Mime
View raw message