svn commit: r1790520 - /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/cache/AbstractEntityConditionCache.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1790520 - /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/cache/AbstractEntityConditionCache.java

jacopoc
Author: jacopoc
Date: Fri Apr  7 08:34:57 2017
New Revision: 1790520

URL: http://svn.apache.org/viewvc?rev=1790520&view=rev
Log:
Improved: cleaned up some old code without altering its functional behavior.

Modified:
    ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/cache/AbstractEntityConditionCache.java

Modified: ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/cache/AbstractEntityConditionCache.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/cache/AbstractEntityConditionCache.java?rev=1790520&r1=1790519&r2=1790520&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/cache/AbstractEntityConditionCache.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/cache/AbstractEntityConditionCache.java Fri Apr  7 08:34:57 2017
@@ -157,13 +157,9 @@ public abstract class AbstractEntityCond
         storeHook(true, oldPK, newEntity);
     }
 
-    protected List<? extends Map<String, Object>> convert(boolean isPK, String targetEntityName, GenericEntity entity) {
+    protected List<? extends Map<String, Object>> convert(String targetEntityName, GenericEntity entity) {
         if (isNull(entity)) return null;
-        if (isPK) {
-            return entity.getModelEntity().convertToViewValues(targetEntityName, entity);
-        } else {
-            return entity.getModelEntity().convertToViewValues(targetEntityName, entity);
-        }
+        return entity.getModelEntity().convertToViewValues(targetEntityName, entity);
     }
 
     public void storeHook(boolean isPK, GenericEntity oldEntity, GenericEntity newEntity) {
@@ -177,7 +173,7 @@ public abstract class AbstractEntityCond
         Iterator<String> it = model.getViewConvertorsIterator();
         while (it.hasNext()) {
             String targetEntityName = it.next();
-            storeHook(targetEntityName, isPK, convert(isPK, targetEntityName, oldEntity), convert(false, targetEntityName, newEntity));
+            storeHook(targetEntityName, isPK, convert(targetEntityName, oldEntity), convert(targetEntityName, newEntity));
         }
     }