Program: 161275
Project: 161275
Buggy source:
@Override public int doWork(final List<String> args){
  final Pattern TAB=Pattern.compile("String_Node_Str");
  OutputStream fos=null;
  BufferedReader r=null;
  try {
    final File inputFile=new File(oneAndOnlyOneFile(args));
    IOUtil.assertFileIsReadable(inputFile);
    if (!inputFile.getName().startsWith("String_Node_Str")) {
      LOG.error("String_Node_Str" + inputFile);
      return -1;
    }
    int dot=inputFile.getName().indexOf("String_Node_Str");
    if (dot == -1) {
      LOG.error("String_Node_Str" + inputFile.getName());
      return -1;
    }
    final String contig=inputFile.getName().substring(3,dot);
    if (args.isEmpty()) {
      LOG.error("String_Node_Str");
      return -1;
    }
    if (this.outfilename == null) {
      fos=stdout();
    }
 else {
      if (!this.outfilename.getName().endsWith("String_Node_Str")) {
        LOG.error("String_Node_Str" + outfilename);
        return -1;
      }
      if (!this.outfilename.getName().contains(contig + "String_Node_Str")) {
        LOG.error("String_Node_Str" + contig + "String_Node_Str"+ outfilename);
        return -1;
      }
      LOG.info("String_Node_Str" + this.outfilename);
      fos=new FileOutputStream(this.outfilename);
    }
    fos.write(MAGIC);
    final byte score_str[]=new byte[SCORE_SIZEOF];
    long nRecords=0L;
    int prev_pos=0;
    LOG.info("String_Node_Str" + inputFile + "String_Node_Str"+ contig+ "String_Node_Str");
    r=IOUtils.openFileForBufferedReading(inputFile);
    String line;
    while ((line=r.readLine()) != null) {
      if (StringUtil.isBlank(line)) {
        LOG.error("String_Node_Str" + inputFile + "String_Node_Str");
        return -1;
      }
      nRecords++;
      if (nRecords % 1000000 == 0) {
        LOG.info("String_Node_Str" + nRecords + "String_Node_Str"+ line+ "String_Node_Str");
      }
      final String tokens[]=TAB.split(line);
      if (tokens.length < 5)       throw new JvarkitException.TokenErrors(tokens);
      if (StringUtil.isBlank(tokens[0]))       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (StringUtil.isBlank(tokens[1]))       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (StringUtil.isBlank(tokens[2]))       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (tokens[1] == tokens[2])       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (tokens[1].length() != 1)       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (tokens[2].length() != 1)       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (tokens[3].length() > ENSG_STRLEN)       throw new JvarkitException.FileFormatError("String_Node_Str" + ENSG_STRLEN + "String_Node_Str"+ line);
      if (!tokens[3].startsWith("String_Node_Str"))       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (tokens[4].length() > SCORE_STRLEN)       throw new JvarkitException.FileFormatError("String_Node_Str" + SCORE_STRLEN + "String_Node_Str"+ line);
      final float f=Float.parseFloat(tokens[4]);
      if (f < 0)       throw new JvarkitException.FileFormatError("String_Node_Str" + tokens[4] + "String_Node_Str"+ f+ "String_Node_Str");
      if (f > 1.0f)       throw new JvarkitException.FileFormatError("String_Node_Str" + tokens[4] + "String_Node_Str"+ f+ "String_Node_Str");
      final int pos=Integer.parseInt(tokens[0]);
      if (prev_pos > pos) {
        LOG.error("String_Node_Str" + prev_pos + "String_Node_Str"+ pos);
        return -1;
      }
      prev_pos=pos;
      final ByteArrayOutputStream baos=new ByteArrayOutputStream(RECORD_SIZOF);
      final DataOutputStream daos=new DataOutputStream(baos);
      daos.writeInt(pos);
      daos.writeByte(tokens[1].charAt(0));
      daos.writeByte(tokens[2].charAt(0));
      daos.writeInt(Integer.parseInt(tokens[3].substring(4)));
      Arrays.fill(score_str,(byte)'0');
      if (tokens[4].equals("String_Node_Str") || tokens[4].equals("String_Node_Str")) {
        score_str[1]=(byte)1;
      }
 else       if (tokens[4].equals("String_Node_Str")) {
      }
 else       if (tokens[4].startsWith("String_Node_Str")) {
        final byte b_array[]=tokens[4].substring(2).getBytes();
        if (b_array.length > SCORE_SIZEOF)         throw new JvarkitException.FileFormatError("String_Node_Str" + SCORE_STRLEN + "String_Node_Str"+ line);
        System.arraycopy(b_array,0,score_str,0,b_array.length);
      }
 else {
        LOG.error("String_Node_Str" + tokens[4]);
        return -1;
      }
      daos.write(score_str,0,score_str.length);
      final byte record_bytes[]=baos.toByteArray();
      if (record_bytes.length != RECORD_SIZOF) {
        LOG.error("String_Node_Str" + record_bytes.length);
        return -1;
      }
      fos.write(record_bytes);
    }
    r.close();
    fos.flush();
    fos.close();
    LOG.info("String_Node_Str" + nRecords + "String_Node_Str"+ (RECORD_SIZOF * nRecords));
    return 0;
  }
 catch (  final Exception err) {
    LOG.error(err);
    return -1;
  }
 finally {
    CloserUtil.close(fos);
    CloserUtil.close(r);
  }
}

