Program: 13657
Project: 13657
Buggy source:
@Override public void run(){
  Iterator<AnalysisListener> i=listeners.iterator();
  while (i.hasNext()) {
    i.next().analysisStarted(file);
  }
  if (annotationFromNetwork) {
    GenomeParser parser=new GenomeParser();
    ProgressTextDialog ptd=new ProgressTextDialog("String_Node_Str");
    parser.addProgressListener(ptd);
    parser.parseGenome(genomeBaseLocation);
    annotationSet=parser.genome().annotationSet();
  }
 else {
    if (BamQCConfig.getInstance().gff_file != null) {
      annotationSet=new AnnotationSet();
      AnnotationParser parser;
      if (BamQCConfig.getInstance().gff_file.getName().toLowerCase().endsWith("String_Node_Str")) {
        parser=new GTFAnnotationParser();
      }
 else {
        parser=new GFF3AnnotationParser();
      }
      try {
        parser.parseAnnotation(annotationSet,BamQCConfig.getInstance().gff_file);
      }
 catch (      Exception e) {
        Iterator<AnalysisListener> i2=listeners.iterator();
        while (i2.hasNext()) {
          i2.next().analysisExceptionReceived(file,e);
          return;
        }
      }
    }
 else {
      annotationSet=new AnnotationSet();
    }
  }
  for (int m=0; m < modules.length; m++) {
    modules[m].processFile(file);
  }
  int seqCount=0;
  while (file.hasNext()) {
    ++seqCount;
    SAMRecord seq;
    try {
      seq=file.next();
    }
 catch (    SequenceFormatException e) {
      i=listeners.iterator();
      while (i.hasNext()) {
        i.next().analysisExceptionReceived(file,e);
      }
      return;
    }
    annotationSet.processSequence(seq);
    for (int m=0; m < modules.length; m++) {
      if (modules[m].needsToSeeSequences()) {
        modules[m].processSequence(seq);
      }
    }
    if (seqCount % 1000 == 0) {
      if (file.getPercentComplete() >= percentComplete + 5) {
        percentComplete=file.getPercentComplete();
        i=listeners.iterator();
        while (i.hasNext()) {
          i.next().analysisUpdated(file,seqCount,percentComplete);
        }
        try {
          Thread.sleep(10);
        }
 catch (        InterruptedException e) {
        }
      }
    }
  }
  for (int m=0; m < modules.length; m++) {
    if (modules[m].needsToSeeAnnotation()) {
      modules[m].processAnnotationSet(annotationSet);
    }
  }
  i=listeners.iterator();
  while (i.hasNext()) {
    i.next().analysisComplete(file,modules);
  }
}

Fixed version (ground truth):
@Override public void run(){
  Iterator<AnalysisListener> i=listeners.iterator();
  while (i.hasNext()) {
    i.next().analysisStarted(file);
  }
  AnnotationSet annotationSet=null;
  if (annotationFromNetwork) {
    GenomeParser parser=new GenomeParser();
    ProgressTextDialog ptd=new ProgressTextDialog("String_Node_Str");
    parser.addProgressListener(ptd);
    parser.parseGenome(genomeBaseLocation);
    annotationSet=parser.genome().annotationSet();
  }
 else   if (BamQCConfig.getInstance().gff_file != null) {
    annotationSet=new AnnotationSet();
    AnnotationParser parser;
    if (BamQCConfig.getInstance().gff_file.getName().toLowerCase().endsWith("String_Node_Str")) {
      parser=new GTFAnnotationParser();
    }
 else {
      parser=new GFF3AnnotationParser();
    }
    try {
      parser.parseAnnotation(annotationSet,BamQCConfig.getInstance().gff_file);
    }
 catch (    Exception e) {
      Iterator<AnalysisListener> i2=listeners.iterator();
      while (i2.hasNext()) {
        i2.next().analysisExceptionReceived(file,e);
        return;
      }
    }
  }
 else {
    annotationSet=new AnnotationSet();
  }
  for (int m=0; m < modules.length; m++) {
    modules[m].processFile(file);
  }
  int seqCount=0;
  while (file.hasNext()) {
    ++seqCount;
    SAMRecord seq;
    try {
      seq=file.next();
    }
 catch (    SequenceFormatException e) {
      i=listeners.iterator();
      while (i.hasNext()) {
        i.next().analysisExceptionReceived(file,e);
      }
      return;
    }
    annotationSet.processSequence(seq);
    for (int m=0; m < modules.length; m++) {
      if (modules[m].needsToSeeSequences()) {
        modules[m].processSequence(seq);
      }
    }
    if (seqCount % 1000 == 0) {
      if (file.getPercentComplete() >= percentComplete + 5) {
        percentComplete=file.getPercentComplete();
        i=listeners.iterator();
        while (i.hasNext()) {
          i.next().analysisUpdated(file,seqCount,percentComplete);
        }
        try {
          Thread.sleep(10);
        }
 catch (        InterruptedException e) {
        }
      }
    }
  }
  for (int m=0; m < modules.length; m++) {
    if (modules[m].needsToSeeAnnotation()) {
      modules[m].processAnnotationSet(annotationSet);
    }
  }
  i=listeners.iterator();
  while (i.hasNext()) {
    i.next().analysisComplete(file,modules);
  }
}