diff --git a/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java b/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java index 88e3f08ca1..967ec46162 100644 --- a/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java +++ b/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java @@ -87,7 +87,11 @@ public class CacheLineTable implements Serializable { } } } - this.setLru(maxInMemory); + if (maxInMemory > 0) { + this.memoryTable = Collections.synchronizedMap(new LRUMap>(maxInMemory)); + } else { + this.memoryTable = FastMap.newInstance(); + } } private Object fromKey(Object key) { @@ -294,9 +298,7 @@ public class CacheLineTable implements Serializable { this.memoryTable = FastMap.newInstance(); } - if (oldmap != null) { - this.memoryTable.putAll(oldmap); - } + this.memoryTable.putAll(oldmap); } public synchronized K getKeyFromMemory(int index) {