Fixed version (ground truth):
@Override public int doWork(final List<String> args){
  final Pattern TAB=Pattern.compile("String_Node_Str");
  OutputStream fos=null;
  BufferedReader r=null;
  try {
    final File inputFile=new File(oneAndOnlyOneFile(args));
    IOUtil.assertFileIsReadable(inputFile);
    if (!inputFile.getName().startsWith("String_Node_Str")) {
      LOG.error("String_Node_Str" + inputFile);
      return -1;
    }
    int dot=inputFile.getName().indexOf("String_Node_Str");
    if (dot == -1) {
      LOG.error("String_Node_Str" + inputFile.getName());
      return -1;
    }
    final String contig=inputFile.getName().substring(3,dot);
    if (args.isEmpty()) {
      LOG.error("String_Node_Str");
      return -1;
    }
    if (this.outfilename == null) {
      fos=stdout();
    }
 else {
      if (!this.outfilename.getName().endsWith("String_Node_Str")) {
        LOG.error("String_Node_Str" + outfilename);
        return -1;
      }
      if (!this.outfilename.getName().contains(contig + "String_Node_Str")) {
        LOG.error("String_Node_Str" + contig + "String_Node_Str"+ outfilename);
        return -1;
      }
      LOG.info("String_Node_Str" + this.outfilename);
      fos=new FileOutputStream(this.outfilename);
    }
    fos.write(MAGIC);
    final byte score_str[]=new byte[SCORE_SIZEOF];
    long nRecords=0L;
    int prev_pos=0;
    LOG.info("String_Node_Str" + inputFile + "String_Node_Str"+ contig+ "String_Node_Str");
    r=IOUtils.openFileForBufferedReading(inputFile);
    String line;
    while ((line=r.readLine()) != null) {
      if (StringUtil.isBlank(line)) {
        LOG.error("String_Node_Str" + inputFile + "String_Node_Str");
        return -1;
      }
      nRecords++;
      if (nRecords % 1000000 == 0) {
        LOG.info("String_Node_Str" + nRecords + "String_Node_Str"+ line+ "String_Node_Str");
      }
      final String tokens[]=TAB.split(line);
      if (tokens.length < 5)       throw new JvarkitException.TokenErrors(tokens);
      if (StringUtil.isBlank(tokens[0]))       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (StringUtil.isBlank(tokens[1]))       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (StringUtil.isBlank(tokens[2]))       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (tokens[1] == tokens[2])       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (tokens[1].length() != 1)       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (tokens[2].length() != 1)       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (tokens[3].length() > ENSG_STRLEN)       throw new JvarkitException.FileFormatError("String_Node_Str" + ENSG_STRLEN + "String_Node_Str"+ line);
      if (!tokens[3].startsWith("String_Node_Str"))       throw new JvarkitException.FileFormatError("String_Node_Str" + line);
      if (tokens[4].length() > SCORE_STRLEN)       throw new JvarkitException.FileFormatError("String_Node_Str" + SCORE_STRLEN + "String_Node_Str"+ line);
      final float f=Float.parseFloat(tokens[4]);
      if (f < 0)       throw new JvarkitException.FileFormatError("String_Node_Str" + tokens[4] + "String_Node_Str"+ f+ "String_Node_Str");
      if (f > 1.0f)       throw new JvarkitException.FileFormatError("String_Node_Str" + tokens[4] + "String_Node_Str"+ f+ "String_Node_Str");
      final int pos=Integer.parseInt(tokens[0]);
      if (prev_pos > pos) {
        LOG.error("String_Node_Str" + prev_pos + "String_Node_Str"+ pos);
        return -1;
      }
      prev_pos=pos;
      final ByteArrayOutputStream baos=new ByteArrayOutputStream(RECORD_SIZOF);
      final DataOutputStream daos=new DataOutputStream(baos);
      daos.writeInt(pos);
      daos.writeByte(tokens[1].charAt(0));
      daos.writeByte(tokens[2].charAt(0));
      daos.writeInt(Integer.parseInt(tokens[3].substring(4)));
      Arrays.fill(score_str,(byte)'0');
      if (tokens[4].equals("String_Node_Str") || tokens[4].equals("String_Node_Str")) {
        score_str[0]=(byte)1;
      }
 else       if (tokens[4].equals("String_Node_Str")) {
      }
 else       if (tokens[4].startsWith("String_Node_Str")) {
        final byte b_array[]=tokens[4].substring(2).getBytes();
        if (b_array.length > SCORE_SIZEOF)         throw new JvarkitException.FileFormatError("String_Node_Str" + SCORE_STRLEN + "String_Node_Str"+ line);
        System.arraycopy(b_array,0,score_str,0,b_array.length);
      }
 else {
        LOG.error("String_Node_Str" + tokens[4]);
        return -1;
      }
      daos.write(score_str,0,score_str.length);
      final byte record_bytes[]=baos.toByteArray();
      if (record_bytes.length != RECORD_SIZOF) {
        LOG.error("String_Node_Str" + record_bytes.length);
        return -1;
      }
      fos.write(record_bytes);
    }
    r.close();
    fos.flush();
    fos.close();
    LOG.info("String_Node_Str" + nRecords + "String_Node_Str"+ (RECORD_SIZOF * nRecords));
    return 0;
  }
 catch (  final Exception err) {
    LOG.error(err);
    return -1;
  }
 finally {
    CloserUtil.close(fos);
    CloserUtil.close(r);
  }
}