if (value instanceof CastExpr) {
// If the cast is to the same type as the
// operand already is, then replace with
// simple assignment.
CastExpr expr = (CastExpr) value;
Type castType = expr.getCastType();
Value op = expr.getOp();
Type opType = op.getType();
// // Skip locals that are unsafe.
// if (castType.equals(opType) &&
// !unsafeLocalSet.contains(op)) {
// box.setValue(op);
// }
if (unsafeLocalSet.contains(op)) {
continue;
}
Hierarchy hierarchy = Scene.v().getActiveHierarchy();
// if (debug) System.out.println("checking cast in " + unit);
// if (debug) System.out.println("op = " + op);
// if (debug) System.out.println("opType = " + opType);
replaceCast(box, hierarchy, castType, op, opType, debug);
} else if (value instanceof InstanceOfExpr) {
// If the operand of the expression is
// declared to be of a type that implies
// the instanceof is true, then replace
// with true.
InstanceOfExpr expr = (InstanceOfExpr) value;
Type checkType = expr.getCheckType();
Value op = expr.getOp();
Type opType = op.getType();
// Skip locals that are unsafe.
if (unsafeLocalSet.contains(op)) {
continue;
}