nus-yam/ex-repair huggingface dataset:
Program: 50437
Project: 50437
Buggy source:
public abstract void observeReferenceBase(ConcatSortedAlignmentReader sortedReaders,Alignments.AlignmentEntry alignmentEntry,Int2ObjectMap<T> positionToBases,int currentReferenceIndex,int currentRefPosition,int currentReadIndex);

Fixed version (ground truth):
/** 
 * Implement this call-back method to observe reference bases.
 * @param sortedReaders The concat read that contains the variation.
 * @param alignmentEntry The alignment entry that contains the variation
 * @param positionToBases Map keyed by reference position, used to accumulate information for each position.
 * @param currentReferenceIndex Index of the reference sequence where the variant occurs.
 * @param currentRefPosition Position where the variant occurs in the reference.
 * @param currentReadIndex Index in the read where the variant occurs.
 */
public abstract void observeReferenceBase(ConcatSortedAlignmentReader sortedReaders,Alignments.AlignmentEntry alignmentEntry,Int2ObjectMap<T> positionToBases,int currentReferenceIndex,int currentRefPosition,int currentReadIndex);
Program: 50438
Project: 50438
Buggy source:
public abstract void observeVariantBase(ConcatSortedAlignmentReader sortedReaders,Alignments.AlignmentEntry alignmentEntry,Int2ObjectMap<T> positionToBases,Alignments.SequenceVariation var,char toChar,char fromChar,int currentReferenceIndex,int currentRefPosition,int currentReadIndex);

Fixed version (ground truth):
/** 
 * Implement this call-back method to observe variant bases.
 * @param sortedReaders The concat read that contains the variation.
 * @param alignmentEntry The alignment entry that contains the variation
 * @param positionToBases Map keyed by reference position, used to accumulate information for each position.
 * @param var The sequence variation from the alignment entry that triggered emiting this observation.
 * @param toChar The base character in the read
 * @param fromChar The base character in the reference.
 * @param currentReferenceIndex Index of the reference sequence where the variant occurs.
 * @param currentRefPosition Position where the variant occurs in the reference.
 * @param currentReadIndex Index in the read where the variant occurs.
 */
public abstract void observeVariantBase(ConcatSortedAlignmentReader sortedReaders,Alignments.AlignmentEntry alignmentEntry,Int2ObjectMap<T> positionToBases,Alignments.SequenceVariation var,char toChar,char fromChar,int currentReferenceIndex,int currentRefPosition,int currentReadIndex);
Program: 50439
Project: 50439
Buggy source:
public void observeVariantBase(ConcatSortedAlignmentReader sortedReaders,Alignments.AlignmentEntry alignmentEntry,Int2ObjectMap<ObjectArrayList<PositionBaseInfo>> positionToBases,Alignments.SequenceVariation var,char toChar,char fromChar,int currentReferenceIndex,int currentRefPosition,int currentReadIndex){
  PositionBaseInfo info=new PositionBaseInfo();
  info.readerIndex=sortedReaders.activeIndex;
  info.readIndex=currentReadIndex;
  info.from=fromChar;
  info.to=toChar;
  info.matchesReference=false;
  info.position=currentRefPosition;
  addToFuture(positionToBases,info);
}

Fixed version (ground truth):
public void observeVariantBase(ConcatSortedAlignmentReader sortedReaders,Alignments.AlignmentEntry alignmentEntry,Int2ObjectMap<ObjectArrayList<IterateSortedAlignmentsListImpl.PositionBaseInfo>> positionToBases,Alignments.SequenceVariation var,char toChar,char fromChar,int currentReferenceIndex,int currentRefPosition,int currentReadIndex){
  PositionBaseInfo info=new PositionBaseInfo();
  info.readerIndex=sortedReaders.activeIndex;
  info.readIndex=currentReadIndex;
  info.from=fromChar;
  info.to=toChar;
  info.matchesReference=false;
  info.position=currentRefPosition;
  addToFuture(positionToBases,info);
}
Program: 50440
Project: 50440
Buggy source:
public void observeReferenceBase(ConcatSortedAlignmentReader sortedReaders,Alignments.AlignmentEntry alignmentEntry,Int2ObjectMap<ObjectArrayList<PositionBaseInfo>> positionToBases,int currentReferenceIndex,int currentRefPosition,int currentReadIndex){
  PositionBaseInfo info=new PositionBaseInfo();
  info.readerIndex=sortedReaders.activeIndex;
  info.readIndex=currentReadIndex;
  info.from='\0';
  info.to='\0';
  info.matchesReference=true;
  info.position=currentRefPosition;
  info.qualityScore=40;
  addToFuture(positionToBases,info);
}

Fixed version (ground truth):
public void observeReferenceBase(ConcatSortedAlignmentReader sortedReaders,Alignments.AlignmentEntry alignmentEntry,Int2ObjectMap<ObjectArrayList<IterateSortedAlignmentsListImpl.PositionBaseInfo>> positionToBases,int currentReferenceIndex,int currentRefPosition,int currentReadIndex){
  PositionBaseInfo info=new PositionBaseInfo();
  info.readerIndex=sortedReaders.activeIndex;
  info.readIndex=currentReadIndex;
  info.from='\0';
  info.to='\0';
  info.matchesReference=true;
  info.position=currentRefPosition;
  info.qualityScore=40;
  addToFuture(positionToBases,info);
}
Program: 50443
Project: 50443
Buggy source:
@Override public void observeVariantBase(ConcatSortedAlignmentReader sortedReaders,Alignments.AlignmentEntry alignmentEntry,Int2ObjectMap<ObjectArrayList<PositionBaseInfo>> positionToBases,Alignments.SequenceVariation var,char toChar,char fromChar,int currentReferenceIndex,int currentRefPosition,int currentReadIndex){
  variantReadIndices.add(currentReadIndex);
}

Fixed version (ground truth):
@Override public void observeVariantBase(ConcatSortedAlignmentReader sortedReaders,Alignments.AlignmentEntry alignmentEntry,Int2ObjectMap<ObjectArrayList<IterateSortedAlignmentsListImpl.PositionBaseInfo>> positionToBases,Alignments.SequenceVariation var,char toChar,char fromChar,int currentReferenceIndex,int currentRefPosition,int currentReadIndex){
  variantReadIndices.add(currentReadIndex);
}
Program: 50444
Project: 50444
Buggy source:
private byte[] trimQualityScores(byte[] qualityScores,int trimReadStartLength,int trimReadLength,int initialLength){
  byte[] trimmedScores=new byte[Math.min(initialLength,trimReadLength) - trimReadStartLength];
  int trimmedIndex=0;
  for (int i=0; i < Math.min(initialLength,trimReadLength); i++) {
    if (i > trimReadStartLength) {
      trimmedScores[trimmedIndex]=qualityScores[i];
    }
 else {
      if (i > trimReadLength)       return trimmedScores;
    }
    trimmedIndex++;
  }
  return trimmedScores;
}

