Author: doogie
Date: Wed May 26 14:22:40 2010
New Revision: 948443
URL:
http://svn.apache.org/viewvc?rev=948443&view=revLog:
Always set memberModelEntities; there's no reason to check for null, as
the population methods always get called during construction anways.
This was discovered while looking at code coverage.
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=948443&r1=948442&r2=948443&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 Wed May 26 14:22:40 2010
@@ -75,7 +75,7 @@ public class ModelViewEntity extends Mod
protected List<ModelMemberEntity> allModelMemberEntities = FastList.newInstance();
/** Contains member-entity ModelEntities: key is alias, value is ModelEntity; populated with fields */
- protected Map<String, String> memberModelEntities = null;
+ protected Map<String, String> memberModelEntities = FastMap.newInstance();
/** List of alias-alls which act as a shortcut for easily pulling over member entity fields */
protected List<ModelAliasAll> aliasAlls = FastList.newInstance();
@@ -190,10 +190,6 @@ public class ModelViewEntity extends Mod
}
public ModelEntity getMemberModelEntity(String alias) {
- if (this.memberModelEntities == null) {
- this.memberModelEntities = FastMap.newInstance();
- populateFields(this.getModelReader());
- }
String entityName = this.memberModelEntities.get(alias);
return entityName != null ? this.getModelReader().getModelEntityNoCheck(entityName) : null;
}
@@ -397,10 +393,6 @@ public class ModelViewEntity extends Mod
}
public void populateFieldsBasic(ModelReader modelReader) {
- if (this.memberModelEntities == null) {
- this.memberModelEntities = FastMap.newInstance();
- }
-
for (Map.Entry<String, ModelMemberEntity> entry: memberModelMemberEntities.entrySet()) {
ModelMemberEntity modelMemberEntity = entry.getValue();