You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2011/10/24 18:34:32 UTC

svn commit: r1188209 - /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/CachedWorker.java

Author: hlship
Date: Mon Oct 24 16:34:32 2011
New Revision: 1188209

URL: http://svn.apache.org/viewvc?rev=1188209&view=rev
Log:
Replace an out-of-date comment with correct details

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/CachedWorker.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/CachedWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/CachedWorker.java?rev=1188209&r1=1188208&r2=1188209&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/CachedWorker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/CachedWorker.java Mon Oct 24 16:34:32 2011
@@ -138,10 +138,8 @@ public class CachedWorker implements Com
 
     private void adviseMethod(PlasticClass plasticClass, PlasticMethod method)
     {
-        // The key needs to reflect not just the method name, but also the containing
-        // page and component (otherwise, there would be unwanted sharing of cache
-        // between different instances of the same component within or across pages). This
-        // name can't be calculated until page instantiation time.
+        // Every instance of the clas srequires its own per-thread value. This handles the case of multiple
+        // pages containing the component, or the same page containing the component multiple times.
 
         PlasticField cacheField =
                 plasticClass.introduceField(PerThreadValue.class, "cache$" + method.getDescription().methodName);
@@ -157,7 +155,6 @@ public class CachedWorker implements Com
 
         Cached annotation = method.getAnnotation(Cached.class);
 
-
         MethodResultCacheFactory factory = createFactory(plasticClass, annotation.watch(), method);
 
         MethodAdvice advice = createAdvice(cacheField, factory);