/** Removes the given object from this Chain. */ @Override @SuppressWarnings("unchecked") public boolean remove(Object obj) { boolean res = false; if (contains(obj)) { Unit successor = getSuccOf((E) obj); if (successor == null) { successor = getPredOf((E) obj); } // Note that redirecting to the last unit in the method // like this is probably incorrect when dealing with a Trap. // I.e., let's say that the final unit in the method used to // be U10, preceded by U9, and that there was a Trap which // returned U10 as getEndUnit(). I.e., before the trap covered U9. // When we redirect the Trap's end unit to U9, the trap will no // longer cover U9. I know this is incorrect, but I'm not sure how // to fix it, so I'm leaving this comment in the hopes that some // future maintainer will see the right course to take. res = innerChain.remove(obj); ((E) obj).redirectJumpsToThisTo(successor); } return res; }
} else { ji = Baf.v().newJSRInst(tu); u.insertAfter(ji, u.getPredOf(tu)); ti.setTarget(ji);
Unit predOfTarget = null; try { predOfTarget = (Unit) units.getPredOf(target); } catch (NoSuchElementException e) { predOfTarget = null;
Unit pred = (Unit) list.getPredOf(u); if (!(pred instanceof JExitMonitorStmt)) { exceptionSet.add(c);
= sm.getActiveBody().getTraps().isEmpty() ? null : new HashMap<Unit, Collection<Trap>>(); for (Trap t : sm.getActiveBody().getTraps()) { for (Iterator<Unit> unitIt = units.iterator(t.getBeginUnit(), units.getPredOf(t.getEndUnit())); unitIt.hasNext();) { Unit unit = unitIt.next();
= units.iterator(secondReorderedUnit, units.getPredOf(caughtExceptionHandler)); Unit trapEndUnit = reorderedUnitsIterator.next(); while (trapEndUnit instanceof IdentityStmt && reorderedUnitsIterator.hasNext()) { body.getTraps().add(Jimple.v().newTrap(throwable.getSootClass(), units.getPredOf(firstReorderingNotGotoStmt), trapEndUnit, caughtExceptionHandler));
Unit predOfTarget = null; try { predOfTarget = units.getPredOf(target); } catch (NoSuchElementException e) { predOfTarget = null;
Unit secondLastStmt = units.getPredOf(units.getLast()); units.insertAfter(newUnits, secondLastStmt);
/** Removes the given object from this Chain. */ @SuppressWarnings("unchecked") public boolean remove(Object obj) { boolean res = false; if(contains(obj)) { Unit successor; if((successor = getSuccOf((E) obj)) == null) successor = getPredOf((E) obj); // Note that redirecting to the last unit in the method // like this is probably incorrect when dealing with a Trap. // I.e., let's say that the final unit in the method used to // be U10, preceded by U9, and that there was a Trap which // returned U10 as getEndUnit(). I.e., before the trap covered U9. // When we redirect the Trap's end unit to U9, the trap will no // longer cover U9. I know this is incorrect, but I'm not sure how // to fix it, so I'm leaving this comment in the hopes that some // future maintainer will see the right course to take. res = innerChain.remove(obj); ((E)obj).redirectJumpsToThisTo(successor); } return res; }
/** Removes the given object from this Chain. */ @SuppressWarnings("unchecked") public boolean remove(Object obj) { boolean res = false; if(contains(obj)) { Unit successor; if((successor = getSuccOf((E) obj)) == null) successor = getPredOf((E) obj); // Note that redirecting to the last unit in the method // like this is probably incorrect when dealing with a Trap. // I.e., let's say that the final unit in the method used to // be U10, preceded by U9, and that there was a Trap which // returned U10 as getEndUnit(). I.e., before the trap covered U9. // When we redirect the Trap's end unit to U9, the trap will no // longer cover U9. I know this is incorrect, but I'm not sure how // to fix it, so I'm leaving this comment in the hopes that some // future maintainer will see the right course to take. res = innerChain.remove(obj); ((E)obj).redirectJumpsToThisTo(successor); } return res; }