diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/cache/AbstractEntityConditionCache.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/cache/AbstractEntityConditionCache.java index e310eb7e89..a64a81792c 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/cache/AbstractEntityConditionCache.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/cache/AbstractEntityConditionCache.java @@ -65,12 +65,10 @@ public abstract class AbstractEntityConditionCache extends AbstractCache it = model.getViewConvertorsIterator(); - while (it.hasNext()) { - String targetEntityName = it.next(); - UtilCache.clearCache(getCacheName(targetEntityName)); - } + Iterator it = model.getViewConvertorsIterator(); + while (it.hasNext()) { + String targetEntityName = it.next(); + UtilCache.clearCache(getCacheName(targetEntityName)); } } @@ -113,7 +111,7 @@ public abstract class AbstractEntityConditionCache extends AbstractCache conditionCache = utilCache.get(conditionKey); if (conditionCache == null) { - conditionCache = new ConcurrentHashMap(); + conditionCache = new ConcurrentHashMap<>(); utilCache.put(conditionKey, conditionCache); } return conditionCache; @@ -166,9 +164,6 @@ public abstract class AbstractEntityConditionCache extends AbstractCache it = model.getViewConvertorsIterator(); while (it.hasNext()) { @@ -180,9 +175,6 @@ public abstract class AbstractEntityConditionCache extends AbstractCache, T2 extends Map> void storeHook(String entityName, boolean isPK, List oldValues, List newValues) { UtilCache> entityCache = UtilCache.findCache(getCacheName(entityName)); // for info about cache clearing - if (UtilValidate.isEmpty(newValues) || newValues.get(0) == null) { - //Debug.logInfo("In storeHook (cache clear) for entity name [" + entityName + "], got entity cache with name: " + (entityCache == null ? "[No cache found to remove from]" : entityCache.getName()), module); - } if (entityCache == null) { return; }