Program: 80637
Project: 80637
Buggy source:
public Variant parseLine(){
  String line=_line;
  readLine();
  if (line == null || line.length() == 0) {
    System.err.println("String_Node_Str");
    return null;
  }
  StringTokenizer toks=new StringTokenizer(line);
  if (line.startsWith("String_Node_Str")) {
    if (_id != null && line.startsWith("String_Node_Str")) {
      chrom_exists=true;
      int index=0;
      while (toks.hasMoreTokens()) {
        index++;
        String tok=toks.nextToken();
        if (tok.equals(_id))         _id_ind=index;
      }
    }
 else     if (_id == null) {
      _id_ind=10;
    }
    return null;
  }
  if (_id_ind < 0 && !chrom_exists) {
    _id_ind=10;
  }
 else   if (_id_ind < 0) {
    _id_ind=10;
    System.err.println("String_Node_Str" + _id + "String_Node_Str");
  }
  int index=0, genotype_ind=-1, copynum_ind=-1;
  int chr=-1, pos=-1;
  String chr_name="String_Node_Str", REF="String_Node_Str", FILTER="String_Node_Str", ALT="String_Node_Str", var_id="String_Node_Str";
  String phase="String_Node_Str", copy_num="String_Node_Str", INFO="String_Node_Str", FORMAT="String_Node_Str";
  String[] sampleInfo={};
  while (toks.hasMoreTokens()) {
    index++;
    if (index == 1) {
      chr_name=stripChr(toks.nextToken());
      chr=getChromIndex(chr_name);
    }
 else     if (index == 2)     pos=Integer.parseInt(toks.nextToken());
 else     if (index == 3)     var_id=toks.nextToken();
 else     if (index == 4)     REF=toks.nextToken();
 else     if (index == 5)     ALT=toks.nextToken();
 else     if (index == 7)     FILTER=toks.nextToken();
 else     if (index == 8)     INFO=toks.nextToken();
 else     if (index == 9) {
      FORMAT=toks.nextToken();
      genotype_ind=getFormatKeyIndex(FORMAT,"String_Node_Str");
      copynum_ind=getFormatKeyIndex(FORMAT,"String_Node_Str");
    }
 else     if (index == _id_ind) {
      sampleInfo=(toks.nextToken()).split("String_Node_Str");
      if (genotype_ind >= 0) {
        phase=sampleInfo[genotype_ind];
      }
      if (copynum_ind >= 0) {
        copy_num=sampleInfo[copynum_ind];
      }
      break;
    }
 else {
      toks.nextToken();
    }
  }
  if (chr < 0) {
    System.err.println("String_Node_Str" + line);
    return null;
  }
  if (_pass && FILTER.indexOf("String_Node_Str") < 0) {
    System.err.println("String_Node_Str" + line);
    return null;
  }
  byte[] phase_val=new byte[2];
  boolean is_phased=splitGeno(phase,phase_val,chr);
  if (genotype_ind >= 0 && phase_val[0] == 0 && phase_val[1] == 0) {
  }
  if (phase_val[0] < 0 || phase_val[1] < 0) {
    phase_val[0]=1;
    phase_val[1]=1;
  }
  byte[] copy_num_val=new byte[2];
  boolean is_cn_phased=false;
  if (copynum_ind >= 0) {
    is_cn_phased=splitGeno(copy_num,copy_num_val,chr);
    if (is_cn_phased != is_phased) {
      System.err.println("String_Node_Str");
      System.err.println(line);
      return null;
    }
  }
  REF=REF.toUpperCase();
  ALT=ALT.toUpperCase();
  String ref_deleted="String_Node_Str";
  FlexSeq alts[];
  if (ALT.equals("String_Node_Str")) {
    int inv_lens[]=getSVLen(INFO);
    int end_loc=getEndInfo(INFO);
    if (inv_lens.length > 0) {
      alts=new FlexSeq[inv_lens.length];
      for (int i=0; i < inv_lens.length; i++) {
        int len_val=Math.max(Math.abs(inv_lens[i]),1);
        alts[i]=new FlexSeq(FlexSeq.Type.INV,len_val);
      }
      ref_deleted=REF;
      byte[] refs=new byte[0];
      return new Variant(chr_name,chr,pos,Math.abs(inv_lens[0]),refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else     if (end_loc > 0) {
      int inv_len=Math.max(Math.abs(end_loc - pos + 1),1);
      alts=new FlexSeq[1];
      alts[0]=new FlexSeq(FlexSeq.Type.INV,inv_len);
      ref_deleted=REF;
      byte[] refs=new byte[0];
      return new Variant(chr_name,chr,pos,inv_len,refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else {
      System.err.println("String_Node_Str");
      System.err.println(line);
      System.err.println("String_Node_Str");
      return null;
    }
  }
 else   if (ALT.equals("String_Node_Str") || ALT.equals("String_Node_Str")) {
    int dup_lens[]=getSVLen(INFO);
    int end_loc=getEndInfo(INFO);
    if (dup_lens.length > 0) {
      alts=new FlexSeq[dup_lens.length];
      for (int i=0; i < dup_lens.length; i++) {
        int copy_val=1;
        for (int j=0; j < 2; j++) {
          if ((i + 1) == phase_val[j]) {
            if (copy_num_val[j] > 0) {
              copy_val=copy_num_val[j];
            }
          }
        }
        int len_val=Math.max(Math.abs(dup_lens[i]),1);
        alts[i]=new FlexSeq(FlexSeq.Type.DUP,len_val,copy_val);
      }
      ref_deleted=REF;
      byte[] refs=new byte[0];
      return new Variant(chr_name,chr,pos,Math.abs(dup_lens[0]),refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else     if (end_loc > 0) {
      int dup_len=Math.max(Math.abs(end_loc - pos + 1),1);
      alts=new FlexSeq[1];
      alts[0]=new FlexSeq(FlexSeq.Type.DUP,dup_len,Math.max(copy_num_val[0],copy_num_val[1]));
      ref_deleted=REF;
      byte[] refs=new byte[0];
      return new Variant(chr_name,chr,pos,dup_len,refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else {
      System.err.println("String_Node_Str");
      System.err.println(line);
      System.err.println("String_Node_Str");
      return null;
    }
  }
 else   if (ALT.equals("String_Node_Str")) {
    int ins_lens[]=getSVLen(INFO);
    int end_loc=getEndInfo(INFO);
    if (ins_lens.length > 0) {
      alts=new FlexSeq[ins_lens.length];
      for (int i=0; i < ins_lens.length; i++) {
        int len_val=Math.max(Math.abs(ins_lens[i]),1);
        alts[i]=new FlexSeq(FlexSeq.Type.INS,len_val);
      }
      ref_deleted=REF;
      byte[] refs=new byte[0];
      return new Variant(chr_name,chr,pos + 1,0,refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else     if (end_loc > 0) {
      int ins_len=Math.max(Math.abs(end_loc - pos + 1),1);
      alts=new FlexSeq[1];
      alts[0]=new FlexSeq(FlexSeq.Type.INS,ins_len);
      ref_deleted=REF;
      byte[] refs=new byte[0];
      return new Variant(chr_name,chr,pos + 1,0,refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else {
      System.err.println("String_Node_Str");
      System.err.println(line);
      System.err.println("String_Node_Str");
      return null;
    }
  }
 else   if (ALT.equals("String_Node_Str")) {
    int del_lens[]=getSVLen(INFO);
    int end_loc=getEndInfo(INFO);
    if (del_lens.length > 0) {
      alts=new FlexSeq[del_lens.length];
      for (int i=0; i < del_lens.length; i++) {
        alts[i]=new FlexSeq(FlexSeq.Type.DEL,0);
      }
      ref_deleted=REF;
      byte[] refs=new byte[0];
      return new Variant(chr_name,chr,pos,Math.abs(del_lens[0]),refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else     if (end_loc > 0) {
      int del_len=end_loc - pos + 1;
      alts=new FlexSeq[1];
      alts[0]=new FlexSeq(FlexSeq.Type.DEL,0);
      ref_deleted=REF;
      byte[] refs=new byte[0];
      return new Variant(chr_name,chr,pos,del_len,refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else {
      System.err.println("String_Node_Str");
      System.err.println(line);
      System.err.println("String_Node_Str");
      return null;
    }
  }
 else   if (ALT.indexOf('<') >= 0) {
    System.err.println("String_Node_Str" + line);
    return null;
  }
 else {
    String[] alts_str=ALT.split("String_Node_Str");
    int n=alts_str.length;
    alts=new FlexSeq[n];
    for (int i=0; i < n; i++) {
      byte[] temp=new byte[alts_str[i].length()];
      for (int j=0; j < alts_str[i].length(); j++) {
        temp[j]=(byte)alts_str[i].charAt(j);
      }
      alts[i]=new FlexSeq(temp);
    }
    for (int i=0; i < n; i++)     if (REF.length() == 1 && alts[i].length() == 1) {
    }
 else     if (REF.length() == 0 || alts[i].length() == 0) {
      System.err.println("String_Node_Str");
      System.err.println(line);
      return null;
    }
    if (REF.length() > 0) {
      boolean same=true;
      for (int i=0; i < n; i++)       if (alts[i].length() == 0 || REF.charAt(0) != alts[i].charAt(0)) {
        same=false;
        break;
      }
      if (same) {
        pos++;
        ref_deleted=String.valueOf(REF.charAt(0));
        REF=REF.substring(1);
        for (int i=0; i < n; i++) {
          alts[i]=new FlexSeq(alts[i].substring(1));
        }
      }
    }
    if (REF.length() > 0) {
      boolean same=true;
      int indREF=REF.length() - 1;
      for (int i=0; i < n; i++) {
        int len=alts[i].length();
        if (len == 0 || REF.charAt(indREF) != alts[i].charAt(len - 1)) {
          same=false;
          break;
        }
      }
      if (same) {
        REF=REF.substring(0,indREF);
        for (int i=0; i < n; i++) {
          alts[i]=new FlexSeq(alts[i].substring(0,alts[i].length() - 1));
        }
      }
    }
    byte[] refs=new byte[REF.length()];
    for (int i=0; i < REF.length(); i++) {
      refs[i]=(byte)REF.charAt(i);
    }
    return new Variant(chr_name,chr,pos,refs.length,refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
  }
}

Fixed version (ground truth):
public Variant parseLine(){
  String line=_line;
  readLine();
  if (line == null || line.length() == 0) {
    System.err.println("String_Node_Str");
    return null;
  }
  StringTokenizer toks=new StringTokenizer(line);
  if (line.startsWith("String_Node_Str")) {
    if (_id != null && line.startsWith("String_Node_Str")) {
      chrom_exists=true;
      int index=0;
      while (toks.hasMoreTokens()) {
        index++;
        String tok=toks.nextToken();
        if (tok.equals(_id))         _id_ind=index;
      }
    }
 else     if (_id == null) {
      _id_ind=10;
    }
    return null;
  }
  if (_id_ind < 0 && !chrom_exists) {
    _id_ind=10;
  }
 else   if (_id_ind < 0) {
    _id_ind=10;
    System.err.println("String_Node_Str" + _id + "String_Node_Str");
  }
  int index=0, genotype_ind=-1, copynum_ind=-1;
  int chr=-1, pos=-1;
  String chr_name="String_Node_Str", REF="String_Node_Str", FILTER="String_Node_Str", ALT="String_Node_Str", var_id="String_Node_Str";
  String phase="String_Node_Str", copy_num="String_Node_Str", INFO="String_Node_Str", FORMAT="String_Node_Str";
  String[] sampleInfo={};
  while (toks.hasMoreTokens()) {
    index++;
    if (index == 1) {
      chr_name=stripChr(toks.nextToken());
      chr=getChromIndex(chr_name);
    }
 else     if (index == 2)     pos=Integer.parseInt(toks.nextToken());
 else     if (index == 3)     var_id=toks.nextToken();
 else     if (index == 4)     REF=toks.nextToken();
 else     if (index == 5)     ALT=toks.nextToken();
 else     if (index == 7)     FILTER=toks.nextToken();
 else     if (index == 8)     INFO=toks.nextToken();
 else     if (index == 9) {
      FORMAT=toks.nextToken();
      genotype_ind=getFormatKeyIndex(FORMAT,"String_Node_Str");
      copynum_ind=getFormatKeyIndex(FORMAT,"String_Node_Str");
    }
 else     if (index == _id_ind) {
      sampleInfo=(toks.nextToken()).split("String_Node_Str");
      if (genotype_ind >= 0) {
        phase=sampleInfo[genotype_ind];
      }
      if (copynum_ind >= 0) {
        copy_num=sampleInfo[copynum_ind];
      }
      break;
    }
 else {
      toks.nextToken();
    }
  }
  if (chr < 0) {
    System.err.println("String_Node_Str" + line);
    return null;
  }
  if (_pass && FILTER.indexOf("String_Node_Str") < 0) {
    System.err.println("String_Node_Str" + line);
    return null;
  }
  byte[] phase_val=new byte[2];
  boolean is_phased=splitGeno(phase,phase_val,chr);
  if (genotype_ind >= 0 && phase_val[0] == 0 && phase_val[1] == 0) {
  }
  if (phase_val[0] < 0 || phase_val[1] < 0) {
    phase_val[0]=1;
    phase_val[1]=1;
  }
  byte[] copy_num_val=new byte[2];
  boolean is_cn_phased=false;
  if (copynum_ind >= 0) {
    is_cn_phased=splitGeno(copy_num,copy_num_val,chr);
    if (is_cn_phased != is_phased) {
      System.err.println("String_Node_Str");
      System.err.println(line);
      return null;
    }
  }
  REF=REF.toUpperCase();
  ALT=ALT.toUpperCase();
  String ref_deleted="String_Node_Str";
  FlexSeq alts[];
  if (ALT.equals("String_Node_Str")) {
    int inv_lens[]=getSVLen(INFO);
    int end_loc=getEndInfo(INFO);
    ref_deleted=REF;
    byte[] refs=new byte[0];
    pos++;
    if (inv_lens.length > 0) {
      alts=new FlexSeq[inv_lens.length];
      for (int i=0; i < inv_lens.length; i++) {
        int len_val=Math.max(Math.abs(inv_lens[i]),1);
        alts[i]=new FlexSeq(FlexSeq.Type.INV,len_val);
      }
      return new Variant(chr_name,chr,pos,Math.abs(inv_lens[0]),refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else     if (end_loc > 0) {
      int inv_len=Math.max(Math.abs(end_loc - pos + 1),1);
      alts=new FlexSeq[1];
      alts[0]=new FlexSeq(FlexSeq.Type.INV,inv_len);
      return new Variant(chr_name,chr,pos,inv_len,refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else {
      System.err.println("String_Node_Str");
      System.err.println(line);
      System.err.println("String_Node_Str");
      return null;
    }
  }
 else   if (ALT.equals("String_Node_Str") || ALT.equals("String_Node_Str")) {
    int dup_lens[]=getSVLen(INFO);
    int end_loc=getEndInfo(INFO);
    ref_deleted=REF;
    byte[] refs=new byte[0];
    pos++;
    if (dup_lens.length > 0) {
      alts=new FlexSeq[dup_lens.length];
      for (int i=0; i < dup_lens.length; i++) {
        int copy_val=1;
        for (int j=0; j < 2; j++) {
          if ((i + 1) == phase_val[j]) {
            if (copy_num_val[j] > 0) {
              copy_val=copy_num_val[j];
            }
          }
        }
        int len_val=Math.max(Math.abs(dup_lens[i]),1);
        alts[i]=new FlexSeq(FlexSeq.Type.DUP,len_val,copy_val);
      }
      return new Variant(chr_name,chr,pos,Math.abs(dup_lens[0]),refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else     if (end_loc > 0) {
      int dup_len=Math.max(Math.abs(end_loc - pos + 1),1);
      alts=new FlexSeq[1];
      alts[0]=new FlexSeq(FlexSeq.Type.DUP,dup_len,Math.max(copy_num_val[0],copy_num_val[1]));
      return new Variant(chr_name,chr,pos,dup_len,refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else {
      System.err.println("String_Node_Str");
      System.err.println(line);
      System.err.println("String_Node_Str");
      return null;
    }
  }
 else   if (ALT.equals("String_Node_Str")) {
    int ins_lens[]=getSVLen(INFO);
    int end_loc=getEndInfo(INFO);
    ref_deleted=REF;
    byte[] refs=new byte[0];
    pos++;
    if (ins_lens.length > 0) {
      alts=new FlexSeq[ins_lens.length];
      for (int i=0; i < ins_lens.length; i++) {
        int len_val=Math.max(Math.abs(ins_lens[i]),1);
        alts[i]=new FlexSeq(FlexSeq.Type.INS,len_val);
      }
      return new Variant(chr_name,chr,pos,0,refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else     if (end_loc > 0) {
      int ins_len=Math.max(Math.abs(end_loc - pos),1);
      alts=new FlexSeq[1];
      alts[0]=new FlexSeq(FlexSeq.Type.INS,ins_len);
      return new Variant(chr_name,chr,pos,0,refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else {
      System.err.println("String_Node_Str");
      System.err.println(line);
      System.err.println("String_Node_Str");
      return null;
    }
  }
 else   if (ALT.equals("String_Node_Str")) {
    int del_lens[]=getSVLen(INFO);
    int end_loc=getEndInfo(INFO);
    ref_deleted=REF;
    byte[] refs=new byte[0];
    pos++;
    if (del_lens.length > 0) {
      alts=new FlexSeq[del_lens.length];
      for (int i=0; i < del_lens.length; i++) {
        alts[i]=new FlexSeq(FlexSeq.Type.DEL,0);
      }
      return new Variant(chr_name,chr,pos,Math.abs(del_lens[0]),refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else     if (end_loc > 0) {
      int del_len=end_loc - pos + 1;
      alts=new FlexSeq[1];
      alts[0]=new FlexSeq(FlexSeq.Type.DEL,0);
      return new Variant(chr_name,chr,pos,del_len,refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
    }
 else {
      System.err.println("String_Node_Str");
      System.err.println(line);
      System.err.println("String_Node_Str");
      return null;
    }
  }
 else   if (ALT.indexOf('<') >= 0) {
    System.err.println("String_Node_Str" + line);
    return null;
  }
 else {
    String[] alts_str=ALT.split("String_Node_Str");
    int n=alts_str.length;
    alts=new FlexSeq[n];
    for (int i=0; i < n; i++) {
      byte[] temp=new byte[alts_str[i].length()];
      for (int j=0; j < alts_str[i].length(); j++) {
        temp[j]=(byte)alts_str[i].charAt(j);
      }
      alts[i]=new FlexSeq(temp);
    }
    for (int i=0; i < n; i++) {
      if (REF.length() == 1 && alts[i].length() == 1) {
      }
 else       if (REF.length() == 0 || alts[i].length() == 0) {
        System.err.println("String_Node_Str");
        System.err.println(line);
        return null;
      }
    }
    if (REF.length() > 0) {
      boolean same=true;
      for (int i=0; i < n; i++)       if (alts[i].length() == 0 || REF.charAt(0) != alts[i].charAt(0)) {
        same=false;
        break;
      }
      if (same) {
        pos++;
        ref_deleted=String.valueOf(REF.charAt(0));
        REF=REF.substring(1);
        for (int i=0; i < n; i++) {
          alts[i]=new FlexSeq(alts[i].substring(1));
        }
      }
    }
    if (REF.length() > 0) {
      boolean same=true;
      int indREF=REF.length() - 1;
      for (int i=0; i < n; i++) {
        int len=alts[i].length();
        if (len == 0 || REF.charAt(indREF) != alts[i].charAt(len - 1)) {
          same=false;
          break;
        }
      }
      if (same) {
        REF=REF.substring(0,indREF);
        for (int i=0; i < n; i++) {
          alts[i]=new FlexSeq(alts[i].substring(0,alts[i].length() - 1));
        }
      }
    }
    byte[] refs=new byte[REF.length()];
    for (int i=0; i < REF.length(); i++) {
      refs[i]=(byte)REF.charAt(i);
    }
    return new Variant(chr_name,chr,pos,refs.length,refs,alts,phase_val,is_phased,var_id,FILTER,ref_deleted);
  }
}