Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void internalTransform(Body body, String phase, Map<String, String> options) {
- Iterator<Unit> i = body.getUnits().snapshotIterator();
- while (i.hasNext()) {
- Unit u = i.next();
- inspectUnit(u, body);
- }
- }
- private void inspectUnit(Unit u, final Body body) {
- u.apply(new AbstractStmtSwitch() {
- public void caseIfStmt(IfStmt stmt) {
- Unit branch1 = body.getUnits().getSuccOf(stmt);
- Unit branch2 = stmt.getTargetBox().getUnit();
- if (isBranchToForce(branch1)) {
- GotoStmt gotoStmt = Jimple.v().newGotoStmt(branch1);
- body.getUnits().insertBefore(gotoStmt, stmt);
- }
- }
- });
- body.validate();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement