cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: r125091 - /cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java
Date Thu, 13 Jan 2005 19:35:32 GMT
Author: tim
Date: Thu Jan 13 11:35:30 2005
New Revision: 125091

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

Modified: cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java?view=diff&rev=125091&p1=cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java&r1=125090&p2=cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java&r2=125091
==============================================================================
--- cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java	(original)
+++ cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/DefaultCacheManager.java	Thu
Jan 13 11:35:30 2005
@@ -58,15 +58,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;
@@ -77,11 +80,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