private ControlFlowEdge createEdge(final ControlFlowNode fromNode, final ControlFlowNode toNode, final JumpType type) { final ControlFlowEdge edge = new ControlFlowEdge(fromNode, toNode, type); for (final ControlFlowEdge existingEdge : fromNode.getOutgoing()) { if (existingEdge.getSource() == fromNode && existingEdge.getTarget() == toNode && existingEdge.getType() == type) { return existingEdge; } } fromNode.getOutgoing().add(edge); toNode.getIncoming().add(edge); return edge; }
public final boolean succeeds(final ControlFlowNode other) { if (other == null) { return false; } for (int i = 0; i < _incoming.size(); i++) { if (_incoming.get(i).getSource() == other) { return true; } } return false; }
if (edge.getSource() == successor) { continue; if (edge.getType() == JumpType.Normal && edge.getSource().getNodeType() == ControlFlowNodeType.Normal && !exitOnlySuccessors.contains(successor)) { toProcess.add(edge.getSource()); else if (edge.getType() == JumpType.JumpToExceptionHandler && edge.getSource().getNodeType() == ControlFlowNodeType.Normal && (edge.getSource().getEnd().getOpCode().isThrow() || edge.getSource().getEnd().getOpCode().isReturn())) { toProcess.add(edge.getSource()); exitOnlySuccessors.add(edge.getSource()); else if (edge.getSource().getNodeType() == ControlFlowNodeType.CatchHandler) { final ControlFlowNode endCatch = findNode( cfg, edge.getSource().getExceptionHandler().getHandlerBlock().getLastInstruction() ); else if (edge.getSource().getNodeType() == ControlFlowNodeType.FinallyHandler) { successors.add(edge.getSource()); exitOnlySuccessors.add(edge.getSource()); else if (edge.getSource().getNodeType() == ControlFlowNodeType.EndFinally) {
@Override public final ControlFlowNode next() { if (_innerIterator == null) { _innerIterator = _outgoing.listIterator(); } return _innerIterator.next().getTarget(); }
private ControlFlowEdge createEdge(final ControlFlowNode fromNode, final ControlFlowNode toNode, final JumpType type) { final ControlFlowEdge edge = new ControlFlowEdge(fromNode, toNode, type); fromNode.getOutgoing().add(edge); toNode.getIncoming().add(edge); return edge; }
public final boolean succeeds(final ControlFlowNode other) { if (other == null) { return false; } for (int i = 0; i < _incoming.size(); i++) { if (_incoming.get(i).getSource() == other) { return true; } } return false; }
if (edge.getSource() == successor) { continue; if (edge.getType() == JumpType.Normal && edge.getSource().getNodeType() == ControlFlowNodeType.Normal && !exitOnlySuccessors.contains(successor)) { toProcess.add(edge.getSource()); else if (edge.getType() == JumpType.JumpToExceptionHandler && edge.getSource().getNodeType() == ControlFlowNodeType.Normal && (edge.getSource().getEnd().getOpCode().isThrow() || edge.getSource().getEnd().getOpCode().isReturn())) { toProcess.add(edge.getSource()); exitOnlySuccessors.add(edge.getSource()); else if (edge.getSource().getNodeType() == ControlFlowNodeType.CatchHandler) { final ControlFlowNode endCatch = findNode( cfg, edge.getSource().getExceptionHandler().getHandlerBlock().getLastInstruction() ); else if (edge.getSource().getNodeType() == ControlFlowNodeType.FinallyHandler) { successors.add(edge.getSource()); exitOnlySuccessors.add(edge.getSource()); else if (edge.getSource().getNodeType() == ControlFlowNodeType.EndFinally) {
public final boolean precedes(final ControlFlowNode other) { if (other == null) { return false; } for (int i = 0; i < _outgoing.size(); i++) { if (_outgoing.get(i).getTarget() == other) { return true; } } return false; }
private ControlFlowEdge createEdge(final ControlFlowNode fromNode, final ControlFlowNode toNode, final JumpType type) { final ControlFlowEdge edge = new ControlFlowEdge(fromNode, toNode, type); fromNode.getOutgoing().add(edge); toNode.getIncoming().add(edge); return edge; }
private ControlFlowEdge createEdge(final ControlFlowNode fromNode, final ControlFlowNode toNode, final JumpType type) { final ControlFlowEdge edge = new ControlFlowEdge(fromNode, toNode, type); for (final ControlFlowEdge existingEdge : fromNode.getOutgoing()) { if (existingEdge.getSource() == fromNode && existingEdge.getTarget() == toNode && existingEdge.getType() == type) { return existingEdge; } } fromNode.getOutgoing().add(edge); toNode.getIncoming().add(edge); return edge; }
@Override public final ControlFlowNode next() { if (_innerIterator == null) { _innerIterator = _incoming.listIterator(); } return _innerIterator.next().getSource(); }
if (edge.getSource() == successor) { continue; if (edge.getType() == JumpType.Normal && edge.getSource().getNodeType() == ControlFlowNodeType.Normal && !exitOnlySuccessors.contains(successor)) { toProcess.add(edge.getSource()); else if (edge.getType() == JumpType.JumpToExceptionHandler && edge.getSource().getNodeType() == ControlFlowNodeType.Normal && (edge.getSource().getEnd().getOpCode().isThrow() || edge.getSource().getEnd().getOpCode().isReturn())) { toProcess.add(edge.getSource()); exitOnlySuccessors.add(edge.getSource()); else if (edge.getSource().getNodeType() == ControlFlowNodeType.CatchHandler) { final ControlFlowNode endCatch = findNode( cfg, edge.getSource().getExceptionHandler().getHandlerBlock().getLastInstruction() ); else if (edge.getSource().getNodeType() == ControlFlowNodeType.FinallyHandler) { successors.add(edge.getSource()); exitOnlySuccessors.add(edge.getSource()); else if (edge.getSource().getNodeType() == ControlFlowNodeType.EndFinally) {
public final boolean precedes(final ControlFlowNode other) { if (other == null) { return false; } for (int i = 0; i < _outgoing.size(); i++) { if (_outgoing.get(i).getTarget() == other) { return true; } } return false; }
private ControlFlowEdge createEdge(final ControlFlowNode fromNode, final ControlFlowNode toNode, final JumpType type) { final ControlFlowEdge edge = new ControlFlowEdge(fromNode, toNode, type); fromNode.getOutgoing().add(edge); toNode.getIncoming().add(edge); return edge; }