/** * Redirect the handles from oldList to newList. "This" flow list * is assumed to be relative to oldList. */ public FlowList copyAndRedirect(InstructionList oldList, InstructionList newList) { final FlowList result = new FlowList(); if (_elements == null) { return result; } final int n = _elements.size(); final Iterator oldIter = oldList.iterator(); final Iterator newIter = newList.iterator(); while (oldIter.hasNext()) { final InstructionHandle oldIh = (InstructionHandle) oldIter.next(); final InstructionHandle newIh = (InstructionHandle) newIter.next(); for (int i = 0; i < n; i++) { if (_elements.elementAt(i) == oldIh) { result.add(newIh); } } } return result; } }
Iterator instructions = getInstructionList().iterator(); ArrayList candidateChunks = new ArrayList(); ArrayList currLevelChunks = new ArrayList();
Iterator<InstructionHandle> it = il.iterator(); while (it.hasNext()) { InstructionHandle ih = it.next();
continue; //No instruction .. nothing to do for (Iterator itIns = methodGen.getInstructionList().iterator();itIns.hasNext();) { Instruction inst = ((InstructionHandle) itIns.next()).getInstruction();
BitSet assertionBlocks = new BitSet(); MethodGen methodGen = cfg.getMethodGen(); Iterator<InstructionHandle> iterator = methodGen.getInstructionList().iterator(); while(iterator.hasNext()) { InstructionHandle ih = iterator.next();
/** * Redirect the handles from oldList to newList. "This" flow list * is assumed to be relative to oldList. */ public FlowList copyAndRedirect(InstructionList oldList, InstructionList newList) { final FlowList result = new FlowList(); if (_elements == null) { return result; } final int n = _elements.size(); final Iterator oldIter = oldList.iterator(); final Iterator newIter = newList.iterator(); while (oldIter.hasNext()) { final InstructionHandle oldIh = (InstructionHandle) oldIter.next(); final InstructionHandle newIh = (InstructionHandle) newIter.next(); for (int i = 0; i < n; i++) { if (_elements.elementAt(i) == oldIh) { result.add(newIh); } } } return result; } }
/** * Redirect the handles from oldList to newList. "This" flow list * is assumed to be relative to oldList. */ public FlowList copyAndRedirect(InstructionList oldList, InstructionList newList) { final FlowList result = new FlowList(); if (_elements == null) { return result; } final int n = _elements.size(); final Iterator oldIter = oldList.iterator(); final Iterator newIter = newList.iterator(); while (oldIter.hasNext()) { final InstructionHandle oldIh = (InstructionHandle) oldIter.next(); final InstructionHandle newIh = (InstructionHandle) newIter.next(); for (int i = 0; i < n; i++) { if (_elements.elementAt(i) == oldIh) { result.add(newIh); } } } return result; } }
/** * Redirect the handles from oldList to newList. "This" flow list * is assumed to be relative to oldList. */ public FlowList copyAndRedirect(InstructionList oldList, InstructionList newList) { final FlowList result = new FlowList(); if (_elements == null) { return result; } final int n = _elements.size(); final Iterator oldIter = oldList.iterator(); final Iterator newIter = newList.iterator(); while (oldIter.hasNext()) { final InstructionHandle oldIh = (InstructionHandle) oldIter.next(); final InstructionHandle newIh = (InstructionHandle) newIter.next(); for (int i = 0; i < n; i++) { if (_elements.elementAt(i) == oldIh) { result.add(newIh); } } } return result; } }
/** * Currently the detection is pretty weak. * It will catch Dummy implementation that have empty method implementation * * @return If the implementation is "empty" (direct return or dummy code) */ private boolean isEmptyImplementation(MethodGen methodGen){ boolean invokeInst = false; boolean loadField = false; for (Iterator itIns = methodGen.getInstructionList().iterator();itIns.hasNext();) { Instruction inst = ((InstructionHandle) itIns.next()).getInstruction(); if (DEBUG) System.out.println(inst.toString(true)); if (inst instanceof InvokeInstruction) { invokeInst = true; } if (inst instanceof GETFIELD) { loadField = true; } } return !invokeInst && !loadField; }
/** * Currently the detection is pretty weak. * It will catch Dummy implementation that have empty method implementation * * @return If the implementation is "empty" (direct return or dummy code) */ private boolean isEmptyImplementation(MethodGen methodGen){ boolean invokeInst = false; boolean loadField = false; for (Iterator itIns = methodGen.getInstructionList().iterator();itIns.hasNext();) { Instruction inst = ((InstructionHandle) itIns.next()).getInstruction(); if (DEBUG) System.out.println(inst.toString(true)); if (inst instanceof InvokeInstruction) { invokeInst = true; } if (inst instanceof GETFIELD) { loadField = true; } } return !invokeInst && !loadField; }
Iterator instructions = getInstructionList().iterator(); ArrayList candidateChunks = new ArrayList(); ArrayList currLevelChunks = new ArrayList();
Iterator instructions = getInstructionList().iterator(); ArrayList candidateChunks = new ArrayList(); ArrayList currLevelChunks = new ArrayList();
Iterator instructions = getInstructionList().iterator(); ArrayList candidateChunks = new ArrayList(); ArrayList currLevelChunks = new ArrayList();
Iterator<InstructionHandle> it = il.iterator(); while (it.hasNext()) { InstructionHandle ih = it.next();
continue; //No instruction .. nothing to do for (Iterator itIns = methodGen.getInstructionList().iterator();itIns.hasNext();) { Instruction inst = ((InstructionHandle) itIns.next()).getInstruction();
BitSet assertionBlocks = new BitSet(); MethodGen methodGen = cfg.getMethodGen(); Iterator<InstructionHandle> iterator = methodGen.getInstructionList().iterator(); while(iterator.hasNext()) { InstructionHandle ih = iterator.next();