Author: rajdavies Date: Tue Oct 2 10:58:11 2007 New Revision: 581321 URL: http://svn.apache.org/viewvc?rev=581321&view=rev Log: be conservative allocating objects up-front
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java?rev=581321&r1=581320&r2=581321&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java Tue Oct 2 10:58:11 2007 @@ -32,10 +32,10 @@ protected int maxCacheSize = 10000; /** - * Default constructorfor an LRU Cache The default capacity is 10000 + * Default constructor for an LRU Cache The default capacity is 10000 */ public LRUCache() { - super(1000, 0.75f, true); + this(0,10000, 0.75f, true); } /** @@ -44,7 +44,7 @@ * @param maximumCacheSize */ public LRUCache(int maximumCacheSize) { - this(maximumCacheSize, maximumCacheSize, 0.75f, true); + this(0, maximumCacheSize, 0.75f, true); } /** @@ -57,7 +57,7 @@ * @param accessOrder the ordering mode - <tt>true</tt> for access-order, * <tt>false</tt> for insertion-order. * @throws IllegalArgumentException if the initial capacity is negative or - * the load factor is nonpositive. + * the load factor is non-positive. */ public LRUCache(int initialCapacity, int maximumCacheSize, float loadFactor, boolean accessOrder) { @@ -79,7 +79,7 @@ this.maxCacheSize = maxCacheSize; } - protected boolean removeEldestEntry(Map.Entry entry) { + protected boolean removeEldestEntry(Map.Entry<K,V> eldest) { return size() > maxCacheSize; } }