@Override protected void setHeads(@Nonnull Collection<FlowNode> heads) { Iterator<FlowNode> it = heads.iterator(); if (it.hasNext()) { this.myCurrent = jumpBlockScan(it.next(), myBlackList); this.myNext = this.myCurrent; if (it.hasNext()) { LOGGER.log(Level.WARNING, null, new IllegalArgumentException("Multiple heads not supported for linear scanners")); } } }
@Override protected FlowNode next(@Nonnull FlowNode current, @Nonnull Collection<FlowNode> blackList) { if (current == null) { return null; } List<FlowNode> parents = current.getParents(); if (parents != null && parents.size() > 0) { for (FlowNode f : parents) { if (!blackList.contains(f)) { return (f instanceof BlockEndNode) ? jumpBlockScan(f, blackList) : f; } } } return null; } }