Program: 31066
Project: 31066
Buggy source:
public ResampledRecordSource(RecordSource recordSource,int timestampColumnIndex,@Transient ObjHashSet<String> keyColumns,ObjList<AggregatorFunction> aggregators,TimestampSampler sampler,int pageSize,RecordKeyCopierCompiler compiler){
  int keyColumnsSize=keyColumns.size();
  IntList keyIndices=new IntList(keyColumnsSize);
  ObjHashSet<String> keyCols=new ObjHashSet<>();
  RecordMetadata rm=recordSource.getMetadata();
  this.tsIndex=timestampColumnIndex;
  keyCols.add(rm.getColumnName(tsIndex));
  for (int i=0; i < keyColumnsSize; i++) {
    keyCols.add(keyColumns.get(i));
    int index=rm.getColumnIndex(keyColumns.get(i));
    if (index != tsIndex) {
      keyIndices.add(index);
    }
  }
  this.aggregators=aggregators;
  this.sampler=sampler;
  this.copier=compiler.compile(rm,keyIndices);
  ObjList<MapRecordValueInterceptor> interceptors=null;
  ObjList<RecordColumnMetadata> columns=AggregationUtils.TL_COLUMNS.get();
  columns.clear();
  int index=0;
  for (int i=0, sz=aggregators.size(); i < sz; i++) {
    AggregatorFunction func=aggregators.getQuick(i);
    int n=columns.size();
    func.prepare(columns,index);
    index+=columns.size() - n;
    if (func instanceof MapRecordValueInterceptor) {
      if (interceptors == null) {
        interceptors=new ObjList<>();
      }
      interceptors.add((MapRecordValueInterceptor)func);
    }
  }
  this.interceptors=interceptors;
  this.storageFacade=new DirectMapStorageFacade(columns.size() + 1,keyIndices);
  this.metadata=new DirectMapMetadata(rm,keyCols,columns);
  this.record=new DirectMapRecord(this.storageFacade);
  this.map=new DirectMap(pageSize,keyCols.size(),AggregationUtils.toThreadLocalTypes(columns));
  this.recordSource=recordSource;
}

Fixed version (ground truth):
public ResampledRecordSource(RecordSource recordSource,int timestampColumnIndex,@Transient ObjHashSet<String> keyColumns,ObjList<AggregatorFunction> aggregators,TimestampSampler sampler,int pageSize,RecordKeyCopierCompiler compiler){
  int keyColumnsSize=keyColumns.size();
  IntList keyIndices=new IntList(keyColumnsSize);
  ObjHashSet<String> keyCols=new ObjHashSet<>();
  RecordMetadata rm=recordSource.getMetadata();
  this.tsIndex=timestampColumnIndex;
  keyCols.add(rm.getColumnName(tsIndex));
  for (int i=0; i < keyColumnsSize; i++) {
    keyCols.add(keyColumns.get(i));
    int index=rm.getColumnIndex(keyColumns.get(i));
    if (index != tsIndex) {
      keyIndices.add(index);
    }
  }
  this.aggregators=aggregators;
  this.sampler=sampler;
  this.copier=compiler.compile(rm,keyIndices);
  ObjList<MapRecordValueInterceptor> interceptors=null;
  ObjList<RecordColumnMetadata> columns=AggregationUtils.TL_COLUMNS.get();
  columns.clear();
  int index=0;
  for (int i=0, sz=aggregators.size(); i < sz; i++) {
    AggregatorFunction func=aggregators.getQuick(i);
    int n=columns.size();
    func.prepare(columns,index);
    index+=columns.size() - n;
    if (func instanceof MapRecordValueInterceptor) {
      if (interceptors == null) {
        interceptors=new ObjList<>();
      }
      interceptors.add((MapRecordValueInterceptor)func);
    }
  }
  this.interceptors=interceptors;
  this.storageFacade=new DirectMapStorageFacade(columns.size() + 1,keyIndices);
  this.metadata=new DirectMapMetadata(rm,keyCols,columns);
  this.record=new DirectMapRecord(this.storageFacade);
  this.map=new DirectMap(pageSize,tlMetadataTypeResolver.get().of(rm,keyCols),tlAggregationTypeResolver.get().of(columns));
  this.recordSource=recordSource;
}