Program: 55575
Project: 55575
Buggy source:
private void replayCheckpoint() throws Exception {
  System.out.println("String_Node_Str" + this.vertexID);
  final CheckpointDeserializer deserializer=new CheckpointDeserializer(this.vertexID);
  final Path checkpointPath=this.isCheckpointLocal ? CheckpointUtils.getLocalCheckpointPath() : CheckpointUtils.getDistributedCheckpointPath();
  if (checkpointPath == null) {
    throw new IOException("String_Node_Str" + this.vertexID);
  }
  final FileSystem fileSystem=checkpointPath.getFileSystem();
  int metaDataIndex=0;
  while (true) {
    if (this.restartRequested.compareAndSet(true,false)) {
      metaDataIndex=0;
    }
    final Path metaDataFile=checkpointPath.suffix(Path.SEPARATOR + CheckpointUtils.METADATA_PREFIX + "String_Node_Str"+ this.vertexID+ "String_Node_Str"+ metaDataIndex);
    while (!fileSystem.exists(metaDataFile)) {
      final Path finalMetaDataFile=checkpointPath.suffix(Path.SEPARATOR + CheckpointUtils.METADATA_PREFIX + "String_Node_Str"+ this.vertexID+ "String_Node_Str");
      if (fileSystem.exists(finalMetaDataFile)) {
        return;
      }
      if (this.isCheckpointComplete) {
        throw new FileNotFoundException("String_Node_Str" + metaDataIndex + "String_Node_Str"+ this.vertexID);
      }
      Thread.sleep(100);
    }
    FileChannel fileChannel=null;
    try {
      fileChannel=getFileChannel(fileSystem,metaDataFile);
      while (true) {
        try {
          deserializer.read(fileChannel);
          final TransferEnvelope transferEnvelope=deserializer.getFullyDeserializedTransferEnvelope();
          if (transferEnvelope != null) {
            final ReplayOutputBroker broker=this.outputBrokerMap.get(transferEnvelope.getSource());
            if (broker == null) {
              throw new IOException("String_Node_Str" + transferEnvelope.getSource());
            }
            final Buffer srcBuffer=transferEnvelope.getBuffer();
            if (srcBuffer != null) {
              final Buffer destBuffer=broker.requestEmptyBufferBlocking(srcBuffer.size());
              srcBuffer.copyToBuffer(destBuffer);
              transferEnvelope.setBuffer(destBuffer);
              srcBuffer.recycleBuffer();
            }
            broker.outputEnvelope(transferEnvelope);
          }
        }
 catch (        EOFException eof) {
          fileChannel.close();
          ++metaDataIndex;
          break;
        }
      }
    }
  finally {
      if (fileChannel != null) {
        fileChannel.close();
      }
    }
  }
}

Fixed version (ground truth):
private void replayCheckpoint() throws Exception {
  final CheckpointDeserializer deserializer=new CheckpointDeserializer(this.vertexID);
  final Path checkpointPath=this.isCheckpointLocal ? CheckpointUtils.getLocalCheckpointPath() : CheckpointUtils.getDistributedCheckpointPath();
  if (checkpointPath == null) {
    throw new IOException("String_Node_Str" + this.vertexID);
  }
  final FileSystem fileSystem=checkpointPath.getFileSystem();
  int metaDataIndex=0;
  while (true) {
    if (this.restartRequested.compareAndSet(true,false)) {
      metaDataIndex=0;
    }
    final Path metaDataFile=checkpointPath.suffix(Path.SEPARATOR + CheckpointUtils.METADATA_PREFIX + "String_Node_Str"+ this.vertexID+ "String_Node_Str"+ metaDataIndex);
    while (!fileSystem.exists(metaDataFile)) {
      final Path finalMetaDataFile=checkpointPath.suffix(Path.SEPARATOR + CheckpointUtils.METADATA_PREFIX + "String_Node_Str"+ this.vertexID+ "String_Node_Str");
      if (fileSystem.exists(finalMetaDataFile)) {
        return;
      }
      if (this.isCheckpointComplete) {
        throw new FileNotFoundException("String_Node_Str" + metaDataIndex + "String_Node_Str"+ this.vertexID);
      }
      Thread.sleep(100);
    }
    FileChannel fileChannel=null;
    try {
      fileChannel=getFileChannel(fileSystem,metaDataFile);
      while (true) {
        try {
          deserializer.read(fileChannel);
          final TransferEnvelope transferEnvelope=deserializer.getFullyDeserializedTransferEnvelope();
          if (transferEnvelope != null) {
            final ReplayOutputBroker broker=this.outputBrokerMap.get(transferEnvelope.getSource());
            if (broker == null) {
              throw new IOException("String_Node_Str" + transferEnvelope.getSource());
            }
            final Buffer srcBuffer=transferEnvelope.getBuffer();
            if (srcBuffer != null) {
              final Buffer destBuffer=broker.requestEmptyBufferBlocking(srcBuffer.size());
              srcBuffer.copyToBuffer(destBuffer);
              transferEnvelope.setBuffer(destBuffer);
              srcBuffer.recycleBuffer();
            }
            broker.outputEnvelope(transferEnvelope);
          }
        }
 catch (        EOFException eof) {
          fileChannel.close();
          ++metaDataIndex;
          break;
        }
      }
    }
  finally {
      if (fileChannel != null) {
        fileChannel.close();
      }
    }
  }
}