incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1549707 - in /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource: JcrPropertyMap.java internal/JcrModifiableValueMap.java
Date Mon, 09 Dec 2013 23:35:26 GMT
Author: cziegeler
Date: Mon Dec  9 23:35:26 2013
New Revision: 1549707

URL: http://svn.apache.org/r1549707
Log:
SLING-3249 : Cache not properly used in JcrPropertyMap

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java?rev=1549707&r1=1549706&r2=1549707&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
Mon Dec  9 23:35:26 2013
@@ -336,9 +336,10 @@ public class JcrPropertyMap
             return null;
         }
 
-        // if the node has been completely read we can directly return
-        if ( fullyRead ) {
-            return cache.get(name);
+        // check cache
+        JcrPropertyMapCacheEntry cachedValued = cache.get(name);
+        if ( fullyRead || cachedValued != null ) {
+            return cachedValued;
         }
 
         try {

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java?rev=1549707&r1=1549706&r2=1549707&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java
Mon Dec  9 23:35:26 2013
@@ -327,9 +327,10 @@ public final class JcrModifiableValueMap
             return null;
         }
 
-        // if the node has been completely read we can directly return
-        if ( fullyRead ) {
-            return cache.get(name);
+        // check cache
+        JcrPropertyMapCacheEntry cachedValued = cache.get(name);
+        if ( fullyRead || cachedValued != null ) {
+            return cachedValued;
         }
 
         try {



Mime
View raw message