} else {
castLocal = Jimple.v().newLocal("local_" + name, type);
body.getLocals().add(castLocal);
// Cast the local to the type of the field.
units.insertAfter(Jimple.v().newAssignStmt(castLocal,
Jimple.v().newCastExpr(local, type)), insertPoint);
insertPoint = (Unit) body.getUnits().getSuccOf(insertPoint);
}
// Create the new field if necessary