Fixed version (ground truth):
private byte[] trimQualityScores(byte[] qualityScores,int trimReadStartLength,int trimReadLength,int initialLength){
  if (qualityScores == null)   return null;
  byte[] trimmedScores=new byte[Math.min(initialLength,trimReadLength) - trimReadStartLength];
  int trimmedIndex=0;
  for (int i=0; i < Math.min(initialLength,trimReadLength); i++) {
    if (i >= trimReadStartLength) {
      trimmedScores[trimmedIndex]=qualityScores[i];
    }
 else {
      if (i > trimReadLength)       return trimmedScores;
    }
    trimmedIndex++;
  }
  return trimmedScores;
}
Program: 50445
Project: 50445
Buggy source:
private CharSequence byteToString(final byte[] input){
  final MutableString buffer=new MutableString();
  for (int i=0; i < buffer.length(); i++) {
    buffer.setCharAt(i,(char)input[i]);
  }
  return buffer;
}

Fixed version (ground truth):
private CharSequence byteToString(final byte[] input){
  final MutableString buffer=new MutableString();
  buffer.setLength(input.length);
  for (int i=0; i < input.length; i++) {
    buffer.setCharAt(i,(char)input[i]);
  }
  return buffer;
}
Program: 50446
Project: 50446
Buggy source:
/** 
 * Display sequence variations.
 * @throws java.io.IOException error reading / writing
 */
@Override public void execute() throws IOException {
  final ReadsWriter writer=new ReadsWriter(new FileOutputStream(outputFilename));
  try {
    final ProgressLogger progress=new ProgressLogger(LOG);
    final SAMFileReader parser=new SAMFileReader(new File(inputFilename));
    parser.setValidationStringency(SAMFileReader.ValidationStringency.SILENT);
    progress.start();
    for (    final SAMRecord samRecord : parser) {
      final String readId=samRecord.getReadName();
      writer.setIdentifier(readId);
      writer.setSequence(byteToString(samRecord.getReadBases()));
      writer.setQualityScores(remove33(samRecord.getReadBases()));
      writer.appendEntry();
      progress.lightUpdate();
    }
  }
  finally {
    writer.close();
  }
}

Fixed version (ground truth):
/** 
 * Display sequence variations.
 * @throws java.io.IOException error reading / writing
 */
@Override public void execute() throws IOException {
  final ReadsWriter writer=new ReadsWriter(new FileOutputStream(outputFilename));
  try {
    final ProgressLogger progress=new ProgressLogger(LOG);
    final SAMFileReader parser=new SAMFileReader(new File(inputFilename));
    parser.setValidationStringency(SAMFileReader.ValidationStringency.SILENT);
    progress.start();
    for (    final SAMRecord samRecord : parser) {
      final String readId=samRecord.getReadName();
      writer.setIdentifier(readId);
      writer.setSequence(byteToString(samRecord.getReadBases()));
      writer.setQualityScores(remove33(samRecord.getBaseQualities()));
      writer.appendEntry();
      progress.lightUpdate();
    }
  }
  finally {
    writer.close();
  }
}
Program: 50448
Project: 50448
Buggy source:
/** 
 * Returns the next alignment entry from the input stream.
 * @return the alignment read entry from the input stream.
 */
public Alignments.AlignmentEntry next(){
  if (!alignmentEntryReader.hasNext(collection,numberOfEntries())) {
    throw new NoSuchElementException();
  }
  return collection.getAlignmentEntries(alignmentEntryReader.incrementEntryIndex());
}

Fixed version (ground truth):
/** 
 * Returns the next alignment entry from the input stream.
 * @return the alignment read entry from the input stream.
 */
public Alignments.AlignmentEntry next(){
  if (!hasNext()) {
    throw new NoSuchElementException();
  }
  try {
    return nextEntry;
  }
  finally {
    alignmentEntryReader.incrementEntryIndex();
    nextEntry=null;
  }
}
Program: 50449
Project: 50449
Buggy source:
/** 
 * Returns true if the input has more entries.
 * @return true if the input has more entries, false otherwise.
 */
public boolean hasNext(){
  final boolean hasNext=alignmentEntryReader.hasNext(collection,numberOfEntries());
  if (!hasNext) {
    collection=null;
  }
  final GZIPInputStream uncompressStream=alignmentEntryReader.getUncompressStream();
  try {
    if (uncompressStream != null) {
      collection=Alignments.AlignmentCollection.parseFrom(uncompressStream);
      if (collection.getAlignmentEntriesCount() == 0) {
        return false;
      }
    }
  }
 catch (  IOException e) {
    throw new GobyRuntimeException(e);
  }
  return hasNext;
}

Fixed version (ground truth):
/** 
 * Returns true if the input has more entries.
 * @return true if the input has more entries, false otherwise.
 */
public boolean hasNext(){
  if (nextEntry != null) {
    return true;
  }
  final boolean hasNext=alignmentEntryReader.hasNext(collection,numberOfEntries());
  if (!hasNext) {
    collection=null;
  }
  final GZIPInputStream uncompressStream=alignmentEntryReader.getUncompressStream();
  try {
    if (uncompressStream != null) {
      collection=Alignments.AlignmentCollection.parseFrom(uncompressStream);
      if (collection.getAlignmentEntriesCount() == 0) {
        return false;
      }
    }
  }
 catch (  IOException e) {
    throw new GobyRuntimeException(e);
  }
  if (collection == null)   return false;
  nextEntry=collection.getAlignmentEntries(alignmentEntryReader.getEntryIndex());
  final int entryTargetIndex=nextEntry.getTargetIndex();
  if (entryTargetIndex > endReferenceIndex || (entryTargetIndex == endReferenceIndex && nextEntry.getPosition() > endPosition)) {
    nextEntry=null;
    return false;
  }
  return hasNext;
}
Program: 50450
Project: 50450
Buggy source:
private void repositionInternal(final int targetIndex,final int position) throws IOException {
  if (!indexLoaded) {
    return;
  }
  final int absolutePosition=recodePosition(targetIndex,position);
  int offsetIndex=Arrays.binarySearch(indexAbsolutePositions.elements(),absolutePosition);
  offsetIndex=offsetIndex < 0 ? -1 - offsetIndex : offsetIndex;
  offsetIndex=offsetIndex >= indexOffsets.size() ? indexOffsets.size() - 1 : offsetIndex;
  if (offsetIndex < 0) {
    return;
  }
  final long newPosition=indexOffsets.getLong(offsetIndex);
  final long currentPosition=alignmentEntryReader.position();
  if (newPosition > currentPosition) {
    alignmentEntryReader.seek(newPosition);
  }
}

