Author: doogie
Date: Sun Jun 26 18:08:48 2011
New Revision: 1139868
URL:
http://svn.apache.org/viewvc?rev=1139868&view=revLog:
OPTIMIZE: ViewEntityCondition.createCondition: fetch the lhs
field into a local variable.
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java?rev=1139868&r1=1139867&r2=1139868&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java Sun Jun 26 18:08:48 2011
@@ -1266,7 +1266,8 @@ public class ModelViewEntity extends Mod
}
EntityConditionValue lhs = EntityFieldValue.makeFieldValue(this.fieldName, this.entityAlias, entityAliasStack, this.viewEntityCondition.modelViewEntity);
- if (this.viewEntityCondition.modelViewEntity.getField(fieldName) == null) {
+ ModelField lhsField = this.viewEntityCondition.modelViewEntity.getField(fieldName);
+ if (lhsField == null) {
throw new IllegalArgumentException("Error in Entity Find: could not find field [" + fieldName + "] in entity with name [" + this.viewEntityCondition.modelViewEntity.getEntityName() + "]");
}
@@ -1274,7 +1275,7 @@ public class ModelViewEntity extends Mod
if (!((operator.equals(EntityOperator.IN) || operator.equals(EntityOperator.BETWEEN))
&& value instanceof Collection<?>)) {
// now to a type conversion for the target fieldName
- value = this.viewEntityCondition.modelViewEntity.convertFieldValue(this.viewEntityCondition.modelViewEntity.getField(fieldName), value, modelFieldTypeReader, FastMap.<String, Object>newInstance());
+ value = this.viewEntityCondition.modelViewEntity.convertFieldValue(lhsField, value, modelFieldTypeReader, FastMap.<String, Object>newInstance());
}
if (Debug.verboseOn()) Debug.logVerbose("Got value for fieldName [" + fieldName + "]: " + value, module);