Program: 50305
Project: 50305
Buggy source:
@Override public void processAlignmentEntry(final AlignmentReader alignmentReader,final Alignments.AlignmentEntry alignmentEntry){
  String basename=alignmentReader.basename();
  basename=FilenameUtils.getBaseName(basename);
switch (outputFormat) {
case CONCISE:
{
      if (alignmentEntry.getSequenceVariationsCount() > 0) {
        outputStream.print(String.format("String_Node_Str",alignmentEntry.getQueryIndex(),getReferenceId(alignmentEntry.getTargetIndex())));
        boolean variations=false;
        for (        final Alignments.SequenceVariation var : alignmentEntry.getSequenceVariationsList()) {
          final int positionOnReference=alignmentEntry.getPosition() + var.getPosition();
          final int referenceIndex=alignmentEntry.getTargetIndex();
          boolean keepVar=true;
          keepVar=determineKeepVariation(positionOnReference,referenceIndex,keepVar);
          if (keepVar) {
            variations=true;
            outputStream.print(String.format("String_Node_Str",positionOnReference,var.getReadIndex(),var.getFrom(),var.getTo()));
          }
        }
        if (variations) {
          outputStream.println();
        }
      }
    }
  break;
case TSV:
case TAB_DELIMITED:
{
  final boolean variations=false;
  for (  final Alignments.SequenceVariation var : alignmentEntry.getSequenceVariationsList()) {
    final int positionOnReference=alignmentEntry.getPosition() + var.getPosition();
    final int readIndex=var.getReadIndex();
    final String from=var.getFrom();
    final String to=var.getTo();
    final int referenceIndex=alignmentEntry.getTargetIndex();
    final byte[] qualityScores;
    if (var.hasToQuality()) {
      System.out.println("String_Node_Str");
      qualityScores=var.getToQuality().toByteArray();
    }
 else {
      System.out.println("String_Node_Str");
      qualityScores=null;
    }
    boolean keepVar=true;
    keepVar=determineKeepVariation(positionOnReference,referenceIndex,keepVar);
    if (keepVar && !isAllNs(to)) {
      printTab(alignmentEntry,basename,positionOnReference,readIndex,from,to,qualityScores);
    }
  }
}
break;
case TAB_SINGLE_BASE:
{
for (final Alignments.SequenceVariation var : alignmentEntry.getSequenceVariationsList()) {
final int positionOnReference=alignmentEntry.getPosition() + var.getPosition();
final int readIndex=var.getReadIndex();
final String from=var.getFrom();
final String to=var.getTo();
final int fromLength=from.length();
final int toLength=to.length();
final int referenceIndex=alignmentEntry.getTargetIndex();
final byte[] qualityScores;
if (var.hasToQuality()) {
  qualityScores=var.getToQuality().toByteArray();
}
 else {
  qualityScores=null;
}
boolean keepVar=true;
keepVar=determineKeepVariation(positionOnReference,referenceIndex,keepVar);
if (keepVar && !isAllNs(to)) {
  final int maxLength=Math.max(fromLength,toLength);
  int fromOffset=0;
  int toOffset=0;
  int readIndexIncrementValue=(alignmentEntry.getMatchingReverseStrand() ? -1 : 1);
  byte[] toScore;
  if (qualityScores != null) {
    toScore=new byte[1];
  }
 else {
    toScore=null;
  }
  for (int i=0; i < maxLength; i++) {
    final char fromChar=var.getFrom().charAt(i);
    final char toChar=var.getTo().charAt(i);
    if (qualityScores != null) {
      if (i < qualityScores.length) {
        toScore[0]=qualityScores[i];
      }
 else {
        toScore=null;
      }
    }
    printTab(alignmentEntry,basename,positionOnReference + fromOffset,readIndex + toOffset,i < fromLength ? Character.toString(fromChar) : "String_Node_Str",i < toLength ? Character.toString(toChar) : "String_Node_Str",toScore);
    if (fromChar != '-') {
      fromOffset+=1;
    }
    if (toChar != '-') {
      toOffset+=readIndexIncrementValue;
    }
  }
}
}
}
break;
}
}

