Program: 88152
Project: 88152
Buggy source:
/** 
 * Registers the given task with the byte buffered channel manager.
 * @param vertexID the ID of the task to be registered
 * @param environment the environment of the task
 * @param the set of output channels which are initially active
 */
public void register(final ExecutionVertexID vertexID,final Environment environment,final Set<ChannelID> activeOutputChannels){
  final TaskContext taskContext=new TaskContext();
synchronized (this.registeredChannels) {
    for (int i=0; i < environment.getNumberOfOutputGates(); ++i) {
      final OutputGate<?> outputGate=environment.getOutputGate(i);
      final OutputGateContext outputGateContext=new OutputGateContext(taskContext,outputGate,this,this.fileBufferManager);
      for (int j=0; j < outputGate.getNumberOfOutputChannels(); ++j) {
        final AbstractOutputChannel<?> outputChannel=outputGate.getOutputChannel(j);
        if (!(outputChannel instanceof AbstractByteBufferedOutputChannel)) {
          LOG.error("String_Node_Str" + outputChannel.getID() + "String_Node_Str"+ environment.getJobID()+ "String_Node_Str");
          continue;
        }
        final AbstractByteBufferedOutputChannel<?> bboc=(AbstractByteBufferedOutputChannel<?>)outputChannel;
        if (this.registeredChannels.containsKey(bboc.getID())) {
          LOG.error("String_Node_Str" + bboc.getID() + "String_Node_Str");
          continue;
        }
        LOG.info("String_Node_Str" + bboc.getID());
        final OutputChannelContext outputChannelContext=new OutputChannelContext(outputGateContext,bboc,activeOutputChannels.contains(bboc.getID()));
        this.registeredChannels.put(bboc.getID(),outputChannelContext);
      }
    }
    for (int i=0; i < environment.getNumberOfInputGates(); ++i) {
      final InputGate<?> inputGate=environment.getInputGate(i);
      final InputGateContext inputGateContext=new InputGateContext(taskContext);
      for (int j=0; j < inputGate.getNumberOfInputChannels(); ++j) {
        final AbstractInputChannel<?> inputChannel=inputGate.getInputChannel(j);
        if (!(inputChannel instanceof AbstractByteBufferedInputChannel)) {
          LOG.error("String_Node_Str" + inputChannel.getID() + "String_Node_Str"+ environment.getJobID()+ "String_Node_Str");
          continue;
        }
        final AbstractByteBufferedInputChannel<?> bbic=(AbstractByteBufferedInputChannel<?>)inputChannel;
        if (this.registeredChannels.containsKey(bbic.getID())) {
          LOG.error("String_Node_Str" + bbic.getID() + "String_Node_Str");
          continue;
        }
        LOG.info("String_Node_Str" + bbic.getID());
        final InputChannelContext inputChannelContext=new InputChannelContext(inputGateContext,this,bbic);
        this.registeredChannels.put(bbic.getID(),inputChannelContext);
      }
    }
  }
synchronized (this.taskMap) {
    this.taskMap.put(vertexID,taskContext);
  }
  redistributeGlobalBuffers();
}

Fixed version (ground truth):
/** 
 * Registers the given task with the byte buffered channel manager.
 * @param vertexID the ID of the task to be registered
 * @param environment the environment of the task
 * @param the set of output channels which are initially active
 */
public void register(final ExecutionVertexID vertexID,final Environment environment,final Set<ChannelID> activeOutputChannels){
  final TaskContext taskContext=new TaskContext();
synchronized (this.registeredChannels) {
    for (int i=0; i < environment.getNumberOfOutputGates(); ++i) {
      final OutputGate<?> outputGate=environment.getOutputGate(i);
      final OutputGateContext outputGateContext=new OutputGateContext(taskContext,outputGate,this,this.fileBufferManager);
      for (int j=0; j < outputGate.getNumberOfOutputChannels(); ++j) {
        final AbstractOutputChannel<?> outputChannel=outputGate.getOutputChannel(j);
        if (!(outputChannel instanceof AbstractByteBufferedOutputChannel)) {
          LOG.error("String_Node_Str" + outputChannel.getID() + "String_Node_Str"+ environment.getJobID()+ "String_Node_Str");
          continue;
        }
        final AbstractByteBufferedOutputChannel<?> bboc=(AbstractByteBufferedOutputChannel<?>)outputChannel;
        if (this.registeredChannels.containsKey(bboc.getID())) {
          LOG.error("String_Node_Str" + bboc.getID() + "String_Node_Str");
          continue;
        }
        final boolean isActive=activeOutputChannels.contains(bboc.getID());
        LOG.info("String_Node_Str" + bboc.getID() + "String_Node_Str"+ (isActive ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
        final OutputChannelContext outputChannelContext=new OutputChannelContext(outputGateContext,bboc,isActive);
        this.registeredChannels.put(bboc.getID(),outputChannelContext);
      }
    }
    for (int i=0; i < environment.getNumberOfInputGates(); ++i) {
      final InputGate<?> inputGate=environment.getInputGate(i);
      final InputGateContext inputGateContext=new InputGateContext(taskContext);
      for (int j=0; j < inputGate.getNumberOfInputChannels(); ++j) {
        final AbstractInputChannel<?> inputChannel=inputGate.getInputChannel(j);
        if (!(inputChannel instanceof AbstractByteBufferedInputChannel)) {
          LOG.error("String_Node_Str" + inputChannel.getID() + "String_Node_Str"+ environment.getJobID()+ "String_Node_Str");
          continue;
        }
        final AbstractByteBufferedInputChannel<?> bbic=(AbstractByteBufferedInputChannel<?>)inputChannel;
        if (this.registeredChannels.containsKey(bbic.getID())) {
          LOG.error("String_Node_Str" + bbic.getID() + "String_Node_Str");
          continue;
        }
        LOG.info("String_Node_Str" + bbic.getID());
        final InputChannelContext inputChannelContext=new InputChannelContext(inputGateContext,this,bbic);
        this.registeredChannels.put(bbic.getID(),inputChannelContext);
      }
    }
  }
synchronized (this.taskMap) {
    this.taskMap.put(vertexID,taskContext);
  }
  redistributeGlobalBuffers();
}