Program: 30719
Project: 30719
Buggy source:
private void reloadColumnAt(Path path,ObjList<ReadOnlyColumn> columns,LongList columnTops,ObjList<BitmapIndexReader> indexReaders,int columnBase,int columnIndex,long partitionRowCount){
  int plen=path.length();
  try {
    final CharSequence name=metadata.getColumnName(columnIndex);
    final int primaryIndex=getPrimaryColumnIndex(columnBase,columnIndex);
    final int secondaryIndex=primaryIndex + 1;
    ReadOnlyColumn mem1=columns.getQuick(primaryIndex);
    ReadOnlyColumn mem2=columns.getQuick(secondaryIndex);
    if (ff.exists(TableUtils.dFile(path.trimTo(plen),name))) {
      if (mem1 instanceof ReadOnlyMemory) {
        ((ReadOnlyMemory)mem1).of(ff,path,ff.getMapPageSize(),0);
      }
 else {
        mem1=new ReadOnlyMemory(ff,path,ff.getMapPageSize(),0);
        columns.setQuick(primaryIndex,mem1);
      }
      final long columnTop=TableUtils.readColumnTop(ff,path.trimTo(plen),name,plen,tempMem8b);
      final int type=metadata.getColumnType(columnIndex);
switch (type) {
case ColumnType.BINARY:
case ColumnType.STRING:
        TableUtils.iFile(path.trimTo(plen),name);
      if (mem2 instanceof ReadOnlyMemory) {
        ((ReadOnlyMemory)mem2).of(ff,path,ff.getMapPageSize(),0);
      }
 else {
        mem2=new ReadOnlyMemory(ff,path,ff.getMapPageSize(),0);
        columns.setQuick(secondaryIndex,mem2);
      }
    growColumn(mem1,mem2,type,partitionRowCount - columnTop);
  break;
default :
Misc.free(columns.getAndSetQuick(secondaryIndex,null));
growColumn(mem1,null,type,partitionRowCount - columnTop);
break;
}
columnTops.setQuick(columnBase / 2 + columnIndex,columnTop);
if (metadata.isColumnIndexed(columnIndex)) {
BitmapIndexReader indexReader=indexReaders.getQuick(primaryIndex);
if (indexReader instanceof BitmapIndexBackwardReader) {
((BitmapIndexBackwardReader)indexReader).of(configuration,path.trimTo(plen),name,columnTop);
}
indexReader=indexReaders.getQuick(secondaryIndex);
if (indexReader instanceof BitmapIndexForwardReader) {
((BitmapIndexForwardReader)indexReader).of(configuration,path.trimTo(plen),name,columnTop);
}
}
 else {
Misc.free(indexReaders.getAndSetQuick(primaryIndex,null));
Misc.free(indexReaders.getAndSetQuick(secondaryIndex,null));
}
}
 else {
Misc.free(columns.getAndSetQuick(primaryIndex,NullColumn.INSTANCE));
Misc.free(columns.getAndSetQuick(secondaryIndex,NullColumn.INSTANCE));
Misc.free(indexReaders.getAndSetQuick(primaryIndex,null));
Misc.free(indexReaders.getAndSetQuick(secondaryIndex,null));
}
}
  finally {
path.trimTo(plen);
}
}

Fixed version (ground truth):
private void reloadColumnAt(Path path,ObjList<ReadOnlyColumn> columns,LongList columnTops,ObjList<BitmapIndexReader> indexReaders,int columnBase,int columnIndex,long partitionRowCount){
  int plen=path.length();
  try {
    final CharSequence name=metadata.getColumnName(columnIndex);
    final int primaryIndex=getPrimaryColumnIndex(columnBase,columnIndex);
    final int secondaryIndex=primaryIndex + 1;
    ReadOnlyColumn mem1=columns.getQuick(primaryIndex);
    ReadOnlyColumn mem2=columns.getQuick(secondaryIndex);
    if (ff.exists(TableUtils.dFile(path.trimTo(plen),name))) {
      if (mem1 instanceof ReadOnlyMemory) {
        ((ReadOnlyMemory)mem1).of(ff,path,ff.getMapPageSize(),0);
      }
 else {
        mem1=new ReadOnlyMemory(ff,path,ff.getMapPageSize(),0);
        columns.setQuick(primaryIndex,mem1);
      }
      final long columnTop=TableUtils.readColumnTop(ff,path.trimTo(plen),name,plen,tempMem8b);
      final int type=metadata.getColumnType(columnIndex);
switch (type) {
case ColumnType.BINARY:
case ColumnType.STRING:
        TableUtils.iFile(path.trimTo(plen),name);
      if (mem2 instanceof ReadOnlyMemory) {
        ((ReadOnlyMemory)mem2).of(ff,path,ff.getMapPageSize(),0);
      }
 else {
        mem2=new ReadOnlyMemory(ff,path,ff.getMapPageSize(),0);
        columns.setQuick(secondaryIndex,mem2);
      }
    growColumn(mem1,mem2,type,partitionRowCount - columnTop);
  break;
default :
Misc.free(columns.getAndSetQuick(secondaryIndex,null));
growColumn(mem1,null,type,partitionRowCount - columnTop);
break;
}
columnTops.setQuick(columnBase / 2 + columnIndex,columnTop);
if (metadata.isColumnIndexed(columnIndex)) {
BitmapIndexReader indexReader=indexReaders.getQuick(primaryIndex);
if (indexReader instanceof BitmapIndexBwdReader) {
((BitmapIndexBwdReader)indexReader).of(configuration,path.trimTo(plen),name,columnTop);
}
indexReader=indexReaders.getQuick(secondaryIndex);
if (indexReader instanceof BitmapIndexFwdReader) {
((BitmapIndexFwdReader)indexReader).of(configuration,path.trimTo(plen),name,columnTop);
}
}
 else {
Misc.free(indexReaders.getAndSetQuick(primaryIndex,null));
Misc.free(indexReaders.getAndSetQuick(secondaryIndex,null));
}
}
 else {
Misc.free(columns.getAndSetQuick(primaryIndex,NullColumn.INSTANCE));
Misc.free(columns.getAndSetQuick(secondaryIndex,NullColumn.INSTANCE));
Misc.free(indexReaders.getAndSetQuick(primaryIndex,null));
Misc.free(indexReaders.getAndSetQuick(secondaryIndex,null));
}
}
  finally {
path.trimTo(plen);
}
}