Program: 87739
Project: 87739
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public OutputChannelContext createOutputChannelContext(ChannelID channelID,OutputChannelContext previousContext,boolean isReceiverRunning,boolean mergeSpillBuffers){
  if (previousContext != null) {
    throw new IllegalStateException("String_Node_Str" + channelID);
  }
  AbstractOutputChannel<? extends Record> channel=null;
  for (int i=0; i < this.outputGate.getNumberOfOutputChannels(); ++i) {
    AbstractOutputChannel<? extends Record> candidateChannel=this.outputGate.getOutputChannel(i);
    if (candidateChannel.getID().equals(channelID)) {
      channel=candidateChannel;
      break;
    }
  }
  if (channel == null) {
    throw new IllegalArgumentException("String_Node_Str" + channelID);
  }
  if (!(channel instanceof AbstractByteBufferedOutputChannel)) {
    throw new IllegalStateException("String_Node_Str" + channelID + "String_Node_Str");
  }
  AbstractByteBufferedOutputChannel<? extends Record> outputChannel=(AbstractByteBufferedOutputChannel<? extends Record>)channel;
  final RuntimeDispatcher runtimeDispatcher=new RuntimeDispatcher(this.taskContext.getTransferEnvelopeDispatcher());
  final SpillingBarrier spillingBarrier=new SpillingBarrier(isReceiverRunning,mergeSpillBuffers,runtimeDispatcher);
  final ForwardingBarrier forwardingBarrier=new ForwardingBarrier(channelID,spillingBarrier);
  final EphemeralCheckpoint checkpoint=this.taskContext.getEphemeralCheckpoint();
  RuntimeOutputChannelBroker outputChannelBroker;
  if (checkpoint != null) {
    final EphemeralCheckpointForwarder checkpointForwarder=new EphemeralCheckpointForwarder(checkpoint,forwardingBarrier);
    outputChannelBroker=new RuntimeOutputChannelBroker(this,outputChannel,checkpointForwarder);
  }
 else {
    outputChannelBroker=new RuntimeOutputChannelBroker(this,outputChannel,forwardingBarrier);
  }
  final OutputChannelForwardingChain forwardingChain=new OutputChannelForwardingChain(outputChannelBroker,runtimeDispatcher);
  outputChannelBroker.setForwardingChain(forwardingChain);
  return new RuntimeOutputChannelContext(outputChannel,forwardingChain);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public OutputChannelContext createOutputChannelContext(ChannelID channelID,OutputChannelContext previousContext,boolean isReceiverRunning,boolean mergeSpillBuffers){
  if (previousContext != null) {
    throw new IllegalStateException("String_Node_Str" + channelID);
  }
  AbstractOutputChannel<? extends Record> channel=null;
  for (int i=0; i < this.outputGate.getNumberOfOutputChannels(); ++i) {
    AbstractOutputChannel<? extends Record> candidateChannel=this.outputGate.getOutputChannel(i);
    if (candidateChannel.getID().equals(channelID)) {
      channel=candidateChannel;
      break;
    }
  }
  if (channel == null) {
    throw new IllegalArgumentException("String_Node_Str" + channelID);
  }
  if (!(channel instanceof AbstractByteBufferedOutputChannel)) {
    throw new IllegalStateException("String_Node_Str" + channelID + "String_Node_Str");
  }
  final AbstractByteBufferedOutputChannel<? extends Record> outputChannel=(AbstractByteBufferedOutputChannel<? extends Record>)channel;
  RuntimeOutputChannelBroker outputChannelBroker;
  AbstractOutputChannelForwarder last;
  if (outputChannel.getType() == ChannelType.FILE) {
    final EphemeralCheckpoint checkpoint=this.taskContext.getEphemeralCheckpoint();
    if (checkpoint == null) {
      throw new IllegalStateException("String_Node_Str" + outputChannel.getID());
    }
    final EphemeralCheckpointForwarder checkpointForwarder=new EphemeralCheckpointForwarder(checkpoint,null);
    outputChannelBroker=new RuntimeOutputChannelBroker(this,outputChannel,checkpointForwarder);
    last=checkpointForwarder;
  }
 else {
    final RuntimeDispatcher runtimeDispatcher=new RuntimeDispatcher(this.taskContext.getTransferEnvelopeDispatcher());
    final SpillingBarrier spillingBarrier=new SpillingBarrier(isReceiverRunning,mergeSpillBuffers,runtimeDispatcher);
    final ForwardingBarrier forwardingBarrier=new ForwardingBarrier(channelID,spillingBarrier);
    final EphemeralCheckpoint checkpoint=this.taskContext.getEphemeralCheckpoint();
    if (checkpoint != null) {
      final EphemeralCheckpointForwarder checkpointForwarder=new EphemeralCheckpointForwarder(checkpoint,forwardingBarrier);
      outputChannelBroker=new RuntimeOutputChannelBroker(this,outputChannel,checkpointForwarder);
    }
 else {
      outputChannelBroker=new RuntimeOutputChannelBroker(this,outputChannel,forwardingBarrier);
    }
    last=runtimeDispatcher;
  }
  final OutputChannelForwardingChain forwardingChain=new OutputChannelForwardingChain(outputChannelBroker,last);
  outputChannelBroker.setForwardingChain(forwardingChain);
  return new RuntimeOutputChannelContext(outputChannel,forwardingChain);
}