Remove unnecessary casts
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1044931 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+1
-1
@@ -150,7 +150,7 @@ public abstract class AbstractEntityConditionCache<K, V> extends AbstractCache<E
|
||||
protected List<? extends Map<String, Object>> convert(boolean isPK, String targetEntityName, GenericEntity entity) {
|
||||
if (isNull(entity)) return null;
|
||||
if (isPK) {
|
||||
return entity.getModelEntity().convertToViewValues(targetEntityName, (GenericPK) entity);
|
||||
return entity.getModelEntity().convertToViewValues(targetEntityName, entity);
|
||||
} else {
|
||||
return entity.getModelEntity().convertToViewValues(targetEntityName, entity);
|
||||
}
|
||||
|
||||
@@ -439,7 +439,7 @@ public class GenericDAO {
|
||||
}
|
||||
} else if (meResult.size() == 1) {
|
||||
// Update existing value
|
||||
meGenericValue = (GenericValue) meResult.iterator().next();
|
||||
meGenericValue = meResult.iterator().next();
|
||||
} else {
|
||||
throw new GenericEntityException("Found more than one result for member entity " + meName + " in view " + modelViewEntity.getEntityName() + " - this is no updatable view");
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ public class DatabaseUtil {
|
||||
|
||||
// -list all fields that do not have a corresponding column
|
||||
for (String colName: fieldColNames.keySet()) {
|
||||
ModelField field = (ModelField) fieldColNames.get(colName);
|
||||
ModelField field = fieldColNames.get(colName);
|
||||
String message = "Field [" + field.getName() + "] of entity [" + entity.getEntityName() + "] is missing its corresponding column [" + field.getColName() + "]" + (field.getIsPk() ? " (and it is a PRIMARY KEY FIELD)" : "");
|
||||
|
||||
Debug.logWarning(message, module);
|
||||
@@ -2105,7 +2105,7 @@ public class DatabaseUtil {
|
||||
String entityName = fieldInfo.substring(0, fieldInfo.indexOf('.'));
|
||||
String fieldName = fieldInfo.substring(fieldInfo.indexOf('.') + 1);
|
||||
|
||||
ModelEntity modelEntity = (ModelEntity) modelEntities.get(entityName);
|
||||
ModelEntity modelEntity = modelEntities.get(entityName);
|
||||
ModelField modelField = modelEntity.getField(fieldName);
|
||||
repairColumnSize(modelEntity, modelField, messages);
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ public class ModelReader implements Serializable {
|
||||
// all entity elements in, now go through extend-entity elements and add their stuff
|
||||
for (Element extendEntityElement: tempExtendEntityElementList) {
|
||||
String entityName = UtilXml.checkEmpty(extendEntityElement.getAttribute("entity-name"));
|
||||
ModelEntity modelEntity = (ModelEntity) entityCache.get(entityName);
|
||||
ModelEntity modelEntity = entityCache.get(entityName);
|
||||
if (modelEntity == null) throw new GenericEntityConfException("Entity to extend does not exist: " + entityName);
|
||||
modelEntity.addExtendEntity(this, extendEntityElement);
|
||||
}
|
||||
@@ -271,7 +271,7 @@ public class ModelReader implements Serializable {
|
||||
curViewEntity.populateFields(this);
|
||||
for (ModelViewEntity.ModelMemberEntity mve: curViewEntity.getAllModelMemberEntities()) {
|
||||
|
||||
ModelEntity me = (ModelEntity) entityCache.get(mve.getEntityName());
|
||||
ModelEntity me = entityCache.get(mve.getEntityName());
|
||||
if (me == null) throw new GenericEntityConfException("View " + curViewEntity.getEntityName() + " references non-existant entity: " + mve.getEntityName());
|
||||
me.addViewEntity(curViewEntity);
|
||||
}
|
||||
@@ -498,7 +498,7 @@ public class ModelReader implements Serializable {
|
||||
//put the entityNames TreeSets in a HashMap by packageName
|
||||
Iterator<String> ecIter = this.getEntityNames().iterator();
|
||||
while (ecIter.hasNext()) {
|
||||
String entityName = (String) ecIter.next();
|
||||
String entityName = ecIter.next();
|
||||
ModelEntity entity = this.getModelEntity(entityName);
|
||||
String packageName = entity.getPackageName();
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ public class EntityPlanner extends Planner<EntityPlanner, EntityCondition, Entit
|
||||
if (value instanceof FieldValue) {
|
||||
addFieldDef(dve, groupBy, fieldDef.getAlias(), (FieldValue) value, null);
|
||||
} else if (value instanceof ConstantValue) {
|
||||
addFieldDef(dve, groupBy, fieldDef.getAlias(), (ConstantValue) value);
|
||||
addFieldDef(dve, groupBy, fieldDef.getAlias(), value);
|
||||
} else {
|
||||
throw new UnsupportedOperationException(alias + "[" + fieldDef + "]:" + fieldDef.getClass());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user