Jimple.v().newAssignStmt(
local,
Jimple.v().newCastExpr(entityLocal,
PtolemyUtilities.componentEntityType)));
SootField field = SootUtilities.createAndSetFieldFromLocal(
body, local, modelClass, RefType.v(className),
entityFieldName);
field.addTag(new ValueTag(entity));
_ports(body, thisLocal, composite, local, entity, modelClass,
objectNameToCreatorName, false);
} else {
// System.out.println("Creating new!");
// Create a new local variable. The name of the local is
// determined automatically. The name of the NamedObj is
// the same as in the model. (Note that this might not be
// a valid Java identifier.)
local = PtolemyUtilities.createNamedObjAndLocal(body,
className, thisLocal, entity.getName());
//Entity classEntity = (Entity) _findDeferredInstance(entity);
// This class assumes that any entity that is created creates
// all stuff inside it.
updateCreatedSet(composite.getFullName() + "."
+ entity.getName(), entity, entity,
objectNameToCreatorName);
SootField field = SootUtilities.createAndSetFieldFromLocal(
body, local, modelClass, RefType.v(className),
entityFieldName);
field.addTag(new ValueTag(entity));
_ports(body, containerLocal, container, local, entity,
modelClass, objectNameToCreatorName, false);
// }