Fixed version (ground truth):
private void repositionInternal(final int targetIndex,final int position) throws IOException {
  if (!indexLoaded) {
    return;
  }
  final int absolutePosition=recodePosition(targetIndex,position);
  int offsetIndex=Arrays.binarySearch(indexAbsolutePositions.elements(),absolutePosition);
  offsetIndex=offsetIndex < 0 ? -1 - offsetIndex : offsetIndex;
  offsetIndex=offsetIndex >= indexOffsets.size() ? indexOffsets.size() - 1 : offsetIndex - 1;
  if (offsetIndex < 0) {
    return;
  }
  final long newPosition=indexOffsets.getLong(offsetIndex);
  final long currentPosition=alignmentEntryReader.position();
  if (newPosition > currentPosition) {
    alignmentEntryReader.seek(newPosition);
  }
}
Program: 50451
Project: 50451
Buggy source:
private void reposition(final long start,final long end) throws IOException {
  input.position(start);
  int b;
  int contiguousZeroBytes=0;
  int skipped=0;
  long position=0;
  while (position < end && (b=input.read()) != -1) {
    if (b == MessageChunksWriter.DELIMITER_CONTENT) {
      contiguousZeroBytes++;
    }
 else {
      contiguousZeroBytes=0;
    }
    ++skipped;
    if (contiguousZeroBytes == MessageChunksWriter.DELIMITER_LENGTH) {
      in=new DataInputStream(input);
      final long seekPosition=start + skipped - contiguousZeroBytes;
      input.position(seekPosition);
      break;
    }
    position=start + skipped;
  }
}

Fixed version (ground truth):
private void reposition(final long start,final long end) throws IOException {
  input.position(start);
  int b;
  int contiguousZeroBytes=0;
  long skipped=0;
  long position=0;
  while (position < end && (b=input.read()) != -1) {
    if (b == MessageChunksWriter.DELIMITER_CONTENT) {
      contiguousZeroBytes++;
    }
 else {
      contiguousZeroBytes=0;
    }
    ++skipped;
    if (contiguousZeroBytes == MessageChunksWriter.DELIMITER_LENGTH) {
      in=new DataInputStream(input);
      final long seekPosition=start + skipped - contiguousZeroBytes;
      input.position(seekPosition);
      break;
    }
    position=start + skipped;
  }
}
Program: 50453
Project: 50453
Buggy source:
public void observeVariantBase(ConcatSortedAlignmentReader sortedReaders,Int2ObjectMap<CountsAtPosition> positionToBases,Alignments.SequenceVariation var,char toChar,char fromChar,int currentRefPosition,int currentReadIndex){
  final int readIndex=var.getReadIndex();
  maxReadIndex=Math.max(maxReadIndex,readIndex);
  int count=readIndexVariationTally[readIndex];
  readIndexVariationTally[readIndex]=count + 1;
}

Fixed version (ground truth):
public void observeVariantBase(ConcatSortedAlignmentReader sortedReaders,Int2ObjectMap<CountsAtPosition> positionToBases,Alignments.SequenceVariation var,char toChar,char fromChar,int currentRefPosition,int currentReadIndex){
  maxReadIndex=Math.max(maxReadIndex,currentReadIndex);
  int count=readIndexVariationTally[currentReadIndex];
  readIndexVariationTally[currentReadIndex]=count + 1;
}
Program: 50454
Project: 50454
Buggy source:
@Override public void processAlignmentEntry(final AlignmentReader alignmentReader,final Alignments.AlignmentEntry alignmentEntry){
  System.out.printf("String_Node_Str",alignmentEntry.getQueryIndex(),alignmentEntry.getTargetIndex(),getReferenceId(alignmentEntry.getTargetIndex()),alignmentEntry.getScore());
}

Fixed version (ground truth):
@Override public void processAlignmentEntry(final AlignmentReader alignmentReader,final Alignments.AlignmentEntry alignmentEntry){
  System.out.printf("String_Node_Str" + "String_Node_Str",alignmentEntry.getQueryIndex(),alignmentEntry.getTargetIndex(),getReferenceId(alignmentEntry.getTargetIndex()),alignmentEntry.getScore());
}
Program: 50456
Project: 50456
Buggy source:
private Alignments.AlignmentEntry.Builder prepareAlignmentEntry(final int queryIndex,final int targetIndex,final int position,final float score,final boolean matchesReverseStrand,int[] variationIndices){
  Alignments.AlignmentEntry.Builder newEntry=Alignments.AlignmentEntry.newBuilder();
  newEntry.setQueryIndex(queryIndex);
  newEntry.setTargetIndex(targetIndex);
  newEntry.setScore(score);
  newEntry.setPosition(position);
  newEntry.setMatchingReverseStrand(matchesReverseStrand);
  newEntry.setMultiplicity(1);
  newEntry.setQueryLength(35);
  for (  int variaIndex : variationIndices) {
    Alignments.SequenceVariation.Builder varBuilder=Alignments.SequenceVariation.newBuilder();
    varBuilder.setFrom("String_Node_Str");
    varBuilder.setTo("String_Node_Str");
    varBuilder.setReadIndex(1);
    varBuilder.setPosition(variaIndex);
    newEntry.addSequenceVariations(varBuilder.build());
  }
  return newEntry;
}

Fixed version (ground truth):
private Alignments.AlignmentEntry.Builder prepareAlignmentEntry(final int queryIndex,final int targetIndex,final int position,final float score,final boolean matchesReverseStrand,int[] variationIndices,int queryLength){
  Alignments.AlignmentEntry.Builder newEntry=Alignments.AlignmentEntry.newBuilder();
  newEntry.setQueryIndex(queryIndex);
  newEntry.setTargetIndex(targetIndex);
  newEntry.setScore(score);
  newEntry.setPosition(position);
  newEntry.setMatchingReverseStrand(matchesReverseStrand);
  newEntry.setMultiplicity(1);
  newEntry.setQueryLength(queryLength);
  for (  int variaIndex : variationIndices) {
    Alignments.SequenceVariation.Builder varBuilder=Alignments.SequenceVariation.newBuilder();
    varBuilder.setFrom("String_Node_Str");
    varBuilder.setTo("String_Node_Str");
    varBuilder.setReadIndex(1);
    varBuilder.setPosition(variaIndex);
    newEntry.addSequenceVariations(varBuilder.build());
  }
  return newEntry;
}
Program: 50461
Project: 50461
Buggy source:
/** 
 * Configure.
 * @param args command line arguments
 * @return this object for chaining
 * @throws java.io.IOException error parsing
 * @throws com.martiansoftware.jsap.JSAPException error parsing
 */
