nus-yam/ex-repair huggingface dataset:
Program: 50376
Project: 50376
Buggy source:
/** 
 * Return the element index of element identified by id.
 * @param elementId id of the element.
 * @return index of the element.
 */
public int getElementIndex(String elementId){
  return elementLabels.getInt(new MutableString(elementId));
}

Fixed version (ground truth):
/** 
 * Return the element index of element identified by id.
 * @param elementId id of the element.
 * @return index of the element.
 */
public int getElementIndex(final String elementId){
  return elementLabels.getInt(new MutableString(elementId));
}
Program: 50377
Project: 50377
Buggy source:
@Override public void appendCountAtPosition(final int count,final int position) throws IOException {
  if (position != previousPosition + 1 && count != 0) {
    counts.add(0);
    positions.add(position - 1);
  }
  counts.add(count);
  positions.add(position);
  if (positions.size() >= 2) {
    final int i=counts.size() - 2;
    final int j=counts.size() - 1;
    if (counts.getInt(i) == counts.getInt(j)) {
      positions.removeElements(i,j);
      counts.removeElements(i,j);
    }
  }
  while (positions.size() > 2) {
    final int diffPos=positions.getInt(1) - (positions.getInt(0) + 1);
    int aCount=counts.getInt(1);
    if (aCount < 0) {
      System.out.printf("String_Node_Str",aCount,positions.getInt(0));
      aCount=0;
    }
    delegate.appendCount(aCount,diffPos + 1);
    positions.removeElements(0,1);
    counts.removeElements(0,1);
    previousCount=count;
  }
  previousPosition=position;
}

