commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1779826 - in /commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/memory/util: DefaultMemoryElementDescriptor.java SoftReferenceElementDescriptor.java
Date Sun, 22 Jan 2017 15:37:38 GMT
Author: tv
Date: Sun Jan 22 15:37:37 2017
New Revision: 1779826

URL: http://svn.apache.org/viewvc?rev=1779826&view=rev
Log:
Avoid duplicate storage of cache element

Modified:
    commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/memory/util/DefaultMemoryElementDescriptor.java
    commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/memory/util/SoftReferenceElementDescriptor.java

Modified: commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/memory/util/DefaultMemoryElementDescriptor.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/memory/util/DefaultMemoryElementDescriptor.java?rev=1779826&r1=1779825&r2=1779826&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/memory/util/DefaultMemoryElementDescriptor.java
(original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/memory/util/DefaultMemoryElementDescriptor.java
Sun Jan 22 15:37:37 2017
@@ -30,9 +30,6 @@ public class DefaultMemoryElementDescrip
     /** Don't change */
     private static final long serialVersionUID = -1905161209035522460L;
 
-    /** The CacheElement wrapped by this descriptor */
-    private final ICacheElement<K, V> ce;
-
     /**
      * Constructs a usable MemoryElementDescriptor.
      * <p>
@@ -41,7 +38,6 @@ public class DefaultMemoryElementDescrip
     public DefaultMemoryElementDescriptor( ICacheElement<K, V> ce )
     {
         super( ce );
-        this.ce = ce;
     }
 
     /**
@@ -50,6 +46,6 @@ public class DefaultMemoryElementDescrip
     @Override
     public ICacheElement<K, V> getCacheElement()
     {
-        return ce;
+        return getPayload();
     }
 }

Modified: commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/memory/util/SoftReferenceElementDescriptor.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/memory/util/SoftReferenceElementDescriptor.java?rev=1779826&r1=1779825&r2=1779826&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/memory/util/SoftReferenceElementDescriptor.java
(original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/engine/memory/util/SoftReferenceElementDescriptor.java
Sun Jan 22 15:37:37 2017
@@ -42,7 +42,7 @@ public class SoftReferenceElementDescrip
      */
     public SoftReferenceElementDescriptor( ICacheElement<K, V> ce )
     {
-        super( ce );
+        super( null );
         this.srce = new SoftReference<ICacheElement<K, V>>(ce);
     }
 



Mime
View raw message