Program: 30631
Project: 30631
Buggy source:
/** 
 * run method which extracts barcodes and accumulates metrics for an entire tile
 */
synchronized public void run(){
  log.info("String_Node_Str" + tile);
  final IlluminaDataProvider provider=factory.makeDataProvider(Arrays.asList(tile));
  final int[] barcodeIndices=outputReadStructure.barcodes.getIndices();
  final BufferedWriter writer=IoUtil.openFileForBufferedWriting(barcodeFile);
  try {
    final byte barcodeSubsequences[][]=new byte[barcodeIndices.length][];
    final byte qualityScores[][]=usingQualityScores ? new byte[barcodeIndices.length][] : null;
    while (provider.hasNext()) {
      final ClusterData cluster=provider.next();
      for (int i=0; i < barcodeIndices.length; i++) {
        barcodeSubsequences[i]=cluster.getRead(barcodeIndices[i]).getBases();
        if (usingQualityScores)         qualityScores[i]=cluster.getRead(barcodeIndices[i]).getQualities();
      }
      final boolean passingFilter=cluster.isPf();
      final BarcodeMatch match=findBestBarcodeAndUpdateMetrics(barcodeSubsequences,qualityScores,passingFilter,metrics,noMatchMetric);
      final String yOrN=(match.matched ? "String_Node_Str" : "String_Node_Str");
      for (      final byte[] bc : barcodeSubsequences) {
        writer.write(StringUtil.bytesToString(bc) + "String_Node_Str");
      }
      writer.write(yOrN + "String_Node_Str" + match.barcode+ "String_Node_Str"+ String.valueOf(match.mismatches)+ "String_Node_Str"+ String.valueOf(match.mismatchesToSecondBest));
      writer.newLine();
    }
    writer.close();
  }
 catch (  Exception e) {
    log.error(e,"String_Node_Str",this.tile);
    this.exception=e;
  }
}

Fixed version (ground truth):
/** 
 * run method which extracts barcodes and accumulates metrics for an entire tile
 */
synchronized public void run(){
  log.info("String_Node_Str" + tile);
  final IlluminaDataProvider provider=factory.makeDataProvider(Arrays.asList(tile));
  final int[] barcodeIndices=outputReadStructure.barcodes.getIndices();
  final BufferedWriter writer=IoUtil.openFileForBufferedWriting(barcodeFile);
  try {
    final byte barcodeSubsequences[][]=new byte[barcodeIndices.length][];
    final byte qualityScores[][]=usingQualityScores ? new byte[barcodeIndices.length][] : null;
    while (provider.hasNext()) {
      final ClusterData cluster=provider.next();
      for (int i=0; i < barcodeIndices.length; i++) {
        barcodeSubsequences[i]=cluster.getRead(barcodeIndices[i]).getBases();
        if (usingQualityScores)         qualityScores[i]=cluster.getRead(barcodeIndices[i]).getQualities();
      }
      final boolean passingFilter=cluster.isPf();
      final BarcodeMatch match=findBestBarcodeAndUpdateMetrics(barcodeSubsequences,qualityScores,passingFilter,metrics,noMatchMetric);
      final String yOrN=(match.matched ? "String_Node_Str" : "String_Node_Str");
      for (      final byte[] bc : barcodeSubsequences) {
        writer.write(StringUtil.bytesToString(bc));
      }
      writer.write("String_Node_Str" + yOrN + "String_Node_Str"+ match.barcode+ "String_Node_Str"+ String.valueOf(match.mismatches)+ "String_Node_Str"+ String.valueOf(match.mismatchesToSecondBest));
      writer.newLine();
    }
    writer.close();
  }
 catch (  Exception e) {
    log.error(e,"String_Node_Str",this.tile);
    this.exception=e;
  }
}