@Override public AbstractCommandLineMode configure(final String[] args) throws IOException, JSAPException {
  final JSAPResult jsapResult=parseJsapArguments(args);
  final String inputFile=jsapResult.getString("String_Node_Str");
  basename=AlignmentReader.getBasename(inputFile);
  outputFilename=jsapResult.getString("String_Node_Str");
  alignmentIterator=new SortIterateAlignments();
  alignmentIterator.parseIncludeReferenceArgument(jsapResult);
  if (jsapResult.contains("String_Node_Str") || jsapResult.contains("String_Node_Str")) {
    hasStartOrEndPosition=true;
    startPosition=jsapResult.getLong("String_Node_Str",0L);
    endPosition=jsapResult.getLong("String_Node_Str",Long.MAX_VALUE);
  }
  if (startPosition < 0L) {
    throw new JSAPException("String_Node_Str");
  }
  if (endPosition < 0L) {
    throw new JSAPException("String_Node_Str");
  }
  if (startPosition > endPosition) {
    throw new JSAPException("String_Node_Str");
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Configure.
 * @param args command line arguments
 * @return this object for chaining
 * @throws java.io.IOException error parsing
 * @throws com.martiansoftware.jsap.JSAPException error parsing
 */
@Override public AbstractCommandLineMode configure(final String[] args) throws IOException, JSAPException {
  final JSAPResult jsapResult=parseJsapArguments(args);
  final String inputFile=jsapResult.getString("String_Node_Str");
  basename=AlignmentReader.getBasename(inputFile);
  outputFilename=jsapResult.getString("String_Node_Str");
  alignmentIterator=new SortIterateAlignments();
  alignmentIterator.parseIncludeReferenceArgument(jsapResult);
  endPosition=Long.MAX_VALUE;
  if (jsapResult.contains("String_Node_Str") || jsapResult.contains("String_Node_Str")) {
    hasStartOrEndPosition=true;
    startPosition=jsapResult.getLong("String_Node_Str",0L);
    endPosition=jsapResult.getLong("String_Node_Str",Long.MAX_VALUE);
  }
  if (startPosition < 0L) {
    throw new JSAPException("String_Node_Str");
  }
  if (endPosition < 0L) {
    throw new JSAPException("String_Node_Str");
  }
  if (startPosition > endPosition) {
    throw new JSAPException("String_Node_Str");
  }
  return this;
}
Program: 50462
Project: 50462
Buggy source:
/** 
 * Returns whether this read has query lentgh information.
 * @return True or false.
 */
public boolean hasQueryLengths(){
  if (constantQueryLengths) {
    return true;
  }
 else {
    return queryLengths != null;
  }
}

Fixed version (ground truth):
/** 
 * Returns whether this read has query length information.
 * @return True or false.
 */
public boolean hasQueryLengths(){
  return ArrayUtils.isNotEmpty(queryLengths);
}
Program: 50463
Project: 50463
Buggy source:
private void writeHeader() throws IOException {
  if (!headerWritten) {
    final Alignments.AlignmentHeader.Builder headerBuilder=Alignments.AlignmentHeader.newBuilder();
    headerBuilder.setLargestSplitQueryIndex(maxQueryIndex);
    headerBuilder.setSmallestSplitQueryIndex(minQueryIndex);
    headerBuilder.setNumberOfTargets(maxTargetIndex + 1);
    headerBuilder.setNumberOfQueries(getNumQueries());
    headerBuilder.setSorted(sortedState);
    headerBuilder.setIndexed(sortedState);
    headerBuilder.setQueryNameMapping(getMapping(queryIdentifiers,queryIdentifiersArray));
    headerBuilder.setTargetNameMapping(getMapping(targetIdentifiers,targetIdentifiersArray));
    headerBuilder.setNumberOfAlignedReads(numberOfAlignedReads);
    compactQueryLengths(queryLengths);
    if (isConstantQueryLength) {
      headerBuilder.setConstantQueryLength(constantQueryLength);
    }
 else     if (queryLengths != null) {
      headerBuilder.addAllQueryLength(IntArrayList.wrap(queryLengths));
    }
    if (targetLengths != null) {
      headerBuilder.addAllTargetLength(IntArrayList.wrap(targetLengths));
    }
    headerBuilder.build().writeTo(headerOutput);
    headerWritten=true;
  }
}

Fixed version (ground truth):
private void writeHeader() throws IOException {
  if (!headerWritten) {
    final Alignments.AlignmentHeader.Builder headerBuilder=Alignments.AlignmentHeader.newBuilder();
    headerBuilder.setLargestSplitQueryIndex(maxQueryIndex);
    headerBuilder.setSmallestSplitQueryIndex(minQueryIndex);
    headerBuilder.setNumberOfTargets(maxTargetIndex + 1);
    headerBuilder.setNumberOfQueries(getNumQueries());
    headerBuilder.setSorted(sortedState);
    headerBuilder.setIndexed(sortedState);
    headerBuilder.setQueryNameMapping(getMapping(queryIdentifiers,queryIdentifiersArray));
    headerBuilder.setTargetNameMapping(getMapping(targetIdentifiers,targetIdentifiersArray));
    headerBuilder.setNumberOfAlignedReads(numberOfAlignedReads);
    compactQueryLengths();
    if (isConstantQueryLength) {
      headerBuilder.setConstantQueryLength(constantQueryLength);
    }
 else     if (queryLengths != null) {
      headerBuilder.addAllQueryLength(IntArrayList.wrap(queryLengths));
    }
    if (targetLengths != null) {
      headerBuilder.addAllTargetLength(IntArrayList.wrap(targetLengths));
    }
    headerBuilder.build().writeTo(headerOutput);
    headerWritten=true;
  }
}
Program: 50464
Project: 50464
Buggy source:
public void setQueryLength(int queryLength){
  newEntry.setQueryLength(queryLength);
}

Fixed version (ground truth):
/** 
 * Set the query legnth for the next alignment extry.
 * @param queryLength The query length of the next alignment entry to append
 * @deprecated use{@link #appendEntry(edu.cornell.med.icb.goby.alignments.Alignments.AlignmentEntry)}.
 */
@Deprecated public void setQueryLength(final int queryLength){
  newEntry.setQueryLength(queryLength);
}
Program: 50465
Project: 50465
Buggy source:
public final void setQueryIndex(final int queryIndex){
  newEntry.setQueryIndex(queryIndex);
}

Fixed version (ground truth):
/** 
 * Set the query index for the next alignment extry.
 * @param queryIndex The query index of the next alignment entry to append
 * @deprecated use{@link #appendEntry(edu.cornell.med.icb.goby.alignments.Alignments.AlignmentEntry)}.
 */
@Deprecated public final void setQueryIndex(final int queryIndex){
  newEntry.setQueryIndex(queryIndex);
}
Program: 50466
Project: 50466
Buggy source:
public final void setAlignmentScore(final float score){
  newEntry.setScore(score);
}

Fixed version (ground truth):
/** 
 * Set the score for the next alignment extry.
 * @param score The score of the next alignment entry to append
 * @deprecated use{@link #appendEntry(edu.cornell.med.icb.goby.alignments.Alignments.AlignmentEntry)}.
 */
@Deprecated public final void setAlignmentScore(final float score){
  newEntry.setScore(score);
}
Program: 50467
Project: 50467
Buggy source:
public void setQueryLengths(int[] queryLengths){
}

Fixed version (ground truth):
public void setQueryLengths(final int[] queryLengths){
}
Program: 50468
Project: 50468
Buggy source:
private void writeIndexEntry(Alignments.AlignmentEntry builtEntry) throws IOException {
  if (firstEntryInChunk) {
    firstTargetIndexInChunk=builtEntry.getTargetIndex();
    firstPositionInChunk=builtEntry.getPosition();
    firstEntryInChunk=false;
  }
  int currentChunkOffset=entriesChunkWriter.writeAsNeeded(collectionBuilder,builtEntry.getMultiplicity());
  if (sortedState && currentChunkOffset != previousChunkOffset) {
    pushIndex(previousChunkOffset,firstTargetIndexInChunk,firstPositionInChunk);
    previousChunkOffset=currentChunkOffset;
    firstEntryInChunk=true;
  }
 else {
    firstEntryInChunk=false;
  }
}

Fixed version (ground truth):
private void writeIndexEntry(final Alignments.AlignmentEntry builtEntry) throws IOException {
  if (firstEntryInChunk) {
    firstTargetIndexInChunk=builtEntry.getTargetIndex();
    firstPositionInChunk=builtEntry.getPosition();
    firstEntryInChunk=false;
  }
  final int currentChunkOffset=entriesChunkWriter.writeAsNeeded(collectionBuilder,builtEntry.getMultiplicity());
  if (sortedState && currentChunkOffset != previousChunkOffset) {
    pushIndex(previousChunkOffset,firstTargetIndexInChunk,firstPositionInChunk);
    previousChunkOffset=currentChunkOffset;
    firstEntryInChunk=true;
  }
 else {
    firstEntryInChunk=false;
  }
}
Program: 50469
Project: 50469
Buggy source:
/** 
 * {@inheritDoc}
 */
public void close() throws IOException {
  if (sortedState)   writeIndex();
  writeHeader();
  writeStats();
  IOUtils.closeQuietly(headerOutput);
  entriesChunkWriter.close(collectionBuilder);
  IOUtils.closeQuietly(alignmentEntries);
  IOUtils.closeQuietly(statsWriter);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void close() throws IOException {
  if (sortedState) {
    writeIndex();
  }
  writeHeader();
  writeStats();
  IOUtils.closeQuietly(headerOutput);
  entriesChunkWriter.close(collectionBuilder);
  IOUtils.closeQuietly(alignmentEntries);
  IOUtils.closeQuietly(statsWriter);
}
Program: 50470
Project: 50470
Buggy source:
public void setLargestSplitQueryIndex(int largestQueryIndex){
  maxQueryIndex=largestQueryIndex;
}

Fixed version (ground truth):
public void setLargestSplitQueryIndex(final int largestQueryIndex){
  maxQueryIndex=largestQueryIndex;
}
Program: 50471
Project: 50471
Buggy source:
public void setSorted(boolean sortedState){
  this.sortedState=sortedState;
  if (sortedState) {
    if (targetPositionOffsets == null) {
      throw new UnsupportedOperationException("String_Node_Str" + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void setSorted(final boolean sortedState){
  this.sortedState=sortedState;
  if (sortedState) {
    if (targetPositionOffsets == null) {
      throw new UnsupportedOperationException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
  }
}
Program: 50472
Project: 50472
Buggy source:
public final void setTargetPosition(final int position){
  newEntry.setPosition(position);
}

Fixed version (ground truth):
/** 
 * Set the target position for the next alignment extry.
 * @param position The target position of the next alignment entry to append
 * @deprecated use{@link #appendEntry(edu.cornell.med.icb.goby.alignments.Alignments.AlignmentEntry)}.
 */
@Deprecated public final void setTargetPosition(final int position){
  newEntry.setPosition(position);
}
Program: 50473
Project: 50473
Buggy source:
private void pushIndex(int previousChunkOffset,int firstTargetIndexInChunk,int firstPositionInChunk){
  final int newOffset=Math.max(previousChunkOffset - 8,0);
  final int size=indexOffsets.size();
  if (size == 0 || newOffset != indexOffsets.get(size - 1)) {
    indexOffsets.add(newOffset);
    final long codedPosition=recodePosition(firstTargetIndexInChunk,firstPositionInChunk);
    indexAbsolutePositions.add(codedPosition);
  }
}

Fixed version (ground truth):
private void pushIndex(final int previousChunkOffset,final int firstTargetIndexInChunk,final int firstPositionInChunk){
  final int newOffset=Math.max(previousChunkOffset - 8,0);
  final int size=indexOffsets.size();
  if (size == 0 || newOffset != indexOffsets.get(size - 1)) {
    indexOffsets.add(newOffset);
    final long codedPosition=recodePosition(firstTargetIndexInChunk,firstPositionInChunk);
    indexAbsolutePositions.add(codedPosition);
  }
}
Program: 50474
Project: 50474
Buggy source:
/** 
 * Obtain the alignment entry that is being prepared. Set values on the entry, then call appendAlignmentEntry()
 * @return the current alignment entry.
 */
public Alignments.AlignmentEntry.Builder getAlignmentEntry(){
  return newEntry;
}

Fixed version (ground truth):
/** 
 * Obtain the alignment entry that is being prepared. Set values on the entry, then call   {@link #appendEntry()}.
 * @return the current alignment entry.
 * @deprecated use{@link #appendEntry(edu.cornell.med.icb.goby.alignments.Alignments.AlignmentEntry)}.
 */
@Deprecated public Alignments.AlignmentEntry.Builder getAlignmentEntry(){
  return newEntry;
}
Program: 50475
Project: 50475
Buggy source:
public final void setAlignmentEntry(final int queryIndex,final int referenceIndex,final int position,final float score,final boolean matchesReverseStrand){
  newEntry.setQueryIndex(queryIndex);
  newEntry.setTargetIndex(referenceIndex);
  newEntry.setScore(score);
  newEntry.setPosition(position);
  newEntry.setMatchingReverseStrand(matchesReverseStrand);
  newEntry.setMultiplicity(1);
}

Fixed version (ground truth):
/** 
 * Set fields for the next alignment extry.
 * @param queryIndex The query index of the next alignment entry to append
 * @param targetIndex The target index of the next alignment entry to append
 * @param position The target position of the next alignment entry to append
 * @param score The score of the next alignment entry to append
 * @param matchesReverseStrand true if the entry matches the reverse strand
 * @deprecated use{@link #appendEntry(edu.cornell.med.icb.goby.alignments.Alignments.AlignmentEntry)}.
 */
@Deprecated public final void setAlignmentEntry(final int queryIndex,final int targetIndex,final int position,final float score,final boolean matchesReverseStrand){
  newEntry.setQueryIndex(queryIndex);
  newEntry.setTargetIndex(targetIndex);
  newEntry.setScore(score);
  newEntry.setPosition(position);
  newEntry.setMatchingReverseStrand(matchesReverseStrand);
  newEntry.setMultiplicity(1);
}
Program: 50476
Project: 50476
Buggy source:
/** 
 * Replace queryLength with constantQueryLength where the length is the same for all queries. Use a smaller queryLength array if we are storing just a slice of a larger alignment. In this case, the smaller array has size (maxQueryIndex-minQueryIndex+1)
 * @param queryLengths An array of integers where each element indicates the length of a query
 */
private void compactQueryLengths(final int[] queryLengths){
  if (queryLengths == null) {
    return;
  }
  final IntSet uniqueLengths=new IntOpenHashSet();
  for (  final int length : queryLengths) {
    if (length != 0) {
      uniqueLengths.add(length);
    }
  }
  if (uniqueLengths.size() == 1) {
    constantQueryLength=uniqueLengths.iterator().nextInt();
    isConstantQueryLength=true;
    this.queryLengths=null;
  }
 else {
    if (actualNumberOfQueries != Integer.MIN_VALUE) {
      int smallerLength=maxQueryIndex - minQueryIndex + 1;
      if (smallerLength != getNumQueries()) {
        int[] smaller=new int[smallerLength];
        System.arraycopy(queryLengths,minQueryIndex,smaller,0,smallerLength);
        this.queryLengths=smaller;
      }
    }
 else {
      this.queryLengths=queryLengths;
    }
  }
}

Fixed version (ground truth):
/** 
 * Replace queryLength with constantQueryLength where the length is the same for all queries. Use a smaller queryLength array if we are storing just a slice of a larger alignment. In this case, the smaller array has size (maxQueryIndex-minQueryIndex+1)
 */
private void compactQueryLengths(){
  if (uniqueQueryLengths.size() == 1) {
    if (queryLengths != null) {
      constantQueryLength=uniqueQueryLengths.iterator().nextInt();
    }
 else {
      constantQueryLength=0;
    }
    isConstantQueryLength=true;
    this.queryLengths=null;
  }
 else {
    if (queryLengths != null) {
      if (actualNumberOfQueries != Integer.MIN_VALUE) {
        final int smallerLength=maxQueryIndex - minQueryIndex + 1;
        if (smallerLength != getNumQueries()) {
          final int[] smaller=new int[smallerLength];
          System.arraycopy(queryLengths,minQueryIndex,smaller,0,smallerLength);
          this.queryLengths=smaller;
        }
      }
    }
  }
}
Program: 50477
Project: 50477
Buggy source:
public final void setTargetIndex(final int referenceIndex){
  newEntry.setTargetIndex(referenceIndex);
}

Fixed version (ground truth):
/** 
 * Set the target index for the next alignment extry.
 * @param targetIndex The target index of the next alignment entry to append
 * @deprecated use{@link #appendEntry(edu.cornell.med.icb.goby.alignments.Alignments.AlignmentEntry)}.
 */
@Deprecated public final void setTargetIndex(final int targetIndex){
  newEntry.setTargetIndex(targetIndex);
}
Program: 50478
Project: 50478
Buggy source:
public void setSmallestSplitQueryIndex(int smallestQueryIndex){
  minQueryIndex=smallestQueryIndex;
}

Fixed version (ground truth):
public void setSmallestSplitQueryIndex(final int smallestQueryIndex){
  minQueryIndex=smallestQueryIndex;
}
Program: 50480
Project: 50480
Buggy source:
/** 
 * Configure.
 * @param args command line arguments
 * @return this object for chaining
 * @throws java.io.IOException error parsing
 * @throws com.martiansoftware.jsap.JSAPException error parsing
 */
@Override public AbstractCommandLineMode configure(final String[] args) throws IOException, JSAPException {
  final JSAPResult jsapResult=parseJsapArguments(args);
  inputFiles=jsapResult.getStringArray("String_Node_Str");
  final ObjectSet<String> basenameSet=new ObjectOpenHashSet<String>();
  for (  final String inputFile : inputFiles) {
    basenameSet.add(AlignmentReader.getBasename(inputFile));
  }
  basenames=basenameSet.toArray(new String[basenameSet.size()]);
  statsFilename=jsapResult.getString("String_Node_Str");
  outputFile=jsapResult.getString("String_Node_Str");
  final String groupsDefinition=jsapResult.getString("String_Node_Str");
  deAnalyzer.parseGroupsDefinition(groupsDefinition,deCalculator,inputFiles);
  final String compare=jsapResult.getString("String_Node_Str");
  if (compare == null) {
    doComparison=false;
  }
 else {
    doComparison=true;
  }
  if (doComparison) {
    deAnalyzer.parseCompare(compare);
  }
  final String needCountsFiles=jsapResult.getString("String_Node_Str");
  normalizationMethods=deAnalyzer.parseNormalization(jsapResult);
  return this;
}

Fixed version (ground truth):
/** 
 * Configure.
 * @param args command line arguments
 * @return this object for chaining
 * @throws java.io.IOException error parsing
 * @throws com.martiansoftware.jsap.JSAPException error parsing
 */
@Override public AbstractCommandLineMode configure(final String[] args) throws IOException, JSAPException {
  final JSAPResult jsapResult=parseJsapArguments(args);
  inputFiles=jsapResult.getStringArray("String_Node_Str");
  final ObjectSet<String> basenameSet=new ObjectOpenHashSet<String>();
  for (  final String inputFile : inputFiles) {
    basenameSet.add(AlignmentReader.getBasename(inputFile));
  }
  basenames=basenameSet.toArray(new String[basenameSet.size()]);
  statsFilename=jsapResult.getString("String_Node_Str");
  outputFile=jsapResult.getString("String_Node_Str");
  final String groupsDefinition=jsapResult.getString("String_Node_Str");
  deAnalyzer.parseGroupsDefinition(groupsDefinition,deCalculator,inputFiles);
  final String compare=jsapResult.getString("String_Node_Str");
  if (compare == null) {
    doComparison=false;
  }
 else {
    doComparison=true;
  }
  if (doComparison) {
    deAnalyzer.parseCompare(compare);
  }
  normalizationMethods=deAnalyzer.parseNormalization(jsapResult);
  return this;
}
Program: 50481
Project: 50481
Buggy source:
/** 
 * Run the map2text mode.
 * @throws java.io.IOException error reading / writing
 */
@Override public void execute() throws IOException {
  for (  final String basename : basenames) {
    if (outputFile == null) {
      outputFile=basename;
    }
    outputFile+="String_Node_Str";
    processTranscriptAlignment(basename);
    outputFile=null;
  }
  if (doComparison) {
    final PrintWriter statsOutput=new PrintWriter(statsFilename);
    DifferentialExpressionResults results=null;
    results=deAnalyzer.evaluateDifferentialExpressionStatistics(deCalculator,doComparison,normalizationMethods);
    results.write(statsOutput,'\t',deCalculator);
    IOUtils.closeQuietly(statsOutput);
  }
}

Fixed version (ground truth):
/** 
 * Run the map2text mode.
 * @throws java.io.IOException error reading / writing
 */
@Override public void execute() throws IOException {
  for (  final String basename : basenames) {
    if (outputFile == null) {
      outputFile=basename;
    }
    outputFile+="String_Node_Str";
    processTranscriptAlignment(basename);
    outputFile=null;
  }
  if (doComparison) {
    PrintWriter statsOutput=null;
    try {
      statsOutput=new PrintWriter(statsFilename);
      final DifferentialExpressionResults results=deAnalyzer.evaluateDifferentialExpressionStatistics(deCalculator,doComparison,normalizationMethods);
      results.write(statsOutput,'\t',deCalculator);
    }
  finally {
      IOUtils.closeQuietly(statsOutput);
    }
  }
}
Program: 50482
Project: 50482
Buggy source:
public void write(final PrintWriter printWriter,final char delimiter,final InformativeColumns informativeColumns,final DifferentialExpressionCalculator deCalculator){
  printWriter.append(elementId);
  printWriter.append(delimiter);
  String elementType=deCalculator.getElementType(elementId).toString();
  printWriter.append(elementType);
  for (int i=0; i < statistics.size(); i++) {
    if (informativeColumns == null || informativeColumns.isColumnInformative(i)) {
      printWriter.append(delimiter);
      final double value=statistics.get(i);
      printWriter.append(String.format("String_Node_Str",value));
    }
  }
}

Fixed version (ground truth):
public void write(final Writer writer,final char delimiter,final InformativeColumns informativeColumns,final DifferentialExpressionCalculator deCalculator) throws IOException {
  writer.append(elementId);
  writer.append(delimiter);
  final String elementType=deCalculator.getElementType(elementId).toString();
  writer.append(elementType);
  for (int i=0; i < statistics.size(); i++) {
    if (informativeColumns == null || informativeColumns.isColumnInformative(i)) {
      writer.append(delimiter);
      final double value=statistics.get(i);
      writer.append(String.format("String_Node_Str",value));
    }
  }
}
Program: 50483
Project: 50483
Buggy source:
/** 
 * Write results with delimiter.
 * @param printWriter
 * @param delimiter
 * @param deCalculator
 */
public void write(final PrintWriter printWriter,final char delimiter,final DifferentialExpressionCalculator deCalculator){
  InformativeColumns informativeColumns=null;
  if (omitNonInformativeColumns) {
    informativeColumns=new InformativeColumns(sortedStatisticIds.size(),new InformativeNonZeroNonNaN());
    for (    final DifferentialExpressionInfo info : this.subList(0,size())) {
      if (info.checkInformativeColumns(informativeColumns)) {
        break;
      }
    }
  }
  printWriter.append("String_Node_Str");
  printWriter.append(delimiter);
  printWriter.append("String_Node_Str");
  for (int i=0; i < sortedStatisticIds.size(); i++) {
    if (informativeColumns == null || informativeColumns.isColumnInformative(i)) {
      printWriter.append(delimiter);
      printWriter.append(sortedStatisticIds.get(i));
    }
  }
  printWriter.append("String_Node_Str");
  for (  final DifferentialExpressionInfo info : this.subList(0,size())) {
    if (info.informative(getAverageCountPerGroupIndexes())) {
      info.write(printWriter,delimiter,informativeColumns,deCalculator);
      printWriter.append("String_Node_Str");
    }
  }
  printWriter.flush();
}

Fixed version (ground truth):
/** 
 * Write results with delimiter.
 * @param writer
 * @param delimiter
 * @param deCalculator
 */
public void write(final Writer writer,final char delimiter,final DifferentialExpressionCalculator deCalculator) throws IOException {
  InformativeColumns informativeColumns=null;
  if (omitNonInformativeColumns) {
    informativeColumns=new InformativeColumns(sortedStatisticIds.size(),new InformativeNonZeroNonNaN());
    for (    final DifferentialExpressionInfo info : this.subList(0,size())) {
      if (info.checkInformativeColumns(informativeColumns)) {
        break;
      }
    }
  }
  writer.append("String_Node_Str");
  writer.append(delimiter);
  writer.append("String_Node_Str");
  for (int i=0; i < sortedStatisticIds.size(); i++) {
    if (informativeColumns == null || informativeColumns.isColumnInformative(i)) {
      writer.append(delimiter);
      writer.append(sortedStatisticIds.get(i));
    }
  }
  writer.append("String_Node_Str");
  for (  final DifferentialExpressionInfo info : this.subList(0,size())) {
    if (info.informative(getAverageCountPerGroupIndexes())) {
      info.write(writer,delimiter,informativeColumns,deCalculator);
      writer.append("String_Node_Str");
    }
  }
  writer.flush();
}
Program: 50489
Project: 50489
Buggy source:
/** 
 * Constructor.
 * @param geneTranscriptFile the gene-transcripts-map file to read
 * @param kVal               the k value for the filter
 * @throws java.io.FileNotFoundException if the gene-transcripts-map didn't exist
 */
public TranscriptBestScoreAlignmentFilter(final String geneTranscriptFile,final int kVal,final int maxNumberOfReads) throws FileNotFoundException {
  transcriptFilter=new TranscriptsAlignmentFilter(geneTranscriptFile,kVal);
  bestScoreFilter=new BestScoreOnlyAlignmentFilter(kVal,maxNumberOfReads);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param geneTranscriptFile the gene-transcripts-map file to read
 * @param kVal               the k value for the filter
 * @param maxNumberOfReads   Maximum number of reads.
 * @throws java.io.FileNotFoundException if the gene-transcripts-map didn't exist
 */
public TranscriptBestScoreAlignmentFilter(final String geneTranscriptFile,final int kVal,final int maxNumberOfReads) throws FileNotFoundException {
  transcriptFilter=new TranscriptsAlignmentFilter(geneTranscriptFile,kVal);
  bestScoreFilter=new BestScoreOnlyAlignmentFilter(kVal,maxNumberOfReads);
}
Program: 50490
Project: 50490
Buggy source:
@Override public boolean shouldRetainEntry(final Alignments.AlignmentEntry entry){
  if (!bestScoreFilter.shouldRetainEntry(entry)) {
    return false;
  }
 else {
    return transcriptFilter.shouldRetainEntry(entry);
  }
}

Fixed version (ground truth):
@Override public boolean shouldRetainEntry(final Alignments.AlignmentEntry entry){
  entryCount+=entry.getMultiplicity();
  if (!bestScoreFilter.shouldRetainEntry(entry)) {
    notBestScoreCount+=entry.getMultiplicity();
    return false;
  }
 else {
    final boolean notGeneAmbiguous=transcriptFilter.shouldRetainEntry(entry);
    if (!notGeneAmbiguous) {
      geneAmbiguityCount+=entry.getMultiplicity();
    }
    return notGeneAmbiguous;
  }
}
Program: 50491
Project: 50491
Buggy source:
/** 
 * Constructor.
 * @param geneTranscriptFile the gene-transcripts-map file to read
 * @param kVal the k value for the filter
 * @throws java.io.FileNotFoundException if the gene-transcripts-map didn't exist
 */
public TranscriptsAlignmentFilter(final String geneTranscriptFile,final int kVal) throws FileNotFoundException {
  LOG.debug("String_Node_Str");
  this.gtr=new GeneTranscriptRelationships();
  transcriptsIndexedIdentifiers=gtr.load(geneTranscriptFile);
  readIndexToGeneIdSetMap=new Int2ObjectOpenHashMap<IntSet>();
  k=kVal;
  numInspected=0;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param geneTranscriptFile the gene-transcripts-map file to read
 * @param kVal               the k value for the filter
 * @throws java.io.FileNotFoundException if the gene-transcripts-map didn't exist
 */
public TranscriptsAlignmentFilter(final String geneTranscriptFile,final int kVal) throws FileNotFoundException {
  LOG.debug("String_Node_Str");
  this.gtr=new GeneTranscriptRelationships();
  transcriptsIndexedIdentifiers=gtr.load(geneTranscriptFile);
  readIndexToGeneIdSetMap=new Int2ObjectOpenHashMap<IntSet>();
  k=kVal;
  numInspected=0;
}
Program: 50492
Project: 50492
Buggy source:
/** 
 * Inspect an entry (will be called during a first pass of reading the entries).
 * @param entry the entry
 */
@Override public void inspectEntry(final Alignments.AlignmentEntry entry){
  numInspected++;
  final int readNameIndex=entry.getQueryIndex();
  IntSet geneIdSet=readIndexToGeneIdSetMap.get(readNameIndex);
  if (geneIdSet != null && geneIdSet.size() > k) {
    return;
  }
  final int transcriptIndex=alignmentReferenceIndexToTranscriptIndex[entry.getTargetIndex()];
  final int geneIndex=gtr.transcript2Gene(transcriptIndex);
  if (geneIdSet == null) {
    geneIdSet=new IntArraySet();
    readIndexToGeneIdSetMap.put(readNameIndex,geneIdSet);
  }
  if (geneIdSet.size() <= k) {
    geneIdSet.add(geneIndex);
  }
}

Fixed version (ground truth):
/** 
 * Inspect an entry (will be called during a first pass of reading the entries).
 * @param entry the entry
 */
@Override public void inspectEntry(final Alignments.AlignmentEntry entry){
  numInspected++;
  final int queryIndex=entry.getQueryIndex();
  IntSet geneIdSet=readIndexToGeneIdSetMap.get(queryIndex);
  if (geneIdSet != null && geneIdSet.size() > k) {
    return;
  }
  final int transcriptIndex=alignmentReferenceIndexToTranscriptIndex[entry.getTargetIndex()];
  final int geneIndex=gtr.transcript2Gene(transcriptIndex);
  if (geneIdSet == null) {
    geneIdSet=new IntArraySet();
    readIndexToGeneIdSetMap.put(queryIndex,geneIdSet);
  }
  if (geneIdSet.size() <= k) {
    geneIdSet.add(geneIndex);
    boolean verbose=false;
    if (verbose && geneIdSet.size() >= 5) {
      System.out.print("String_Node_Str");
      for (      int geneIndex2 : geneIdSet) {
        if (geneIndex2 == geneIndex)         System.out.printf("String_Node_Str",entry.getPosition(),entry.getScore());
        System.out.printf("String_Node_Str",gtr.getGeneId(geneIndex2));
      }
      System.out.println("String_Node_Str");
    }
  }
}
Program: 50493
Project: 50493
Buggy source:
private static int processInsertionsOnly(String cigar,String mdAttribute,MutableString readSequence,MutableString transformedSequence,int[] positionAdjustment){
}

Fixed version (ground truth):
private static int processInsertionsOnly(String cigar,String mdAttribute,MutableString readSequence,MutableString transformedSequence,IntList positionAdjustment){
}
Program: 50495
Project: 50495
Buggy source:
/** 
 * Main method.
 * @param args command line args.
 * @throws com.martiansoftware.jsap.JSAPException error parsing
 * @throws java.io.IOException error parsing or executing.
 */
public static void main(final String[] args) throws JSAPException, IOException {
  new AlignmentToTextMode().configure(args).execute();
}

Fixed version (ground truth):
/** 
 * Main method.
 * @param args command line args.
 * @throws JSAPException error parsing
 * @throws IOException error parsing or executing.
 */
public static void main(final String[] args) throws JSAPException, IOException {
  new AlignmentToTextMode().configure(args).execute();
}