Program: 65369
Project: 65369
Buggy source:
public IDataSetResultSet loadDataSetData(IResultClass targetResultClass,IOrderedIntSet preFilteredRowIds,Map<String,StringTable> stringTableMap,Map index,boolean includeInnerID,Map appContext) throws DataException {
  if (targetResultClass == null)   targetResultClass=this.loadResultClass(includeInnerID);
  IDataSetReader reader=DataSetStore.createReader(streamManager,targetResultClass,appContext);
  if (reader != null)   return reader.load(preFilteredRowIds == null ? null : preFilteredRowIds);
  if (!streamManager.hasInStream(DataEngineContext.DATASET_DATA_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE))   return null;
  RAInputStream stream=streamManager.getInStream(DataEngineContext.DATASET_DATA_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  RAInputStream lensStream=null;
  if (version >= VersionManager.VERSION_2_2_1_3)   lensStream=streamManager.getInStream(DataEngineContext.DATASET_DATA_LEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  int adjustedVersion=resolveVersionConflict();
  if (includeInnerID) {
    List<ResultFieldMetadata> fields=new ArrayList<ResultFieldMetadata>(targetResultClass.getFieldCount() - 1);
    for (int i=1; i <= targetResultClass.getFieldCount(); i++) {
      ResultFieldMetadata f=targetResultClass.getFieldMetaData(i);
      if (f.getName().equals(ExprMetaUtil.POS_NAME))       continue;
      fields.add(f);
    }
    targetResultClass=new ResultClass(fields);
  }
  return new DataSetResultSet(stream,lensStream,targetResultClass,preFilteredRowIds,stringTableMap,index,adjustedVersion,includeInnerID);
}

Fixed version (ground truth):
public IDataSetResultSet loadDataSetData(IResultClass targetResultClass,IOrderedIntSet preFilteredRowIds,Map<String,StringTable> stringTableMap,Map index,boolean includeInnerID,Map appContext) throws DataException {
  boolean loadResultClass=false;
  if (targetResultClass == null) {
    targetResultClass=this.loadResultClass(includeInnerID);
    loadResultClass=true;
  }
  IDataSetReader reader=DataSetStore.createReader(streamManager,targetResultClass,appContext);
  if (reader != null)   return reader.load(preFilteredRowIds == null ? null : preFilteredRowIds);
  if (!streamManager.hasInStream(DataEngineContext.DATASET_DATA_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE))   return null;
  RAInputStream stream=streamManager.getInStream(DataEngineContext.DATASET_DATA_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  RAInputStream lensStream=null;
  if (version >= VersionManager.VERSION_2_2_1_3)   lensStream=streamManager.getInStream(DataEngineContext.DATASET_DATA_LEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  int adjustedVersion=resolveVersionConflict();
  if (loadResultClass && includeInnerID) {
    List<ResultFieldMetadata> fields=new ArrayList<ResultFieldMetadata>(targetResultClass.getFieldCount() - 1);
    for (int i=1; i <= targetResultClass.getFieldCount(); i++) {
      ResultFieldMetadata f=targetResultClass.getFieldMetaData(i);
      if (f.getName().equals(ExprMetaUtil.POS_NAME))       continue;
      fields.add(f);
    }
    targetResultClass=new ResultClass(fields);
  }
 else {
    targetResultClass=this.loadResultClass();
  }
  return new DataSetResultSet(stream,lensStream,targetResultClass,preFilteredRowIds,stringTableMap,index,adjustedVersion,includeInnerID);
}