Program: 50976
Project: 50976
Buggy source:
private void recordCellRequest2(final CellRequest request){
  final AggregationKey key=new AggregationKey(request);
  final Map<String,Comparable<?>> mappedCellValues=request.getMappedCellValues();
  final List<String> compoundPredicates=AggregationKey.getCompoundPredicateStringList(key.getStar(),key.getCompoundPredicateList());
  for (  SegmentHeader header : cacheHeaders) {
    if (SegmentCacheIndexImpl.matches(header,mappedCellValues,compoundPredicates)) {
      return;
    }
  }
  final RolapStar.Measure measure=request.getMeasure();
  final RolapStar star=measure.getStar();
  final RolapSchema schema=star.getSchema();
  final List<SegmentHeader> headersInCache=cacheMgr.segmentIndex.locate(schema.getName(),schema.getChecksum(),measure.getCubeName(),measure.getName(),star.getFactTable().getAlias(),request.getConstrainedColumnsBitKey(),mappedCellValues,compoundPredicates);
  final SegmentBuilder.SegmentConverterImpl converter=new SegmentBuilder.SegmentConverterImpl(key,request);
  if (!headersInCache.isEmpty()) {
    final SegmentHeader headerInCache=headersInCache.get(0);
    final Future<SegmentBody> future=cacheMgr.segmentIndex.getFuture(headerInCache);
    if (future != null) {
      futures.add(future);
    }
 else {
      cacheHeaders.add(headerInCache);
    }
    cacheMgr.segmentIndex.setConverter(headerInCache.schemaName,headerInCache.schemaChecksum,headerInCache.cubeName,headerInCache.rolapStarFactTableName,headerInCache.measureName,headerInCache.compoundPredicates,converter);
    converterMap.put(SegmentCacheIndexImpl.makeConverterKey(request,key),converter);
    return;
  }
  if (measure.getAggregator().getRollup().supportsFastAggregates(measure.getDatatype()) && !rollupBitmaps.contains(request.getConstrainedColumnsBitKey())) {
    final List<List<SegmentHeader>> rollup=cacheMgr.segmentIndex.findRollupCandidates(schema.getName(),schema.getChecksum(),measure.getCubeName(),measure.getName(),star.getFactTable().getAlias(),request.getConstrainedColumnsBitKey(),mappedCellValues,AggregationKey.getCompoundPredicateStringList(star,key.getCompoundPredicateList()));
    if (!rollup.isEmpty()) {
      rollups.add(new RollupInfo(request,rollup));
      rollupBitmaps.add(request.getConstrainedColumnsBitKey());
      converterMap.put(SegmentCacheIndexImpl.makeConverterKey(request,key),new SegmentBuilder.StarSegmentConverter(measure,key.getCompoundPredicateList()));
      return;
    }
  }
  Batch batch=batches.get(key);
  if (batch == null) {
    batch=new Batch(request);
    batches.put(key,batch);
    converterMap.put(SegmentCacheIndexImpl.makeConverterKey(request,key),converter);
    if (LOGGER.isDebugEnabled()) {
      StringBuilder buf=new StringBuilder(100);
      buf.append("String_Node_Str");
      buf.append(request.getConstrainedColumnsBitKey());
      buf.append(Util.nl);
      for (      RolapStar.Column column : request.getConstrainedColumns()) {
        buf.append("String_Node_Str");
        buf.append(column);
        buf.append(Util.nl);
      }
      LOGGER.debug(buf.toString());
    }
  }
  batch.add(request);
}

Fixed version (ground truth):
private void recordCellRequest2(final CellRequest request){
  final AggregationKey key=new AggregationKey(request);
  final Map<String,Comparable<?>> mappedCellValues=request.getMappedCellValues();
  final List<String> compoundPredicates=AggregationKey.getCompoundPredicateStringList(key.getStar(),key.getCompoundPredicateList());
  for (  SegmentHeader header : cacheHeaders) {
    if (SegmentCacheIndexImpl.matches(header,mappedCellValues,compoundPredicates)) {
      return;
    }
  }
  final RolapStar.Measure measure=request.getMeasure();
  final RolapStar star=measure.getStar();
  final RolapSchema schema=star.getSchema();
  final List<SegmentHeader> headersInCache=cacheMgr.segmentIndex.locate(schema.getName(),schema.getChecksum(),measure.getCubeName(),measure.getName(),star.getFactTable().getAlias(),request.getConstrainedColumnsBitKey(),mappedCellValues,compoundPredicates);
  final SegmentBuilder.SegmentConverterImpl converter=new SegmentBuilder.SegmentConverterImpl(key,request);
  if (!headersInCache.isEmpty()) {
    final SegmentHeader headerInCache=headersInCache.get(0);
    final Future<SegmentBody> future=cacheMgr.segmentIndex.getFuture(headerInCache);
    if (future != null) {
      futures.put(headerInCache,future);
    }
 else {
      cacheHeaders.add(headerInCache);
    }
    cacheMgr.segmentIndex.setConverter(headerInCache.schemaName,headerInCache.schemaChecksum,headerInCache.cubeName,headerInCache.rolapStarFactTableName,headerInCache.measureName,headerInCache.compoundPredicates,converter);
    converterMap.put(SegmentCacheIndexImpl.makeConverterKey(request,key),converter);
    return;
  }
  if (measure.getAggregator().getRollup().supportsFastAggregates(measure.getDatatype()) && !rollupBitmaps.contains(request.getConstrainedColumnsBitKey())) {
    final List<List<SegmentHeader>> rollup=cacheMgr.segmentIndex.findRollupCandidates(schema.getName(),schema.getChecksum(),measure.getCubeName(),measure.getName(),star.getFactTable().getAlias(),request.getConstrainedColumnsBitKey(),mappedCellValues,AggregationKey.getCompoundPredicateStringList(star,key.getCompoundPredicateList()));
    if (!rollup.isEmpty()) {
      rollups.add(new RollupInfo(request,rollup));
      rollupBitmaps.add(request.getConstrainedColumnsBitKey());
      converterMap.put(SegmentCacheIndexImpl.makeConverterKey(request,key),new SegmentBuilder.StarSegmentConverter(measure,key.getCompoundPredicateList()));
      return;
    }
  }
  Batch batch=batches.get(key);
  if (batch == null) {
    batch=new Batch(request);
    batches.put(key,batch);
    converterMap.put(SegmentCacheIndexImpl.makeConverterKey(request,key),converter);
    if (LOGGER.isDebugEnabled()) {
      StringBuilder buf=new StringBuilder(100);
      buf.append("String_Node_Str");
      buf.append(request.getConstrainedColumnsBitKey());
      buf.append(Util.nl);
      for (      RolapStar.Column column : request.getConstrainedColumns()) {
        buf.append("String_Node_Str");
        buf.append(column);
        buf.append(Util.nl);
      }
      LOGGER.debug(buf.toString());
    }
  }
  batch.add(request);
}