You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2009/09/14 19:02:37 UTC

svn commit: r814731 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java

Author: doogie
Date: Mon Sep 14 17:02:36 2009
New Revision: 814731

URL: http://svn.apache.org/viewvc?rev=814731&view=rev
Log:
Fix AND and OR support when evaluating some conditions in memory;
namely, EntityExpr(Condition, Join, Condition) didn't work.

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java?rev=814731&r1=814730&r2=814731&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java Mon Sep 14 17:02:36 2009
@@ -117,8 +117,8 @@
     }
 
     public boolean entityMatches(GenericEntity entity, EntityCondition lhs, EntityCondition rhs) {
-        if (lhs.entityMatches(entity)) return shortCircuitValue;
-        if (rhs.entityMatches(entity)) return shortCircuitValue;
+        if (lhs.entityMatches(entity) == shortCircuitValue) return shortCircuitValue;
+        if (rhs.entityMatches(entity) == shortCircuitValue) return shortCircuitValue;
         return !shortCircuitValue;
     }
 
@@ -132,8 +132,8 @@
 
     @Override
     public boolean mapMatches(GenericDelegator delegator, Map<String, ? extends Object> map, Object lhs, Object rhs) {
-        if (((EntityCondition) lhs).mapMatches(delegator, map)) return shortCircuitValue;
-        if (((EntityCondition) rhs).mapMatches(delegator, map)) return shortCircuitValue;
+        if (((EntityCondition) lhs).mapMatches(delegator, map) == shortCircuitValue) return shortCircuitValue;
+        if (((EntityCondition) rhs).mapMatches(delegator, map) == shortCircuitValue) return shortCircuitValue;
         return !shortCircuitValue;
     }