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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user