Author: mcucchiara Date: Sun Oct 16 07:28:33 2011 New Revision: 1184771 URL: http://svn.apache.org/viewvc?rev=1184771&view=rev Log: Slimmed cache implementation
Modified: commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/Cache.java commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCacheImpl.java Modified: commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/Cache.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/Cache.java?rev=1184771&r1=1184770&r2=1184771&view=diff ============================================================================== --- commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/Cache.java (original) +++ commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/Cache.java Sun Oct 16 07:28:33 2011 @@ -30,9 +30,6 @@ public interface Cache<K, V> V get( K key ) throws CacheException; - V get( K key, CacheEntryFactory<K, V> cacheEntryFactory ) - throws CacheException; - V put( K key, V value ); } Modified: commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCacheImpl.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCacheImpl.java?rev=1184771&r1=1184770&r2=1184771&view=diff ============================================================================== --- commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCacheImpl.java (original) +++ commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCacheImpl.java Sun Oct 16 07:28:33 2011 @@ -43,16 +43,6 @@ public class ClassCacheImpl<V> private ClassCacheInspector _classInspector; private int _size = 0; - private CacheEntryFactory<Class<?>, V> factory; - - public ClassCacheImpl( CacheEntryFactory<Class<?>, V> factory ) - { - this.factory = factory; - } - - public ClassCacheImpl() - { - } /** * {@inheritDoc} @@ -86,13 +76,7 @@ public class ClassCacheImpl<V> /** * {@inheritDoc} */ - public final V get( Class<?> key) - throws CacheException - { - return get( key, null ); - } - - public final V get( Class<?> key, CacheEntryFactory<Class<?>, V> cacheEntryFactory ) + public final V get( Class<?> key ) throws CacheException { int i = key.hashCode() & TABLE_SIZE_MASK; @@ -108,10 +92,6 @@ public class ClassCacheImpl<V> entry = entry.getNext(); } - if ( factory != null ) - { - return put(key, factory.create(key)); - } return null; }