Create the memoryTable during the constructor, instead of calling

setLru.  This removes a null check in the latter method.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@929819 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adam Heath
2010-04-01 04:34:49 +00:00
parent a5c9f50d5a
commit 204dc4e8f7
@@ -87,7 +87,11 @@ public class CacheLineTable<K, V> implements Serializable {
}
}
}
this.setLru(maxInMemory);
if (maxInMemory > 0) {
this.memoryTable = Collections.synchronizedMap(new LRUMap<Object, CacheLine<V>>(maxInMemory));
} else {
this.memoryTable = FastMap.newInstance();
}
}
private Object fromKey(Object key) {
@@ -294,9 +298,7 @@ public class CacheLineTable<K, V> implements Serializable {
this.memoryTable = FastMap.newInstance();
}
if (oldmap != null) {
this.memoryTable.putAll(oldmap);
}
this.memoryTable.putAll(oldmap);
}
public synchronized K getKeyFromMemory(int index) {