boolean (Statement statement) { Statement splitnode = getCandidateForSplitting(statement); if (splitnode == null) { return false; } StatEdge enteredge = splitnode.getPredecessorEdges(EdgeType.REGULAR).iterator().next(); // copy the smallest statement Statement splitcopy = copyStatement(splitnode, null, new HashMap<>()); initCopiedStatement(splitcopy); // insert the copy splitcopy.setParent(statement); statement.getStats().addWithKey(splitcopy, splitcopy.id); // switch input edges for (StatEdge prededge : splitnode.getPredecessorEdges(EdgeType.DIRECT_ALL)) { if (prededge.getSource() == enteredge.getSource() || prededge.closure == enteredge.getSource()) { splitnode.removePredecessor(prededge); prededge.getSource().changeEdgeNode(EdgeDirection.FORWARD, prededge, splitcopy); splitcopy.addPredecessor(prededge); } } // connect successors for (StatEdge succ : splitnode.getSuccessorEdges(EdgeType.DIRECT_ALL)) { splitcopy.addSuccessor(new StatEdge(succ.getType(), splitcopy, succ.getDestination(), succ.closure)); } return true; }