Program: 6143
Project: 6143
Buggy source:
/** 
 * Finds all measure names of the facts that match given   {@link DimensionValue}s and time range.
 * @param allDimensionNames list of all dimension names to be present in the fact record
 * @param dimensionSlice dimension values to filter by, {@code null} means any non-null value.
 * @param startTs start timestamp, in sec
 * @param endTs end timestamp, in sec
 * @return {@link Set} of measure names
 */
public Set<String> findMeasureNames(List<String> allDimensionNames,Map<String,String> dimensionSlice,long startTs,long endTs){
  List<DimensionValue> allDimensions=Lists.newArrayList();
  for (  String dimensionName : allDimensionNames) {
    allDimensions.add(new DimensionValue(dimensionName,dimensionSlice.get(dimensionName)));
  }
  byte[] startRow=codec.createStartRowKey(allDimensions,null,startTs,false);
  byte[] endRow=codec.createEndRowKey(allDimensions,null,endTs,false);
  endRow=Bytes.stopKeyForPrefix(endRow);
  FuzzyRowFilter fuzzyRowFilter=createFuzzyRowFilter(new FactScan(startTs,endTs,ImmutableList.<String>of(),allDimensions),startRow);
  Set<String> measureNames=Sets.newHashSet();
  int scannedRecords=0;
  Scanner scanner=timeSeriesTable.scan(startRow,endRow,fuzzyRowFilter);
  try {
    Row rowResult;
    while ((rowResult=scanner.next()) != null) {
      scannedRecords++;
      if (scannedRecords > MAX_RECORDS_TO_SCAN_DURING_SEARCH) {
        break;
      }
      byte[] rowKey=rowResult.getRow();
      if (codec.getTimestamp(rowKey,codec.createColumn(startTs)) < startTs) {
        continue;
      }
      if (codec.getTimestamp(rowKey,codec.createColumn(endTs)) > endTs) {
        break;
      }
      measureNames.add(codec.getMeasureName(rowResult.getRow()));
    }
  }
  finally {
    scanner.close();
  }
  LOG.trace("String_Node_Str",scannedRecords);
  return measureNames;
}

Fixed version (ground truth):
/** 
 * Finds all measure names of the facts that match given   {@link DimensionValue}s and time range.
 * @param allDimensionNames list of all dimension names to be present in the fact record
 * @param dimensionSlice dimension values to filter by, {@code null} means any non-null value.
 * @param startTs start timestamp, in sec
 * @param endTs end timestamp, in sec
 * @return {@link Set} of measure names
 */
public Set<String> findMeasureNames(List<String> allDimensionNames,Map<String,String> dimensionSlice,long startTs,long endTs){
  List<DimensionValue> allDimensions=Lists.newArrayList();
  for (  String dimensionName : allDimensionNames) {
    allDimensions.add(new DimensionValue(dimensionName,dimensionSlice.get(dimensionName)));
  }
  byte[] startRow=codec.createStartRowKey(allDimensions,null,startTs,false);
  byte[] endRow=codec.createEndRowKey(allDimensions,null,endTs,false);
  endRow=Bytes.stopKeyForPrefix(endRow);
  FuzzyRowFilter fuzzyRowFilter=createFuzzyRowFilter(new FactScan(startTs,endTs,ImmutableList.<String>of(),allDimensions),startRow);
  Set<String> measureNames=Sets.newHashSet();
  int scannedRecords=0;
  try (Scanner scanner=timeSeriesTable.scan(startRow,endRow,fuzzyRowFilter)){
    Row rowResult;
    while ((rowResult=scanner.next()) != null) {
      scannedRecords++;
      if (scannedRecords > MAX_RECORDS_TO_SCAN_DURING_SEARCH) {
        break;
      }
      byte[] rowKey=rowResult.getRow();
      if (codec.getTimestamp(rowKey,codec.createColumn(startTs)) < startTs) {
        continue;
      }
      if (codec.getTimestamp(rowKey,codec.createColumn(endTs)) > endTs) {
        break;
      }
      measureNames.add(codec.getMeasureName(rowResult.getRow()));
    }
  }
   LOG.trace("String_Node_Str",scannedRecords);
  return measureNames;
}