Program: 13737
Project: 13737
Buggy source:
public static String downloadGFF(TaskInputOutputContext context,String id) throws IOException, URISyntaxException {
  Configuration conf=context.getConfiguration();
  String refDir=HalvadeConf.getRefDirOnScratch(conf);
  String gff=HalvadeConf.getGff(context.getConfiguration());
  if (gff == null)   return null;
  if (!refDir.endsWith("String_Node_Str"))   refDir=refDir + "String_Node_Str";
  HalvadeFileLock lock=new HalvadeFileLock(context,refDir,GFF_LOCK);
  String gffFile=null;
  String gffSuffix=null;
  try {
    lock.getLock();
    ByteBuffer bytes=ByteBuffer.allocate(4);
    if (lock.read(bytes) > 0) {
      bytes.flip();
      long val=bytes.getInt();
      if (val == DEFAULT_LOCK_VAL)       Logger.DEBUG("String_Node_Str" + val);
 else {
        Logger.INFO("String_Node_Str");
        FileSystem fs=FileSystem.get(new URI(gff),conf);
        int si=gff.lastIndexOf('.');
        if (si > 0)         gffSuffix=gff.substring(si);
 else         throw new InterruptedException("String_Node_Str" + gff);
        gffFile=findFile(refDir,gffSuffix,false);
        if (gffFile == null)         gffFile=refDir + id;
        attemptDownloadFileFromHDFS(context,fs,gff,gffFile + gffSuffix,RETRIES);
        Logger.INFO("String_Node_Str");
        bytes.clear();
        bytes.putInt(DEFAULT_LOCK_VAL).flip();
        lock.forceWrite(bytes);
      }
    }
 else {
      Logger.INFO("String_Node_Str");
      Logger.DEBUG("String_Node_Str" + gff);
      FileSystem fs=FileSystem.get(new URI(gff),conf);
      int si=gff.lastIndexOf('.');
      if (si > 0)       gffSuffix=gff.substring(si);
 else       throw new InterruptedException("String_Node_Str" + gff);
      gffFile=findFile(refDir,gffSuffix,false);
      if (gffFile == null)       gffFile=refDir + id;
      attemptDownloadFileFromHDFS(context,fs,gff,gffFile + gffSuffix,RETRIES);
      Logger.INFO("String_Node_Str");
      bytes.clear();
      bytes.putInt(DEFAULT_LOCK_VAL).flip();
      lock.forceWrite(bytes);
    }
  }
 catch (  InterruptedException ex) {
    Logger.EXCEPTION(ex);
  }
 finally {
    lock.releaseLock();
  }
  if (gffFile == null)   gffFile=findFile(refDir,"String_Node_Str",false);
  return gffFile + "String_Node_Str";
}

Fixed version (ground truth):
public static String downloadGFF(TaskInputOutputContext context,String id) throws IOException, URISyntaxException, InterruptedException {
  Configuration conf=context.getConfiguration();
  String refDir=HalvadeConf.getRefDirOnScratch(conf);
  String gff=HalvadeConf.getGff(context.getConfiguration());
  if (gff == null)   return null;
  String gffSuffix=null;
  int si=gff.lastIndexOf('.');
  if (si > 0)   gffSuffix=gff.substring(si);
 else   throw new InterruptedException("String_Node_Str" + gff);
  Logger.DEBUG("String_Node_Str" + gffSuffix);
  if (!refDir.endsWith("String_Node_Str"))   refDir=refDir + "String_Node_Str";
  HalvadeFileLock lock=new HalvadeFileLock(context,refDir,GFF_LOCK);
  String gffFile=null;
  try {
    lock.getLock();
    ByteBuffer bytes=ByteBuffer.allocate(4);
    if (lock.read(bytes) > 0) {
      bytes.flip();
      long val=bytes.getInt();
      if (val == DEFAULT_LOCK_VAL)       Logger.DEBUG("String_Node_Str" + val);
 else {
        Logger.INFO("String_Node_Str");
        FileSystem fs=FileSystem.get(new URI(gff),conf);
        gffFile=findFile(refDir,gffSuffix,false);
        if (gffFile == null)         gffFile=refDir + id;
        attemptDownloadFileFromHDFS(context,fs,gff,gffFile + gffSuffix,RETRIES);
        Logger.INFO("String_Node_Str");
        bytes.clear();
        bytes.putInt(DEFAULT_LOCK_VAL).flip();
        lock.forceWrite(bytes);
      }
    }
 else {
      Logger.INFO("String_Node_Str");
      Logger.DEBUG("String_Node_Str" + gff);
      FileSystem fs=FileSystem.get(new URI(gff),conf);
      gffFile=findFile(refDir,gffSuffix,false);
      if (gffFile == null)       gffFile=refDir + id;
      attemptDownloadFileFromHDFS(context,fs,gff,gffFile + gffSuffix,RETRIES);
      Logger.INFO("String_Node_Str");
      bytes.clear();
      bytes.putInt(DEFAULT_LOCK_VAL).flip();
      lock.forceWrite(bytes);
    }
  }
 catch (  InterruptedException ex) {
    Logger.EXCEPTION(ex);
  }
 finally {
    lock.releaseLock();
  }
  if (gffFile == null)   gffFile=findFile(refDir,gffSuffix,false);
  return gffFile + gffSuffix;
}