Fixed version (ground truth):
@Override public void appendCountAtPosition(final int count,final int position) throws IOException {
  if (position != previousPosition + 1 && count != 0) {
    counts.add(0);
    positions.add(position - 1);
  }
  counts.add(count);
  positions.add(position);
  if (positions.size() >= 2) {
    final int i=counts.size() - 2;
    final int j=counts.size() - 1;
    if (counts.getInt(i) == counts.getInt(j)) {
      positions.removeElements(i,j);
      counts.removeElements(i,j);
    }
  }
  while (positions.size() > 2) {
    int diffPos=positions.getInt(1) - (positions.getInt(0) + 1);
    int aCount=counts.getInt(1);
    if (aCount < 0) {
      System.out.println(counts);
      System.out.println(positions);
      System.out.printf("String_Node_Str",aCount,positions.getInt(0));
      aCount=0;
    }
    if (diffPos < 0) {
      System.out.printf("String_Node_Str",diffPos,positions.getInt(1),positions.getInt(0));
      System.out.println(counts);
      System.out.println(positions);
      diffPos=0;
    }
    delegate.appendCount(aCount,diffPos + 1);
    positions.removeElements(0,1);
    counts.removeElements(0,1);
    previousCount=count;
  }
  previousPosition=position;
}
Program: 50378
Project: 50378
Buggy source:
@Override public void processPositions(int referenceIndex,int position,DiscoverVariantPositionData positionBaseInfos){
  try {
    if (referenceIndex != lastReferenceIndex) {
      if (writerI != null) {
        finishWriter();
      }
      writerI=archiveWriter.newCountWriter(referenceIndex,getReferenceId(referenceIndex).toString());
      helperI=new CountWriterHelper2(writerI);
      lastReferenceIndex=referenceIndex;
    }
    helperI.appendCountAtPosition(positionBaseInfos.size(),position);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void processPositions(int referenceIndex,int position,DiscoverVariantPositionData positionBaseInfos){
  try {
    if (referenceIndex != lastReferenceIndex) {
      if (writerI != null) {
        finishWriter();
      }
      writerI=archiveWriter.newCountWriter(referenceIndex,getReferenceId(referenceIndex).toString());
      helperI=new CountWriterHelper2(writerI);
      lastReferenceIndex=referenceIndex;
      lastPosition=-1;
    }
    if (position > lastPosition) {
      helperI.appendCountAtPosition(positionBaseInfos.size(),position);
      lastPosition=position;
    }
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
}
Program: 50379
Project: 50379
Buggy source:
public int getNumAlignedReadsInSample(){
  return numAlignedReadsInSample;
}

Fixed version (ground truth):
public long getNumAlignedReadsInSample(){
  return numAlignedReadsInSample;
}
Program: 50380
Project: 50380
Buggy source:
@Override public void prepareDataStructuresForReference(final AlignmentReader alignmentReader,final int referenceIndex){
  AnnotationCountInterface algo=new AnnotationCount();
  algo=chooseAlgorithm(weightParams,weights,algo);
  algs[referenceIndex]=algo;
  algs[referenceIndex].startPopulating();
  referencesSelected.add(referenceIndex);
}

Fixed version (ground truth):
@Override public void prepareDataStructuresForReference(final AlignmentReader alignmentReader,final int referenceIndex){
  if (numAlignedReadsInSample == -1) {
    numAlignedReadsInSample=alignmentReader.getNumberOfAlignedReads();
  }
  AnnotationCountInterface algo=new AnnotationCount();
  algo=chooseAlgorithm(weightParams,weights,algo);
  algs[referenceIndex]=algo;
  algs[referenceIndex].startPopulating();
  referencesSelected.add(referenceIndex);
}
Program: 50381
Project: 50381
Buggy source:
@Override public void processAlignmentEntry(final AlignmentReader alignmentReader,final Alignments.AlignmentEntry alignmentEntry){
  final int referenceIndex=alignmentEntry.getTargetIndex();
  final int startPosition=alignmentEntry.getPosition();
  final int alignmentLength=alignmentEntry.getQueryAlignedLength();
  for (int i=0; i < alignmentEntry.getMultiplicity(); ++i) {
    algs[referenceIndex].populate(startPosition,startPosition + alignmentLength,alignmentEntry.getQueryIndex());
    ++numAlignedReadsInSample;
  }
}

Fixed version (ground truth):
@Override public void processAlignmentEntry(final AlignmentReader alignmentReader,final Alignments.AlignmentEntry alignmentEntry){
  final int referenceIndex=alignmentEntry.getTargetIndex();
  final int startPosition=alignmentEntry.getPosition();
  final int alignmentLength=alignmentEntry.getQueryAlignedLength();
  for (int i=0; i < alignmentEntry.getMultiplicity(); ++i) {
    algs[referenceIndex].populate(startPosition,startPosition + alignmentLength,alignmentEntry.getQueryIndex());
  }
}
Program: 50384
Project: 50384
Buggy source:
private Object2ObjectMap<String,ObjectList<Annotation>> filterAnnotations(Object2ObjectMap<String,ObjectList<Annotation>> map,GenomicRange genomicRange){
  if (genomicRange == null) {
    return map;
  }
  Object2ObjectMap<String,ObjectList<Annotation>> filtered=new Object2ObjectArrayMap<String,ObjectList<Annotation>>();
  for (  Map.Entry<String,ObjectList<Annotation>> entry : map.entrySet()) {
    String key=entry.getKey();
    String chromosome=key;
    for (    final Annotation value : entry.getValue()) {
      chromosome=value.getChromosome();
      int segmentStart=value.getStart() - 1;
      int segmentEnd=value.getEnd() - 1;
      if (genomicRange.fullyContains(chromosome,segmentStart,segmentEnd)) {
        ObjectList<Annotation> chromosomeList=filtered.get(key);
        if (chromosomeList == null) {
          chromosomeList=new ObjectArrayList<Annotation>();
          filtered.put(key,chromosomeList);
        }
        chromosomeList.add(value);
      }
    }
  }
  return filtered;
}

Fixed version (ground truth):
private Object2ObjectMap<String,ObjectList<Annotation>> filterAnnotations(Object2ObjectMap<String,ObjectList<Annotation>> map,GenomicRange genomicRange){
  if (genomicRange == null) {
    return map;
  }
  Object2ObjectMap<String,ObjectList<Annotation>> filtered=new Object2ObjectArrayMap<String,ObjectList<Annotation>>();
  for (  Map.Entry<String,ObjectList<Annotation>> entry : map.entrySet()) {
    String key=entry.getKey();
    String chromosome=key;
    for (    final Annotation value : entry.getValue()) {
      chromosome=value.getChromosome();
      int segmentStart=value.getStart() - 1;
      int segmentEnd=value.getEnd() - 1;
      if (genomicRange.fullyContains(chromosome,segmentStart,segmentEnd)) {
        ObjectList<Annotation> chromosomeList=filtered.get(key);
        if (chromosomeList == null) {
          chromosomeList=new ObjectArrayList<Annotation>();
          filtered.put(key,chromosomeList);
        }
        chromosomeList.add(value);
      }
      AnnotationLength annotationLength=new AnnotationLength();
      annotationLength.id=value.getId();
      annotationLength.length=value.getLength();
      infoOutInstance.lengths.add(annotationLength);
    }
  }
  return filtered;
}
Program: 50385
Project: 50385
Buggy source:
private void writeInfoOutput() throws JAXBException, IOException {
  if (infoOutput != null) {
    final JAXBContext jc=JAXBContext.newInstance(InfoOutput.class);
    final Marshaller m=jc.createMarshaller();
    InfoOutput infoOutInstance=new InfoOutput();
    for (    String sampleId : deCalculator.samples()) {
      SampleTotalCount stc=new SampleTotalCount();
      stc.sampleId=sampleId;
      stc.totalCount=deCalculator.getNumAlignedInSample(sampleId);
      infoOutInstance.totalCounts.add(stc);
    }
    for (    MutableString elementId : deCalculator.getElementIds()) {
      AnnotationLength ae=new AnnotationLength();
      ae.length=deCalculator.getElementLength(elementId);
      ae.id=elementId.toString();
      infoOutInstance.lengths.add(ae);
    }
    FileWriter fileWriter=new FileWriter(infoOutput);
    m.marshal(infoOutInstance,fileWriter);
    fileWriter.close();
  }
}

Fixed version (ground truth):
private void writeInfoOutput() throws JAXBException, IOException {
  if (infoOutputFilename != null) {
    final JAXBContext jc=JAXBContext.newInstance(InfoOutput.class);
    final Marshaller m=jc.createMarshaller();
    for (    String sampleId : deCalculator.samples()) {
      SampleTotalCount stc=new SampleTotalCount();
      stc.sampleId=sampleId;
      stc.totalCount=deCalculator.getNumAlignedInSample(sampleId);
      System.out.println(stc);
      infoOutInstance.totalCounts.add(stc);
    }
    FileWriter fileWriter=new FileWriter(infoOutputFilename);
    m.marshal(infoOutInstance,fileWriter);
    fileWriter.close();
  }
}
Program: 50386
Project: 50386
Buggy source:
/** 
 * Load the input file into deCalculator.
 * @param inputFilename tab-delimited intut file produced by alignment-to-annotation-counts
 * @param sampleIds     sample identifiers.
 * @throws IOException if an error occurs reading the input file.
 */
private void loadInput(final String inputFilename,final int numElements,final String[] sampleIds) throws IOException {
  final TSVReader reader=new TSVReader(new FileReader(inputFilename),'\t');
  if (reader.hasNext()) {
    reader.next();
  }
  deCalculator.reserve(numElements,sampleIds.length);
  int numLines=0;
  while (reader.hasNext()) {
    if (reader.isCommentLine()) {
      reader.skip();
    }
 else {
      reader.next();
      numLines++;
      final String elementId=reader.getString();
      final String elementType=reader.getString();
      deCalculator.defineElement(elementId,DifferentialExpressionCalculator.ElementType.valueOf(elementType));
      for (      final String sample : sampleIds) {
        deCalculator.observe(sample,elementId,reader.getDouble());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Load the input file into deCalculator.
 * @param inputFilename tab-delimited intut file produced by alignment-to-annotation-counts
 * @param sampleIds     sample identifiers.
 * @throws IOException if an error occurs reading the input file.
 */
private void loadInput(final String inputFilename,final int numElements,final String[] sampleIds) throws IOException {
  final TSVReader reader=new TSVReader(new FileReader(inputFilename),'\t');
  if (reader.hasNext()) {
    reader.next();
  }
  deCalculator.reserve(numElements,sampleIds.length);
  int numLines=0;
  while (reader.hasNext()) {
    if (reader.isCommentLine()) {
      reader.skip();
    }
 else {
      reader.next();
      numLines++;
      final String elementId=reader.getString();
      final String elementType=reader.getString();
      if (!"String_Node_Str".equals(elementId)) {
        deCalculator.defineElement(elementId,DifferentialExpressionCalculator.ElementType.valueOf(elementType));
        for (        final String sample : sampleIds) {
          deCalculator.observe(sample,elementId,reader.getDouble());
        }
      }
    }
  }
}
Program: 50387
Project: 50387
Buggy source:
/** 
 * Declare a new statistic.
 * @param statisticId Identifier for the new statistic.
 * @return the index of the statistic.
 */
public int declareStatistic(final MutableString statisticId){
  final int index=statisticIds.registerIdentifier(statisticId);
  if (statisticId.startsWith("String_Node_Str")) {
    averageCountPerGroupIndexes.add(sortedStatisticIds.size());
  }
  sortedStatisticIds.add(statisticId);
  return index;
}

Fixed version (ground truth):
/** 
 * Declare a new statistic.
 * @param statisticId Identifier for the new statistic.
 * @return the index of the statistic.
 */
public int declareStatistic(final MutableString statisticId){
  final int index=statisticIds.registerIdentifier(statisticId);
  sortedStatisticIds.add(statisticId);
  return index;
}
Program: 50390
Project: 50390
Buggy source:
private MutableString constructAlleleString(ObjectArrayList<String> alleles,ObjectArrayList<String> excludedAlleles){
  buffer.setLength(0);
  int max=alleles.size();
  int index=0;
  for (  String allele : alleles) {
    index++;
    if (!excludedAlleles.contains(allele)) {
      buffer.append(allele);
      if (index != max)       buffer.append(',');
    }
  }
  if (buffer.length() == 0) {
    buffer.append('.');
  }
  return buffer;
}

Fixed version (ground truth):
private MutableString constructAlleleString(ObjectArrayList<String> refAlleles){
  buffer.setLength(0);
  int max=refAlleles.size();
  int index=0;
  for (  String allele : refAlleles) {
    buffer.append(allele);
    if (++index != max)     buffer.append(',');
  }
  if (buffer.length() == 0) {
    buffer.append('.');
  }
  return buffer;
}
Program: 50391
Project: 50391
Buggy source:
private RandomAccessSequenceInterface configureGenome(JSAPResult jsapResult) throws IOException {
  if (testGenome != null) {
    return testGenome;
  }
  final String genome=jsapResult.getString("String_Node_Str");
  RandomAccessSequenceCache cache=null;
  if (genome != null) {
    try {
      System.err.println("String_Node_Str" + genome);
      cache=new RandomAccessSequenceCache();
      cache.load(genome);
    }
 catch (    ClassNotFoundException e) {
      System.err.println("String_Node_Str");
      e.printStackTrace();
      System.exit(1);
    }
  }
  return cache;
}

Fixed version (ground truth):
public static RandomAccessSequenceInterface configureGenome(RandomAccessSequenceInterface testGenome,JSAPResult jsapResult) throws IOException {
  if (testGenome != null) {
    return testGenome;
  }
  final String genome=jsapResult.getString("String_Node_Str");
  RandomAccessSequenceCache cache=null;
  if (genome != null) {
    try {
      System.err.println("String_Node_Str" + genome);
      cache=new RandomAccessSequenceCache();
      cache.load(genome);
    }
 catch (    ClassNotFoundException e) {
      System.err.println("String_Node_Str");
      e.printStackTrace();
      System.exit(1);
    }
  }
  return cache;
}
Program: 50392
Project: 50392
Buggy source:
/** 
 * Construct an index for counts data given as a byte array.
 * @param countBytes The compressed counts data to read with CountsReader
 * @param indexPart  The data output where to write the index.
 * @throws IOException If an error occurs writing the index or reading the counts.
 */
public void buildIndex(byte[] countBytes,DataOutput indexPart) throws IOException {
  final InputStream stream=new ByteArrayInputStream(countBytes);
  InputBitStream inputBitStream=new InputBitStream(stream);
  final CountsReaderI reader=new CountsReader(inputBitStream);
  int transitionNum=0;
  long bitsWritten=0;
  while (reader.hasNextTransition()) {
    reader.nextTransition();
    int position=reader.getPosition();
    int count=reader.getCount();
    ++transitionNum;
    if (transitionNum % transitionsPerIndex == 0) {
      offsets.add((int)bitsWritten);
      positions.add(position);
      counts.add(count);
      ++numIndexEntries;
    }
    bitsWritten=inputBitStream.readBits();
  }
  indexPart.writeInt(numIndexEntries);
  BinIO.storeInts(positions.toIntArray(),indexPart);
  BinIO.storeInts(offsets.toIntArray(),indexPart);
  BinIO.storeInts(counts.toIntArray(),indexPart);
}

Fixed version (ground truth):
/** 
 * Construct an index for counts data given as a byte array.
 * @param countBytes The compressed counts data to read with CountsReader
 * @param indexPart  The data output where to write the index.
 * @throws IOException If an error occurs writing the index or reading the counts.
 */
public void buildIndex(byte[] countBytes,DataOutput indexPart) throws IOException {
}
Program: 50394
Project: 50394
Buggy source:
public boolean hasNextDataLine(){
  if (hasNextDataLine) {
    return true;
  }
  hasNextDataLine=lineIterator.hasNext();
  if (hasNextDataLine) {
    line=lineIterator.next();
    parseCurrentLine();
  }
  return hasNextDataLine;
}

Fixed version (ground truth):
public boolean hasNextDataLine(){
  if (hasNextDataLine) {
    return true;
  }
  hasNextDataLine=lineIterator.hasNext();
  if (hasNextDataLine) {
    line=lineIterator.next();
    if (!TSV) {
      parseCurrentLine();
    }
 else {
      parseTSVLine();
    }
  }
  return hasNextDataLine;
}
Program: 50395
Project: 50395
Buggy source:
/** 
 * Read the header of this file. Headers in the VCF format are supported, as well as TSV single header lines (with or without first character #.
 * @throws SyntaxException When the syntax of the VCF file is incorrect.
 */
public void readHeader() throws SyntaxException {
  if (headerParsed)   return;
  headerParsed=true;
  globalFieldIndex=0;
  fieldIndexToName=new Int2ObjectOpenHashMap<String>();
  bufferedReader=new FastBufferedReader(input);
  lineIterator=new LineIterator(bufferedReader);
  int lineNumber=1;
  while (lineIterator.hasNext()) {
    line=lineIterator.next();
    if (line.startsWith("String_Node_Str")) {
      TSV=false;
    }
    if (!line.startsWith("String_Node_Str")) {
      if (TSV && lineNumber == 1 && headerLineNotParsed) {
        parseHeaderLine(new MutableString("String_Node_Str" + line));
      }
 else {
        parseCurrentLine();
        hasNextDataLine=true;
      }
      break;
    }
    if (line.startsWith("String_Node_Str")) {
      TSV=false;
      processMetaInfoLine(line);
    }
 else     if (line.startsWith("String_Node_Str")) {
      parseHeaderLine(line);
    }
    lineNumber++;
  }
}

Fixed version (ground truth):
/** 
 * Read the header of this file. Headers in the VCF format are supported, as well as TSV single header lines (with or without first character #.
 * @throws SyntaxException When the syntax of the VCF file is incorrect.
 */
public void readHeader() throws SyntaxException {
  if (headerParsed)   return;
  headerParsed=true;
  globalFieldIndex=0;
  fieldIndexToName=new Int2ObjectOpenHashMap<String>();
  bufferedReader=new FastBufferedReader(input);
  lineIterator=new LineIterator(bufferedReader);
  int lineNumber=1;
  while (lineIterator.hasNext()) {
    line=lineIterator.next();
    if (line.startsWith("String_Node_Str")) {
      TSV=false;
    }
    if (!line.startsWith("String_Node_Str")) {
      if (TSV && lineNumber == 1 && headerLineNotParsed) {
        parseHeaderLine(new MutableString("String_Node_Str" + line));
      }
 else {
        if (!TSV) {
          parseCurrentLine();
        }
 else {
          parseTSVLine();
        }
        hasNextDataLine=true;
      }
      break;
    }
    if (line.startsWith("String_Node_Str")) {
      TSV=false;
      processMetaInfoLine(line);
    }
 else     if (line.startsWith("String_Node_Str")) {
      parseHeaderLine(line);
    }
    lineNumber++;
  }
}
Program: 50398
Project: 50398
Buggy source:
@Test public void testParseNoFormatTSV() throws FileNotFoundException, VCFParser.SyntaxException {
  VCFParser parser=new VCFParser(new FileReader("String_Node_Str"));
  parser.readHeader();
  Columns cols=parser.getColumns();
  assertNotNull("String_Node_Str",cols.find("String_Node_Str"));
  assertNotNull("String_Node_Str",cols.find("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testParseNoFormatTSV() throws FileNotFoundException, VCFParser.SyntaxException {
  VCFParser parser=new VCFParser(new FileReader("String_Node_Str"));
  parser.readHeader();
  Columns cols=parser.getColumns();
  assertNotNull("String_Node_Str",cols.find("String_Node_Str"));
  assertNotNull("String_Node_Str",cols.find("String_Node_Str"));
  int lastColumnIndex=parser.getGlobalFieldIndex("String_Node_Str","String_Node_Str");
  while (parser.hasNextDataLine()) {
    String colValue=parser.getFieldValue(lastColumnIndex).toString();
    System.out.println(colValue);
    assertFalse("String_Node_Str",colValue.contains("String_Node_Str"));
    parser.next();
  }
}
Program: 50399
Project: 50399
Buggy source:
/** 
 * Obtain indices associated with each countReader defined in the archive. These indices are the index of each reference sequence for which counts where written to this archive.
 * @return set of reference sequence indices.
 */
public IntSet getIndices(){
  final IntSet result=new IntArraySet();
  final Collection<CompoundDirectoryEntry> directory=compoundReader.getDirectory();
  for (  final CompoundDirectoryEntry entry : directory) {
    final String name=entry.getName();
    final String[] tokens=name.split("String_Node_Str");
    if (tokens.length < 1) {
      return null;
    }
    result.add(Integer.parseInt(tokens[0]));
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Obtain indices associated with each countReader defined in the archive. These indices are the index of each reference sequence for which counts where written to this archive.
 * @return set of reference sequence indices.
 */
public IntSet getIndices(){
  final IntSet result=new IntArraySet();
  final Collection<CompoundDirectoryEntry> directory=compoundReader.getDirectory();
  for (  final CompoundDirectoryEntry entry : directory) {
    final String name=entry.getName();
    if (!name.startsWith("String_Node_Str")) {
      final String[] tokens=name.split("String_Node_Str");
      if (tokens.length < 1) {
        return null;
      }
      result.add(Integer.parseInt(tokens[0]));
    }
  }
  return result;
}
Program: 50400
Project: 50400
Buggy source:
/** 
 * Obtain the number of count information available in this archive.
 * @return an integer.
 */
public int getNumberOfIndices(){
  return compoundReader.getDirectory().size();
}

Fixed version (ground truth):
/** 
 * Obtain the number of count information available in this archive.
 * @return an integer.
 */
public int getNumberOfIndices(){
  return identifierToIndexMap.size();
}
Program: 50401
Project: 50401
Buggy source:
/** 
 * Obtain identifiers associated with each countReader defined in the archive.
 * @return set of count information identifiers, or null if identifiers were not written in the archive.
 */
public ObjectSet<String> getIdentifiers(){
  final ObjectSet<String> result=new ObjectOpenHashSet<String>();
  final Collection<CompoundDirectoryEntry> directory=compoundReader.getDirectory();
  for (  final CompoundDirectoryEntry entry : directory) {
    final String name=entry.getName();
    final String[] tokens=name.split("String_Node_Str");
    if (tokens.length < 2) {
      return null;
    }
    result.add(tokens[1]);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Obtain identifiers associated with each countReader defined in the archive.
 * @return set of count information identifiers, or null if identifiers were not written in the archive.
 */
public ObjectSet<String> getIdentifiers(){
  final ObjectSet<String> result=new ObjectOpenHashSet<String>();
  final Collection<CompoundDirectoryEntry> directory=compoundReader.getDirectory();
  for (  final CompoundDirectoryEntry entry : directory) {
    final String name=entry.getName();
    if (!name.startsWith("String_Node_Str")) {
      final String[] tokens=name.split("String_Node_Str");
      if (tokens.length < 2) {
        return null;
      }
      result.add(tokens[1]);
    }
  }
  return result;
}
Program: 50402
Project: 50402
Buggy source:
/** 
 * Advance up to or past the specified position. The reader is advanced until the position returned by getPosition() is at least equal, or greater to the specified position.
 * @param position
 * @throws IOException
 */
public void skipTo(final int position) throws IOException {
  while (hasNextTransition() && this.position < position) {
    nextTransition();
  }
}

Fixed version (ground truth):
/** 
 * Advance up to or past the specified position. The reader is advanced until the position returned by getPosition() is at least equal, or greater to the specified position.
 * @param position
 * @throws IOException
 */
public void skipTo(final int position) throws IOException {
  while (hasNextTransition()) {
    nextTransition();
    if (getPosition() >= position) {
      break;
    }
  }
}
Program: 50403
Project: 50403
Buggy source:
@Test public void testComputeStarts5() throws IOException {
  initializeTestDirectory();
  final Random random=new Random();
  random.setSeed(023);
  final ComputeStartCount computer=new ComputeStartCount(ComputeStartCount.POSITIVE_STRAND_ONLY);
  for (int i=0; i < 100000; i++) {
    final int start=chooseRandom(random,1,10000);
    final int length=chooseRandom(random,10,100);
    computer.populate(start,start + length,true);
  }
  computer.populate(10010,10020,true);
  computer.populate(10010,10020,true);
  computer.populate(10011,10020,true);
  final String filename="String_Node_Str";
  final CountsWriter writer=new CountsWriter(new FileOutputStream(filename));
  computer.baseCount(writer);
  writer.close();
  final CountsReader reader=new CountsReader(new FileInputStream(filename));
  reader.skipTo(10003);
  assertEquals(2,reader.getCount());
  assertEquals(10010,reader.getPosition());
  reader.nextTransition();
  assertEquals(1,reader.getCount());
  assertEquals(10011,reader.getPosition());
  reader.close();
}

Fixed version (ground truth):
@Test public void testComputeStarts5() throws IOException {
  initializeTestDirectory();
  final Random random=new Random();
  random.setSeed(023);
  final ComputeStartCount computer=new ComputeStartCount(ComputeStartCount.POSITIVE_STRAND_ONLY);
  for (int i=0; i < 100000; i++) {
    final int start=chooseRandom(random,1,10000);
    final int length=chooseRandom(random,10,100);
    computer.populate(start,start + length,true);
  }
  computer.populate(10010,10020,true);
  computer.populate(10010,10020,true);
  computer.populate(10011,10020,true);
  final String filename="String_Node_Str";
  final CountsWriter writer=new CountsWriter(new FileOutputStream(filename));
  computer.baseCount(writer);
  writer.close();
  final CountsReader reader=new CountsReader(new FileInputStream(filename));
  reader.skipTo(10003);
  assertEquals(2,reader.getCount());
  assertEquals(10010,reader.getPosition());
  reader.hasNextTransition();
  reader.nextTransition();
  assertEquals(10011,reader.getPosition());
  assertEquals(1,reader.getCount());
  reader.close();
}
Program: 50404
Project: 50404
Buggy source:
public void setSampleValue(String formatToken,int sampleIndex,String value){
  int formatFieldIndex=formatTypeToFormatFieldIndex.get(formatToken);
  setSampleValue(formatFieldIndex,sampleIndex,value);
}

Fixed version (ground truth):
public void setSampleValue(String formatToken,int sampleIndex,String value){
  int formatFieldIndex=formatTypeToFormatFieldIndex.getInt(formatToken);
  setSampleValue(formatFieldIndex,sampleIndex,value);
}
Program: 50405
Project: 50405
Buggy source:
public ColumnField find(final int fieldIndex){
  return indexMap.get(fieldIndex);
}

Fixed version (ground truth):
public ColumnField find(final int fieldIndex){
  rebuildMap();
  return indexMap.get(fieldIndex);
}
Program: 50406
Project: 50406
Buggy source:
/** 
 * Add an element to the pool.
 * @param element element to add.
 */
public final void add(final T element){
  ++numElements;
  while (array.size() <= numElements) {
    array.add(null);
  }
  array.set(tailIndex,element);
  if (((Alignments.AlignmentEntry)element).getQueryIndex() == 540) {
    System.out.println("String_Node_Str");
  }
  advanceTailIndex();
}

Fixed version (ground truth):
/** 
 * Add an element to the pool.
 * @param element element to add.
 */
public final void add(final T element){
  ++numElements;
  capacity=Math.max(capacity,tailIndex + 1);
  while (array.size() <= capacity) {
    array.add(null);
  }
  array.set(tailIndex,element);
  advanceTailIndex();
}
Program: 50407
Project: 50407
Buggy source:
private void advanceTailIndex(){
  ++tailIndex;
  if (tailIndex > numElements) {
    tailIndex=0;
  }
}

Fixed version (ground truth):
private void advanceTailIndex(){
  tailIndex=tailIndex % capacity + 1;
}
Program: 50408
Project: 50408
Buggy source:
private void advanceHeadIndex(){
  ++headIndex;
  if (headIndex > numElements) {
    headIndex=0;
  }
}

Fixed version (ground truth):
private void advanceHeadIndex(){
  headIndex=headIndex % capacity + 1;
}
Program: 50411
Project: 50411
Buggy source:
/** 
 * Read the index. The header is also loaded.
 * @throws IOException If an error occurs loading the index or header.
 */
public final void readIndex() throws IOException {
  if (indexed && !indexLoaded) {
    readHeader();
    final GZIPInputStream indexStream=new GZIPInputStream(new FileInputStream(basename + "String_Node_Str"));
    final CodedInputStream codedInput=CodedInputStream.newInstance(indexStream);
    codedInput.setSizeLimit(Integer.MAX_VALUE);
    final Alignments.AlignmentIndex index=Alignments.AlignmentIndex.parseFrom(codedInput);
    indexOffsets.clear();
    indexAbsolutePositions.clear();
    for (    final long offset : index.getOffsetsList()) {
      indexOffsets.add(offset);
    }
    for (    final long absolutePosition : index.getAbsolutePositionsList()) {
      indexAbsolutePositions.add(absolutePosition);
    }
    indexAbsolutePositions.trim();
    indexOffsets.trim();
    targetPositionOffsets=new long[targetLengths.length];
    for (int targetIndex=0; targetIndex < targetLengths.length; targetIndex++) {
      targetPositionOffsets[targetIndex]+=targetLengths[targetIndex];
      targetPositionOffsets[targetIndex]+=targetIndex < 1 ? 0 : targetPositionOffsets[targetIndex - 1];
    }
    indexLoaded=true;
  }
}

Fixed version (ground truth):
/** 
 * Read the index. The header is also loaded.
 * @throws IOException If an error occurs loading the index or header.
 */
public final void readIndex() throws IOException {
  if (indexed && !indexLoaded) {
    readHeader();
    final GZIPInputStream indexStream=new GZIPInputStream(new FileInputStream(basename + "String_Node_Str"));
    final CodedInputStream codedInput=CodedInputStream.newInstance(indexStream);
    codedInput.setSizeLimit(Integer.MAX_VALUE);
    final Alignments.AlignmentIndex index=Alignments.AlignmentIndex.parseFrom(codedInput);
    indexOffsets.clear();
    indexAbsolutePositions.clear();
    for (    final long offset : index.getOffsetsList()) {
      indexOffsets.add(offset);
    }
    for (    final long absolutePosition : index.getAbsolutePositionsList()) {
      indexAbsolutePositions.add(absolutePosition);
    }
    indexAbsolutePositions.trim();
    indexOffsets.trim();
    targetPositionOffsets=new long[targetLengths.length];
    for (int targetIndex=0; targetIndex < targetLengths.length; targetIndex++) {
      targetPositionOffsets[targetIndex]+=targetLengths[targetIndex];
      targetPositionOffsets[targetIndex]+=targetIndex < 1 ? 0 : targetPositionOffsets[targetIndex - 1];
    }
    targetPositionOffsets[0]=0;
    indexLoaded=true;
  }
}
Program: 50413
Project: 50413
Buggy source:
public SimulateBisulfiteReads(){
  random=new Random();
}

Fixed version (ground truth):
public SimulateBisulfiteReads(){
  random=new Random(seed);
}
Program: 50415
Project: 50415
Buggy source:
public static void main(String[] args) throws IOException {
  String fastaReference=CLI.getOption(args,"String_Node_Str",null);
  String outputFilename=CLI.getOption(args,"String_Node_Str","String_Node_Str");
  String regionTrueRates=CLI.getOption(args,"String_Node_Str","String_Node_Str");
  String refChoice=CLI.getOption(args,"String_Node_Str","String_Node_Str");
  int from=CLI.getIntOption(args,"String_Node_Str",0);
  int to=CLI.getIntOption(args,"String_Node_Str",0);
  if (to < from) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  int readLength=CLI.getIntOption(args,"String_Node_Str",40);
  String methylationRateFilename=CLI.getOption(args,"String_Node_Str","String_Node_Str");
  SimulateBisulfiteReads processor=new SimulateBisulfiteReads();
  processor.readLength=readLength;
  processor.outputFilename=outputFilename;
  processor.regionTrueRates=regionTrueRates;
  processor.process(refChoice,fastaReference,from,to,methylationRateFilename);
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  String fastaReference=CLI.getOption(args,"String_Node_Str",null);
  String outputFilename=CLI.getOption(args,"String_Node_Str","String_Node_Str");
  String regionTrueRates=CLI.getOption(args,"String_Node_Str","String_Node_Str");
  String refChoice=CLI.getOption(args,"String_Node_Str","String_Node_Str");
  int from=CLI.getIntOption(args,"String_Node_Str",0);
  int to=CLI.getIntOption(args,"String_Node_Str",0);
  if (to < from) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  int readLength=CLI.getIntOption(args,"String_Node_Str",50);
  String methylationRateFilename=CLI.getOption(args,"String_Node_Str","String_Node_Str");
  SimulateBisulfiteReads processor=new SimulateBisulfiteReads();
  final boolean bisulfite=CLI.isKeywordGiven(args,"String_Node_Str");
  if (bisulfite) {
    System.out.println("String_Node_Str");
  }
  processor.bisulfiteTreatment=bisulfite;
  processor.readLength=readLength;
  processor.outputFilename=outputFilename;
  processor.regionTrueRates=regionTrueRates;
  processor.process(refChoice,fastaReference,from,to,methylationRateFilename);
}
Program: 50416
Project: 50416
Buggy source:
private CharSequence reverseComplement(CharSequence selectedReadRegion){
  MutableString s=new MutableString();
  s.setLength(selectedReadRegion.length());
  int j=0;
  for (int i=s.length() - 1; i >= 0; i--) {
    char base=selectedReadRegion.charAt(i);
switch (base) {
case 'A':
      base='T';
    break;
case 'C':
  base='G';
break;
case 'T':
base='C';
break;
case 'G':
base='C';
break;
default :
base='N';
break;
}
s.charAt(j++,base);
}
return s;
}

Fixed version (ground truth):
private CharSequence reverseComplement(CharSequence selectedReadRegion){
  MutableString s=new MutableString();
  s.setLength(selectedReadRegion.length());
  int j=0;
  for (int i=s.length() - 1; i >= 0; i--) {
    char base=selectedReadRegion.charAt(i);
switch (base) {
case 'A':
      base='T';
    break;
case 'C':
  base='G';
break;
case 'T':
base='A';
break;
case 'G':
base='C';
break;
default :
base='N';
break;
}
s.charAt(j++,base);
}
return s;
}
Program: 50418
Project: 50418
Buggy source:
private void writeZygozity(SampleCountInfo[] sampleCounts){
  for (int sampleIndex=0; sampleIndex < numberOfSamples; sampleIndex++) {
    SampleCountInfo sci=sampleCounts[sampleIndex];
    String zygozity;
switch (alleleSet.size()) {
case 0:
      zygozity="String_Node_Str";
    break;
case 1:
  zygozity="String_Node_Str";
genotypeBuffer.setLength(0);
genotypeBuffer.append(String.format("String_Node_Str",sci.referenceBase,sci.referenceBase));
break;
case 2:
zygozity="String_Node_Str";
break;
default :
zygozity="String_Node_Str";
break;
}
statsWriter.setSampleValue(zygFieldIndex,sampleIndex,zygozity);
}
}

Fixed version (ground truth):
private void writeZygozity(SampleCountInfo[] sampleCounts){
  for (int sampleIndex=0; sampleIndex < numberOfSamples; sampleIndex++) {
    SampleCountInfo sci=sampleCounts[sampleIndex];
    String zygozity;
switch (alleleSet.size()) {
case 0:
      zygozity="String_Node_Str";
    break;
case 1:
  zygozity="String_Node_Str";
break;
case 2:
zygozity="String_Node_Str";
break;
default :
zygozity="String_Node_Str";
break;
}
statsWriter.setSampleValue(zygFieldIndex,sampleIndex,zygozity);
}
}
Program: 50420
Project: 50420
Buggy source:
/** 
 * Read the header of this file. Headers in the VCF format are supported, as well as TSV single header lines (with or without first character #.
 * @throws SyntaxException When the syntax of the VCF file is incorrect.
 */
public void readHeader() throws SyntaxException {
  globalFieldIndex=0;
  fieldIndexToName=new Int2ObjectOpenHashMap<String>();
  bufferedReader=new FastBufferedReader(input);
  lineIterator=new LineIterator(bufferedReader);
  int lineNumber=1;
  while (lineIterator.hasNext()) {
    line=lineIterator.next();
    if (!line.startsWith("String_Node_Str")) {
      if (lineNumber == 1) {
        parseHeaderLine(new MutableString("String_Node_Str" + line));
      }
 else {
        parseCurrentLine();
        hasNextDataLine=true;
      }
      break;
    }
    if (line.startsWith("String_Node_Str")) {
      TSV=false;
      processMetaInfoLine(line);
    }
 else     if (line.startsWith("String_Node_Str")) {
      parseHeaderLine(line);
    }
    lineNumber++;
  }
}

Fixed version (ground truth):
/** 
 * Read the header of this file. Headers in the VCF format are supported, as well as TSV single header lines (with or without first character #.
 * @throws SyntaxException When the syntax of the VCF file is incorrect.
 */
public void readHeader() throws SyntaxException {
  if (headerParsed)   return;
  headerParsed=true;
  globalFieldIndex=0;
  fieldIndexToName=new Int2ObjectOpenHashMap<String>();
  bufferedReader=new FastBufferedReader(input);
  lineIterator=new LineIterator(bufferedReader);
  int lineNumber=1;
  while (lineIterator.hasNext()) {
    line=lineIterator.next();
    if (line.startsWith("String_Node_Str")) {
      TSV=false;
    }
    if (!line.startsWith("String_Node_Str")) {
      if (TSV && lineNumber == 1 && headerLineNotParsed) {
        parseHeaderLine(new MutableString("String_Node_Str" + line));
      }
 else {
        parseCurrentLine();
        hasNextDataLine=true;
      }
      break;
    }
    if (line.startsWith("String_Node_Str")) {
      TSV=false;
      processMetaInfoLine(line);
    }
 else     if (line.startsWith("String_Node_Str")) {
      parseHeaderLine(line);
    }
    lineNumber++;
  }
}
Program: 50421
Project: 50421
Buggy source:
/** 
 * Returns the value of the field. The field is identified by a global index that runs from zero (inclusive) to countAllFields() (exclusive).
 * @param globalFieldIndex a global index that runs from zero to countAllFields()
 * @return Value of this field.
 */
public CharSequence getFieldValue(int globalFieldIndex){
}

Fixed version (ground truth):
/** 
 * Returns the value of the field. The field is identified by a global index that runs from zero (inclusive) to countAllFields() (exclusive).
 * @param globalFieldIndex a global index that runs from zero to countAllFields()
 * @return Value of this field.
 */
public CharSequence getFieldValue(final int globalFieldIndex){
}
Program: 50423
Project: 50423
Buggy source:
protected void adjustRefVarCounts(SampleCountInfo[] sampleCounts,int[] removed){
}

Fixed version (ground truth):
protected void adjustRefVarCounts(SampleCountInfo[] sampleCounts){
}
Program: 50424
Project: 50424
Buggy source:
/** 
 * Adjust list and sampleCounts to remove/reduce the effect of sequencing errors.
 * @param list Variation or reference bases at position
 * @param sampleCounts Counts for alleles at position each each sample under study.
 */
public abstract void filterBases(ObjectArrayList<PositionBaseInfo> list,SampleCountInfo[] sampleCounts,ObjectArrayList<PositionBaseInfo> filteredList);

Fixed version (ground truth):
/** 
 * Adjust list and sampleCounts to remove/reduce the effect of sequencing errors.
 * @param list         Variation or reference bases at position
 * @param sampleCounts Counts for alleles at position each each sample under study.
 */
public abstract void filterBases(ObjectArrayList<PositionBaseInfo> list,SampleCountInfo[] sampleCounts,ObjectArrayList<PositionBaseInfo> filteredList);
Program: 50426
Project: 50426
Buggy source:
public void filterBases(ObjectArrayList<PositionBaseInfo> list,SampleCountInfo[] sampleCounts,ObjectArrayList<PositionBaseInfo> filteredList){
  resetCounters();
  int removedBaseCount=filteredList.size() / sampleCounts.length;
  int removedBaseCountThreshold=removedBaseCount * MULTIPLIER;
  Arrays.fill(removed,0);
  for (  PositionBaseInfo positionBaseInfo : list) {
    numScreened++;
    final int sampleIndex=positionBaseInfo.readerIndex;
    char base=positionBaseInfo.matchesReference ? positionBaseInfo.from : positionBaseInfo.to;
    final SampleCountInfo sampleCountInfo=sampleCounts[sampleIndex];
    final int baseIndex=sampleCountInfo.baseIndex(base);
    final int count=sampleCountInfo.counts[baseIndex];
    if (count == 0)     continue;
    if (count < removedBaseCountThreshold) {
      removed[baseIndex]++;
      sampleCountInfo.counts[baseIndex]=0;
      filteredList.add(positionBaseInfo);
      numFiltered++;
    }
  }
  adjustRefVarCounts(sampleCounts,removed);
}

Fixed version (ground truth):
public void filterBases(ObjectArrayList<PositionBaseInfo> list,SampleCountInfo[] sampleCounts,ObjectArrayList<PositionBaseInfo> filteredList){
  resetCounters();
  initStorage(sampleCounts.length);
  int removedBaseCount=filteredList.size() / sampleCounts.length;
  int removedBaseCountThreshold=removedBaseCount * MULTIPLIER;
  Arrays.fill(removed,0);
  int removedVarCount=0;
  for (  PositionBaseInfo positionBaseInfo : list) {
    numScreened++;
    final int sampleIndex=positionBaseInfo.readerIndex;
    char base=positionBaseInfo.matchesReference ? positionBaseInfo.from : positionBaseInfo.to;
    final SampleCountInfo sampleCountInfo=sampleCounts[sampleIndex];
    final int baseIndex=sampleCountInfo.baseIndex(base);
    final int count=sampleCountInfo.counts[baseIndex];
    if (count == 0)     continue;
    if (count < removedBaseCountThreshold) {
      sampleCountInfo.counts[baseIndex]--;
      if (base == sampleCountInfo.referenceBase) {
        refCountRemovedPerSample[sampleIndex]++;
      }
 else {
        varCountRemovedPerSample[sampleIndex]++;
      }
      filteredList.add(positionBaseInfo);
      numFiltered++;
    }
  }
  adjustRefVarCounts(sampleCounts);
}
Program: 50427
Project: 50427
Buggy source:
@Override public String toString(){
  return matchesReference ? "String_Node_Str" + from : from + "String_Node_Str" + to+ "String_Node_Str"+ qualityScore;
}

Fixed version (ground truth):
@Override public String toString(){
  return matchesReference ? String.format("String_Node_Str",from,readerIndex) : String.format("String_Node_Str",from,to,qualityScore,readerIndex);
}
Program: 50428
Project: 50428
Buggy source:
public void filterBases(ObjectArrayList<PositionBaseInfo> list,SampleCountInfo[] sampleCounts,ObjectArrayList<PositionBaseInfo> filteredList){
  resetCounters();
  Arrays.fill(removed,0);
  for (  PositionBaseInfo info : list) {
    numScreened++;
    if (!info.matchesReference && info.qualityScore < scoreThreshold) {
      filteredList.add(info);
      final SampleCountInfo countInfo=sampleCounts[info.readerIndex];
      final int baseIndex=countInfo.baseIndex(info.to);
      countInfo.counts[baseIndex]--;
      removed[baseIndex]++;
      numFiltered++;
    }
  }
  adjustRefVarCounts(sampleCounts,removed);
}

Fixed version (ground truth):
public void filterBases(ObjectArrayList<PositionBaseInfo> list,SampleCountInfo[] sampleCounts,ObjectArrayList<PositionBaseInfo> filteredList){
  resetCounters();
  initStorage(sampleCounts.length);
  Arrays.fill(removed,0);
  int removedVarCount=0;
  for (  PositionBaseInfo info : list) {
    numScreened++;
    if (!info.matchesReference && info.qualityScore < scoreThreshold) {
      filteredList.add(info);
      final SampleCountInfo countInfo=sampleCounts[info.readerIndex];
      final int baseIndex=countInfo.baseIndex(info.to);
      countInfo.counts[baseIndex]--;
      removed[baseIndex]++;
      this.varCountRemovedPerSample[info.readerIndex]++;
      numFiltered++;
    }
  }
  adjustRefVarCounts(sampleCounts);
}
Program: 50431
Project: 50431
Buggy source:
@Override public void processAlignmentEntry(final AlignmentReader alignmentReader,final Alignments.AlignmentEntry alignmentEntry){
  numAlignmentEntries+=alignmentEntry.getMultiplicity();
  referenceBaseCount+=alignmentEntry.getQueryLength();
  for (  final Alignments.SequenceVariation var : alignmentEntry.getSequenceVariationsList()) {
    int toLength=var.getTo().length();
    for (int i=0; i < toLength; i++) {
      if (var.getReadIndex() < 0) {
        System.out.printf("String_Node_Str",var.getReadIndex());
      }
      final int readIndex=var.getReadIndex() + (alignmentEntry.getMatchingReverseStrand() ? 0 : 1) * i;
      final int value=readIndexVariationTally.get(readIndex);
      final int changedBases=alignmentEntry.getMultiplicity();
      readIndexVariationTally.put(readIndex,value + changedBases);
      referenceBaseCount-=changedBases;
    }
  }
}

Fixed version (ground truth):
@Override public void processAlignmentEntry(final AlignmentReader alignmentReader,final Alignments.AlignmentEntry alignmentEntry){
  numAlignmentEntries+=alignmentEntry.getMultiplicity();
  referenceBaseCount+=alignmentEntry.getQueryLength();
  for (  final Alignments.SequenceVariation var : alignmentEntry.getSequenceVariationsList()) {
    int toLength=var.getTo().length();
    int readIndex=var.getReadIndex();
    for (int i=0; i < toLength; i++) {
      if (var.getReadIndex() < 0) {
        System.out.printf("String_Node_Str",var.getReadIndex());
      }
      char toChar=var.getTo().charAt(i);
      readIndex+=toChar == '-' ? 0 : (alignmentEntry.getMatchingReverseStrand() ? -1 : 1);
      final int value=readIndexVariationTally.get(readIndex);
      final int changedBases=alignmentEntry.getMultiplicity();
      readIndexVariationTally.put(readIndex,value + changedBases);
      referenceBaseCount-=changedBases;
    }
  }
}
Program: 50433
Project: 50433
Buggy source:
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;
}

Fixed version (ground truth):
private byte[] trimQualityScores(byte[] qualityScores,int trimReadStartLength,int trimReadLength,int initialLength){
  if (qualityScores == null)   return null;
  int offset=trimReadStartLength;
  if (offset < 0)   offset=0;
  byte[] trimmedScores=new byte[Math.min(initialLength,trimReadLength) - offset];
  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;
}