Fixed version (ground truth):
@Override public void processAlignmentEntry(final AlignmentReader alignmentReader,final Alignments.AlignmentEntry alignmentEntry){
  String basename=alignmentReader.basename();
  basename=FilenameUtils.getName(AlignmentReaderImpl.getBasename(basename));
switch (outputFormat) {
case CONCISE:
{
      if (alignmentEntry.getSequenceVariationsCount() > 0) {
        outputStream.print(String.format("String_Node_Str",alignmentEntry.getQueryIndex(),getReferenceId(alignmentEntry.getTargetIndex())));
        boolean variations=false;
        for (        final Alignments.SequenceVariation var : alignmentEntry.getSequenceVariationsList()) {
          final int positionOnReference=alignmentEntry.getPosition() + var.getPosition();
          final int referenceIndex=alignmentEntry.getTargetIndex();
          boolean keepVar=true;
          keepVar=determineKeepVariation(positionOnReference,referenceIndex,keepVar);
          if (keepVar) {
            variations=true;
            outputStream.print(String.format("String_Node_Str",positionOnReference,var.getReadIndex(),var.getFrom(),var.getTo()));
          }
        }
        if (variations) {
          outputStream.println();
        }
      }
    }
  break;
case TSV:
case TAB_DELIMITED:
{
  final boolean variations=false;
  for (  final Alignments.SequenceVariation var : alignmentEntry.getSequenceVariationsList()) {
    final int positionOnReference=alignmentEntry.getPosition() + var.getPosition();
    final int readIndex=var.getReadIndex();
    final String from=var.getFrom();
    final String to=var.getTo();
    final int referenceIndex=alignmentEntry.getTargetIndex();
    final byte[] qualityScores;
    if (var.hasToQuality()) {
      System.out.println("String_Node_Str");
      qualityScores=var.getToQuality().toByteArray();
    }
 else {
      System.out.println("String_Node_Str");
      qualityScores=null;
    }
    boolean keepVar=true;
    keepVar=determineKeepVariation(positionOnReference,referenceIndex,keepVar);
    if (keepVar && !isAllNs(to)) {
      printTab(alignmentEntry,basename,positionOnReference,readIndex,from,to,qualityScores);
    }
  }
}
break;
case TAB_SINGLE_BASE:
{
for (final Alignments.SequenceVariation var : alignmentEntry.getSequenceVariationsList()) {
final int positionOnReference=alignmentEntry.getPosition() + var.getPosition();
final int readIndex=var.getReadIndex();
final String from=var.getFrom();
final String to=var.getTo();
final int fromLength=from.length();
final int toLength=to.length();
final int referenceIndex=alignmentEntry.getTargetIndex();
final byte[] qualityScores;
if (var.hasToQuality()) {
  qualityScores=var.getToQuality().toByteArray();
}
 else {
  qualityScores=null;
}
boolean keepVar=true;
keepVar=determineKeepVariation(positionOnReference,referenceIndex,keepVar);
if (keepVar && !isAllNs(to)) {
  final int maxLength=Math.max(fromLength,toLength);
  int fromOffset=0;
  int toOffset=0;
  int readIndexIncrementValue=(alignmentEntry.getMatchingReverseStrand() ? -1 : 1);
  byte[] toScore;
  if (qualityScores != null) {
    toScore=new byte[1];
  }
 else {
    toScore=null;
  }
  for (int i=0; i < maxLength; i++) {
    final char fromChar=var.getFrom().charAt(i);
    final char toChar=var.getTo().charAt(i);
    if (qualityScores != null) {
      if (i < qualityScores.length) {
        toScore[0]=qualityScores[i];
      }
 else {
        toScore=null;
      }
    }
    printTab(alignmentEntry,basename,positionOnReference + fromOffset,readIndex + toOffset,i < fromLength ? Character.toString(fromChar) : "String_Node_Str",i < toLength ? Character.toString(toChar) : "String_Node_Str",toScore);
    if (fromChar != '-') {
      fromOffset+=1;
    }
    if (toChar != '-') {
      toOffset+=readIndexIncrementValue;
    }
  }
}
}
}
break;
}
}