Program: 50430
Project: 50430
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()) {
          variations=true;
          final int positionOnReference=alignmentEntry.getPosition() + var.getPosition();
          final int referenceIndex=alignmentEntry.getTargetIndex();
          boolean keepVar=true;
          keepVar=determineKeepVariation(positionOnReference,referenceIndex,keepVar);
          if (keepVar) {
            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();
    boolean keepVar=true;
    keepVar=determineKeepVariation(positionOnReference,referenceIndex,keepVar);
    if (keepVar && !isAllNs(to)) {
      printTab(alignmentEntry,basename,positionOnReference,readIndex,from,to);
    }
  }
}
break;
case TAB_SINGLE_BASE:
{
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 fromLength=from.length();
final int toLength=to.length();
final int referenceIndex=alignmentEntry.getTargetIndex();
boolean keepVar=true;
keepVar=determineKeepVariation(positionOnReference,referenceIndex,keepVar);
if (keepVar && !isAllNs(to)) {
  variations=true;
  final int maxLength=Math.max(fromLength,toLength);
  for (int i=0; i < maxLength; i++) {
    final int offset=+i * (alignmentEntry.getMatchingReverseStrand() ? -1 : 1);
    printTab(alignmentEntry,basename,positionOnReference + offset,readIndex + offset,i < fromLength ? from.substring(i,i + 1) : "String_Node_Str",i < toLength ? to.substring(i,i + 1) : "String_Node_Str");
  }
}
}
}
break;
}
}

Fixed version (ground truth):
@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()) {
          variations=true;
          final int positionOnReference=alignmentEntry.getPosition() + var.getPosition();
          final int referenceIndex=alignmentEntry.getTargetIndex();
          boolean keepVar=true;
          keepVar=determineKeepVariation(positionOnReference,referenceIndex,keepVar);
          if (keepVar) {
            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();
    boolean keepVar=true;
    keepVar=determineKeepVariation(positionOnReference,referenceIndex,keepVar);
    if (keepVar && !isAllNs(to)) {
      printTab(alignmentEntry,basename,positionOnReference,readIndex,from,to);
    }
  }
}
break;
case TAB_SINGLE_BASE:
{
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 fromLength=from.length();
final int toLength=to.length();
final int referenceIndex=alignmentEntry.getTargetIndex();
boolean keepVar=true;
keepVar=determineKeepVariation(positionOnReference,referenceIndex,keepVar);
if (keepVar && !isAllNs(to)) {
  variations=true;
  final int maxLength=Math.max(fromLength,toLength);
  int offset=-1;
  for (int i=0; i < maxLength; i++) {
    char toChar=var.getTo().charAt(i);
    offset+=toChar == '-' ? 0 : (alignmentEntry.getMatchingReverseStrand() ? -1 : 1);
    printTab(alignmentEntry,basename,positionOnReference + offset,readIndex + offset,i < fromLength ? from.substring(i,i + 1) : "String_Node_Str",i < toLength ? to.substring(i,i + 1) : "String_Node_Str");
  }
}
}
}
break;
}
}