// 利用しない入力は削除
Iterator<FlowBlock.Input> inputs = blockInputs.iterator();
while (inputs.hasNext()) {
FlowBlock.Input port = inputs.next();
FlowElement element = port.getElementPort().getOwner();
if (FlowGraphUtil.hasSuccessors(element) == false
&& FlowGraphUtil.hasMandatorySideEffect(element) == false
&& outputElements.contains(element) == false) {
LOG.debug("Deleting unnecessary input: {} on {}", port, this);
port.disconnect();
inputs.remove();
changed = true;
} else {
inputElements.add(element);
}
}
// 利用しない出力は削除
Iterator<FlowBlock.Output> outputs = blockOutputs.iterator();
while (outputs.hasNext()) {
FlowBlock.Output port = outputs.next();
FlowElement element = port.getElementPort().getOwner();
if (FlowGraphUtil.hasPredecessors(element) == false
&& inputElements.contains(element) == false) {
LOG.debug("Deleting unnecessary output: {} on {}", port, this);
port.disconnect();
outputs.remove();