for (Iterator i = returns.iterator(); i.hasNext(); ) { InstructionHandle ih = (InstructionHandle) i.next(); Utility.replaceInstruction(ih, fact.createBranchInstruction(Constants.GOTO, gotoTarget), enclosingMethod); }
for (Iterator i = returns.iterator(); i.hasNext();) { InstructionHandle ih = (InstructionHandle) i.next(); Utility.replaceInstruction( ih, InstructionFactory.createBranchInstruction( Constants.GOTO, gotoTarget), enclosingMethod); }
    public void weaveAfterReturning(BcelAdvice munger) {        InstructionFactory fact = getFactory();        List returns = new ArrayList();        Instruction ret = null;        for (InstructionHandle ih = range.getStart(); ih != range.getEnd(); ih = ih.getNext()) {            if (ih.getInstruction() instanceof ReturnInstruction) {                returns.add(ih);                ret = Utility.copyInstruction(ih.getInstruction());            }        }        InstructionList retList;        InstructionHandle afterAdvice;        if (ret != null) {            retList = new InstructionList(ret);            afterAdvice = retList.getStart();        } else /* if (munger.hasDynamicTests()) */ {            retList = new InstructionList(fact.NOP);                        afterAdvice = retList.getStart();//        } else {//        	retList = new InstructionList();//        	afterAdvice = null;        }        InstructionList advice = new InstructionList();        BcelVar tempVar = null;        if (munger.hasExtraParameter()) {            TypeX tempVarType = getReturnType();            if (tempVarType.equals(ResolvedTypeX.VOID)) {            	tempVar = genTempVar(TypeX.OBJECT);            	advice.append(getFactory().ACONST_NULL);            	tempVar.appendStore(advice, getFactory());            } else {	            tempVar = genTempVar(tempVarType);	            advice.append(getFactory().createDup(tempVarType.getSize()));	            tempVar.appendStore(advice, getFactory());            }        }        advice.append(munger.getAdviceInstructions(this, tempVar, afterAdvice));                    if (ret != null) {            InstructionHandle gotoTarget = advice.getStart();                       for (Iterator i = returns.iterator(); i.hasNext(); ) {                InstructionHandle ih = (InstructionHandle) i.next();                Utility.replaceInstruction(ih, fact.createBranchInstruction(Constants.GOTO, gotoTarget), enclosingMethod);            }            range.append(advice);            range.append(retList);        } else {            range.append(advice);            range.append(retList);        }    }