- mincBody.getUnits().remove(((JimpleBody)mincBody).getFirstNonIdentityStmt());
- mincBody.getUnits().remove(((JimpleBody)mincBody).getFirstNonIdentityStmt());
+
+ for(Iterator it2 = mincBody.getUnits().snapshotIterator(); it2.hasNext(); ) {
+ Unit u = (Unit)it2.next();
+ if (u instanceof DefinitionStmt) {
+ DefinitionStmt ds = (DefinitionStmt)u;
+ if (ds.getLeftOp() instanceof ThisRef)
+ mincBody.getUnits().remove(u);
+ else if (ds.getLeftOp() instanceof FieldRef) {
+ if (((FieldRef)ds.getLeftOp()).getFieldRef().name().endsWith("this$0"))
+ mincBody.getUnits().remove(u);
+ }
+ } else if (u instanceof InvokeStmt) {
+ InvokeExpr ie = ((InvokeStmt)u).getInvokeExpr();
+ SootMethodRef meth = ie.getMethodRef();
+ if (meth.declaringClass().getName().equals("java.lang.Object") && meth.name().equals("<init>"))
+ mincBody.getUnits().remove(u);
+ }
+ }
+