nus-yam/ex-repair huggingface dataset:
Program: 65848
Project: 65848
Buggy source:
/** 
 * @param outputStream
 * @param filterList
 * @throws DataException
 */
static void saveGroupDefn(OutputStream outputStream,List groupList,int version) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  int size=groupList == null ? 0 : groupList.size();
  try {
    IOUtil.writeInt(dos,size);
    for (int i=0; i < size; i++) {
      IGroupDefinition groupDefn=(IGroupDefinition)groupList.get(i);
      IOUtil.writeString(dos,groupDefn.getName());
      IOUtil.writeString(dos,groupDefn.getKeyColumn());
      IOUtil.writeString(dos,groupDefn.getKeyExpression());
      IOUtil.writeInt(dos,groupDefn.getInterval());
      IOUtil.writeDouble(dos,groupDefn.getIntervalRange());
      IOUtil.writeInt(dos,groupDefn.getSortDirection());
      FilterDefnUtil.saveFilterDefn(dos,groupDefn.getFilters(),version);
      QueryDefnIOUtil.saveSorts(dos,groupDefn.getSorts(),version);
      QueryDefnIOUtil.saveSubQuery(dos,groupDefn.getSubqueries(),version);
    }
    dos.flush();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
/** 
 * @param outputStream
 * @param filterList
 * @throws DataException
 */
static void saveGroupDefn(OutputStream outputStream,List groupList,int version,String bundleVersion) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  int size=groupList == null ? 0 : groupList.size();
  try {
    IOUtil.writeInt(dos,size);
    for (int i=0; i < size; i++) {
      IGroupDefinition groupDefn=(IGroupDefinition)groupList.get(i);
      IOUtil.writeString(dos,groupDefn.getName());
      IOUtil.writeString(dos,groupDefn.getKeyColumn());
      IOUtil.writeString(dos,groupDefn.getKeyExpression());
      IOUtil.writeInt(dos,groupDefn.getInterval());
      IOUtil.writeDouble(dos,groupDefn.getIntervalRange());
      IOUtil.writeInt(dos,groupDefn.getSortDirection());
      FilterDefnUtil.saveFilterDefn(dos,groupDefn.getFilters(),version);
      QueryDefnIOUtil.saveSorts(dos,groupDefn.getSorts(),version);
      QueryDefnIOUtil.saveSubQuery(dos,groupDefn.getSubqueries(),version,bundleVersion);
    }
    dos.flush();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 65849
Project: 65849
Buggy source:
/** 
 * @throws IOException 
 * @throws DataException 
 */
static void saveSubQuery(OutputStream outputStream,Collection subQuery,int version) throws DataException, IOException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  if (subQuery == null) {
    IOUtil.writeInt(dos,0);
  }
 else {
    IOUtil.writeInt(dos,subQuery.size());
    Iterator it=subQuery.iterator();
    while (it.hasNext()) {
      ISubqueryDefinition subQueryDefn=(ISubqueryDefinition)it.next();
      IOUtil.writeString(dos,subQueryDefn.getName());
      IOUtil.writeBool(outputStream,subQueryDefn.applyOnGroup());
      saveBaseQueryDefn(outputStream,subQueryDefn,version);
    }
  }
  dos.flush();
}

Fixed version (ground truth):
/** 
 * @throws IOException 
 * @throws DataException 
 */
static void saveSubQuery(OutputStream outputStream,Collection subQuery,int version,String bundleVersion) throws DataException, IOException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  if (subQuery == null) {
    IOUtil.writeInt(dos,0);
  }
 else {
    IOUtil.writeInt(dos,subQuery.size());
    Iterator it=subQuery.iterator();
    while (it.hasNext()) {
      ISubqueryDefinition subQueryDefn=(ISubqueryDefinition)it.next();
      IOUtil.writeString(dos,subQueryDefn.getName());
      IOUtil.writeBool(outputStream,subQueryDefn.applyOnGroup());
      saveBaseQueryDefn(outputStream,subQueryDefn,version,bundleVersion);
    }
  }
  dos.flush();
}
Program: 65850
Project: 65850
Buggy source:
/** 
 * @param outputStream
 * @param queryDefn
 * @throws DataException
 * @throws IOException
 */
static void saveBaseQueryDefn(OutputStream outputStream,IBaseQueryDefinition queryDefn,int version) throws DataException {
  try {
    saveBinding(outputStream,queryDefn.getBindings(),version);
    FilterDefnUtil.saveFilterDefn(outputStream,queryDefn.getFilters(),version);
    GroupDefnUtil.saveGroupDefn(outputStream,queryDefn.getGroups(),version);
    saveSorts(outputStream,queryDefn.getSorts(),version);
    IOUtil.writeInt(outputStream,queryDefn.getMaxRows());
    IOUtil.writeBool(outputStream,queryDefn.usesDetails());
    if (version >= VersionManager.VERSION_2_5_2_1)     IOUtil.writeBool(outputStream,queryDefn.cacheQueryResults());
    saveSubQuery(outputStream,queryDefn.getSubqueries(),version);
    saveQueryExecutionHints(outputStream,queryDefn.getQueryExecutionHints(),version);
    saveSummaryTableInfo(outputStream,queryDefn,version);
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
/** 
 * @param outputStream
 * @param queryDefn
 * @throws DataException
 * @throws IOException
 */
static void saveBaseQueryDefn(OutputStream outputStream,IBaseQueryDefinition queryDefn,int version,String bundleVersion) throws DataException {
  try {
    saveBinding(outputStream,queryDefn.getBindings(),version);
    FilterDefnUtil.saveFilterDefn(outputStream,queryDefn.getFilters(),version);
    GroupDefnUtil.saveGroupDefn(outputStream,queryDefn.getGroups(),version,bundleVersion);
    saveSorts(outputStream,queryDefn.getSorts(),version);
    IOUtil.writeInt(outputStream,queryDefn.getMaxRows());
    IOUtil.writeBool(outputStream,queryDefn.usesDetails());
    if (version >= VersionManager.VERSION_2_5_2_1 && !"String_Node_Str".equals(bundleVersion))     IOUtil.writeBool(outputStream,queryDefn.cacheQueryResults());
    saveSubQuery(outputStream,queryDefn.getSubqueries(),version,bundleVersion);
    saveQueryExecutionHints(outputStream,queryDefn.getQueryExecutionHints(),version);
    saveSummaryTableInfo(outputStream,queryDefn,version);
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 65851
Project: 65851
Buggy source:
/** 
 * @param context
 * @param queryResultID
 * @param subQueryName
 * @param subQueryIndex
 * @throws DataException
 */
RDSave(DataEngineContext context,IBaseQueryDefinition queryDefn,int rowCount,QueryResultInfo queryResultInfo) throws DataException {
  this.context=context;
  this.rowCount=rowCount;
  this.queryDefn=queryDefn;
  this.streamManager=new StreamManager(context,queryResultInfo);
  this.rdSaveUtil=new RDSaveUtil(this.context.getMode(),queryDefn,this.streamManager);
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryResultID
 * @param subQueryName
 * @param subQueryIndex
 * @throws DataException
 */
RDSave(DataEngineContext context,IBaseQueryDefinition queryDefn,int rowCount,QueryResultInfo queryResultInfo) throws DataException {
  this.context=context;
  this.rowCount=rowCount;
  this.queryDefn=queryDefn;
  this.streamManager=new StreamManager(context,queryResultInfo);
  this.rdSaveUtil=new RDSaveUtil(this.context,queryDefn,this.streamManager);
}
Program: 65852
Project: 65852
Buggy source:
/** 
 * @param context
 * @param queryDefn
 * @param queryResultID
 * @param rowCount
 * @param subQueryName
 * @param subQueryIndex
 * @throws DataException
 */
RDSave2(DataEngineContext context,IBaseQueryDefinition queryDefn,QueryResultInfo queryResultInfo) throws DataException {
  this.context=context;
  this.streamManager=new StreamManager(context,queryResultInfo);
  this.saveUtilHelper=new RDSaveUtil(this.context.getMode(),queryDefn,this.streamManager);
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryDefn
 * @param queryResultID
 * @param rowCount
 * @param subQueryName
 * @param subQueryIndex
 * @throws DataException
 */
RDSave2(DataEngineContext context,IBaseQueryDefinition queryDefn,QueryResultInfo queryResultInfo) throws DataException {
  this.context=context;
  this.streamManager=new StreamManager(context,queryResultInfo);
  this.saveUtilHelper=new RDSaveUtil(this.context,queryDefn,this.streamManager);
}
Program: 65853
Project: 65853
Buggy source:
/** 
 * @throws DataException
 */
void saveQueryDefn() throws DataException {
  if (queryDefn instanceof QueryDefnDelegator) {
    queryDefn=((QueryDefnDelegator)queryDefn).getBaseQuery();
  }
  OutputStream outputStream=streamManager.getOutStream(DataEngineContext.QUERY_DEFN_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  QueryDefnIOUtil.saveBaseQueryDefn(outputStream,queryDefn,streamManager.getVersion());
  try {
    outputStream.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
void saveQueryDefn() throws DataException {
  if (queryDefn instanceof QueryDefnDelegator) {
    queryDefn=((QueryDefnDelegator)queryDefn).getBaseQuery();
  }
  OutputStream outputStream=streamManager.getOutStream(DataEngineContext.QUERY_DEFN_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  QueryDefnIOUtil.saveBaseQueryDefn(outputStream,queryDefn,streamManager.getVersion(),this.bundleVersion);
  try {
    outputStream.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 65854
Project: 65854
Buggy source:
/** 
 * @param queryDefn
 */
RDSaveUtil(int mode,IBaseQueryDefinition queryDefn,StreamManager streamManager){
  this.mode=mode;
  this.queryDefn=queryDefn;
  this.streamManager=streamManager;
}

Fixed version (ground truth):
/** 
 * @param queryDefn
 */
RDSaveUtil(DataEngineContext context,IBaseQueryDefinition queryDefn,StreamManager streamManager){
  this.mode=context.getMode();
  this.bundleVersion=context.getBundleVersion();
  this.queryDefn=queryDefn;
  this.streamManager=streamManager;
}
Program: 65855
Project: 65855
Buggy source:
/** 
 * @param streamID
 * @param subStreamID
 * @param streamType
 * @return
 */
public boolean hasInStream(String streamID,String subStreamID,int streamType){
  String relativePath=getPath(streamID,subStreamID,streamType);
  if (reader != null)   return reader.exists(relativePath);
 else   if (writer != null && writer.exists(relativePath))   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * @param streamID
 * @param subStreamID
 * @param streamType
 * @return
 */
public boolean hasInStream(String streamID,String subStreamID,int streamType){
  String relativePath=getPath(streamID,subStreamID,streamType);
  if (reader != null && reader.exists(relativePath))   return true;
 else   if (writer != null && writer.exists(relativePath))   return true;
  return false;
}
Program: 65856
Project: 65856
Buggy source:
/** 
 * According to the paramters of streamID, subStreamID and streamType, an input stream will be created for it. To make stream close simply, the stream needs to be closed by caller, and then caller requires to add buffer stream layer when needed.
 * @param streamID
 * @param subStreamID
 * @param streamType
 * @return input stream for specified streamID, subStreamID and streamType
 */
public RAInputStream getInputStream(String streamID,String subStreamID,int streamType) throws DataException {
  String relativePath=getPath(streamID,subStreamID,streamType);
  try {
    RAInputStream inputStream=null;
    if (reader != null) {
      inputStream=reader.getStream(relativePath);
    }
 else     if (writer != null && writer.exists(relativePath)) {
      inputStream=writer.getInputStream(relativePath);
    }
    if (inputStream == null) {
      throw new DataException(ResourceConstants.RD_LOAD_STREAM_ERROR);
    }
    return inputStream;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_STREAM_ERROR,e);
  }
}

Fixed version (ground truth):
/** 
 * According to the paramters of streamID, subStreamID and streamType, an input stream will be created for it. To make stream close simply, the stream needs to be closed by caller, and then caller requires to add buffer stream layer when needed.
 * @param streamID
 * @param subStreamID
 * @param streamType
 * @return input stream for specified streamID, subStreamID and streamType
 */
public RAInputStream getInputStream(String streamID,String subStreamID,int streamType) throws DataException {
  String relativePath=getPath(streamID,subStreamID,streamType);
  try {
    RAInputStream inputStream=null;
    if (reader != null && reader.exists(relativePath)) {
      inputStream=reader.getStream(relativePath);
    }
 else     if (writer != null && writer.exists(relativePath)) {
      inputStream=writer.getInputStream(relativePath);
    }
    if (inputStream == null) {
      throw new DataException(ResourceConstants.RD_LOAD_STREAM_ERROR);
    }
    return inputStream;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_STREAM_ERROR,e);
  }
}
Program: 65857
Project: 65857
Buggy source:
/** 
 * @param _1partQueryResultID
 * @param _2partQueryResultID
 * @return
 */
public static String buildID(String _1partQueryResultID,String _2partQueryResultID){
  String newID=_1partQueryResultID;
  if (newID != null)   newID+=QURE_ID_SEPARATOR + _2partQueryResultID;
 else   newID=_2partQueryResultID;
  return newID;
}

Fixed version (ground truth):
/** 
 * @param _1partQueryResultID
 * @param _2partQueryResultID
 * @return
 */
public static String buildID(String _1partQueryResultID,String _2partQueryResultID){
  String newID=_1partQueryResultID;
  if (newID != null)   newID+=_2partQueryResultID == null ? "String_Node_Str" : QURE_ID_SEPARATOR + _2partQueryResultID;
 else   newID=_2partQueryResultID;
  return newID;
}
Program: 65858
Project: 65858
Buggy source:
/** 
 * @param context
 * @throws DataException 
 */
public StreamManager(DataEngineContext context,QueryResultInfo queryResultInfo) throws DataException {
  this.context=context;
  this.rootQueryResultID=queryResultInfo.getRootQueryResultID();
  this.parentQueryResultID=queryResultInfo.getParentQueryResultID();
  this.selfQueryResultID=queryResultInfo.getSelfQueryResultID();
  this.subQueryName=queryResultInfo.getSubQueryName();
  this.subQueryID=subQueryName == null ? null : QueryResultIDUtil.buildSubQueryID(subQueryName,queryResultInfo.getIndex());
  this.cachedStreamManagers=new HashMap();
  this.metaManagers=new HashMap();
  this.dataMetaManagers=new HashMap();
  VersionManager vm=new VersionManager(context);
  if (context.getMode() == DataEngineContext.MODE_GENERATION) {
    this.version=vm.getVersion();
    if (this.version == VersionManager.VERSION_2_0)     this.version=VersionManager.getLatestVersion();
    vm.setVersion(this.version);
  }
 else   if (context.getMode() == DataEngineContext.MODE_UPDATE && this.rootQueryResultID == null) {
    if (this.context.hasInStream(null,null,DataEngineContext.VERSION_INFO_STREAM) == false) {
      this.version=VersionManager.getLatestVersion();
      vm.setVersion(this.version);
    }
 else     this.version=vm.getVersion();
  }
 else {
    this.version=vm.getVersion();
  }
}

Fixed version (ground truth):
/** 
 * @param context
 * @throws DataException 
 */
public StreamManager(DataEngineContext context,QueryResultInfo queryResultInfo) throws DataException {
  this.context=context;
  this.rootQueryResultID=queryResultInfo.getRootQueryResultID();
  this.parentQueryResultID=queryResultInfo.getParentQueryResultID();
  this.selfQueryResultID=queryResultInfo.getSelfQueryResultID();
  this.subQueryName=queryResultInfo.getSubQueryName();
  this.subQueryID=subQueryName == null ? null : QueryResultIDUtil.buildSubQueryID(subQueryName,queryResultInfo.getIndex());
  this.cachedStreamManagers=new HashMap();
  this.metaManagers=new HashMap();
  this.dataMetaManagers=new HashMap();
  VersionManager vm=new VersionManager(context);
  if (context.getMode() == DataEngineContext.MODE_GENERATION) {
    this.version=vm.getVersion(this.getQueryResultUID());
    if (this.version == VersionManager.VERSION_2_0) {
      this.version=VersionManager.getLatestVersion();
    }
    vm.setVersion(version,this.getQueryResultUID());
    vm.setVersion(VersionManager.getLatestVersion(),null);
  }
 else {
    String queryResultId=this.getQueryResultUID();
    this.version=vm.getVersion(queryResultId);
    if (this.version == 0 && queryResultId != null) {
      this.version=vm.getLatestVersion();
      vm.setVersion(this.version,queryResultId);
    }
  }
}
Program: 65859
Project: 65859
Buggy source:
/** 
 * @return
 */
public int getVersion(){
  int version=getLatestVersion();
  if (dataEngineContext.hasInStream(null,null,DataEngineContext.VERSION_INFO_STREAM) == false) {
    version=VERSION_2_0;
    return version;
  }
  try {
    DataInputStream is=new DataInputStream(dataEngineContext.getInputStream(null,null,DataEngineContext.VERSION_INFO_STREAM));
    version=IOUtil.readInt(is);
    is.close();
  }
 catch (  DataException e) {
    logger.log(Level.FINE,e.getMessage(),e);
  }
catch (  IOException e) {
    logger.log(Level.FINE,e.getMessage(),e);
  }
  return version;
}

Fixed version (ground truth):
public int getVersion(String queryResultId) throws DataException {
  if (queryResultId != null && !queryResultId.trim().isEmpty()) {
    Integer version=this.getQueryIdVersionMap().get(queryResultId);
    if (version != null)     return version;
  }
  return this.getVersion();
}
Program: 65860
Project: 65860
Buggy source:
/** 
 * @param context
 * @param string
 * @throws DataException
 */
public void setVersion(int version) throws DataException {
  OutputStream versionOs=this.dataEngineContext.getOutputStream(null,null,DataEngineContext.VERSION_INFO_STREAM);
  DataOutputStream versionDos=new DataOutputStream(versionOs);
  try {
    IOUtil.writeInt(versionDos,version);
    versionDos.close();
    versionOs.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
void setVersion(int version,String queryResultId) throws DataException {
  if (queryResultId == null || queryResultId.trim().isEmpty()) {
    this.setVersion(version);
    return;
  }
  Map<String,Integer> idVersionMap=this.getQueryIdVersionMap();
  idVersionMap.put(queryResultId,version);
  this.dataEngineContext.dropStream(null,null,DataEngineContext.QUERY_ID_BASED_VERSIONING_STREAM);
  OutputStream versionOs=this.dataEngineContext.getOutputStream(null,null,DataEngineContext.QUERY_ID_BASED_VERSIONING_STREAM);
  DataOutputStream versionDos=new DataOutputStream(versionOs);
  try {
    IOUtil.writeMap(versionDos,idVersionMap);
    versionDos.close();
    versionOs.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 65861
Project: 65861
Buggy source:
/** 
 * Loads   {@code CubeQueryDefinition} instance from report document
 * @param queryResultID
 * @param reader
 * @return
 * @throws DataException
 * @throws IOException
 */
public static ICubeQueryDefinition load(String queryResultID,DataEngineContext context) throws DataException, IOException {
  DataInputStream dis=null;
  IDocArchiveReader reader=context.getDocReader();
  int version;
  if (context.hasInStream(null,null,DataEngineContext.VERSION_INFO_STREAM) == false) {
    version=0;
  }
 else {
    StreamManager manager=new StreamManager(context,new QueryResultInfo(queryResultID,null,0));
    version=manager.getVersion();
  }
  try {
    RAInputStream inputStream=reader.getStream(queryResultID + STREAM_FLAG);
    dis=new DataInputStream(inputStream);
    String name=IOUtil.readString(dis);
    ICubeQueryDefinition cqd=new CubeQueryDefinition(name);
    cqd.setCacheQueryResults(IOUtil.readBool(dis));
    cqd.setFilterOption(IOUtil.readInt(dis));
    loadBindings(dis,cqd,version);
    loadFilters(dis,cqd,version);
    loadSortDefns(dis,cqd);
    loadMeasures(dis,cqd);
    loadComputedMeasures(dis,cqd);
    loadCalculatedMeasures(dis,cqd,version);
    loadEdges(dis,cqd,version);
    loadCubeOperations(dis,cqd,version);
    return cqd;
  }
  finally {
    if (dis != null) {
      dis.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Loads   {@code CubeQueryDefinition} instance from report document
 * @param queryResultID
 * @param reader
 * @return
 * @throws DataException
 * @throws IOException
 */
public static ICubeQueryDefinition load(String queryResultID,DataEngineContext context) throws DataException, IOException {
  DataInputStream dis=null;
  IDocArchiveReader reader=context.getDocReader();
  int version;
  StreamManager manager=new StreamManager(context,new QueryResultInfo(queryResultID,null,0));
  version=manager.getVersion();
  try {
    RAInputStream inputStream=reader.getStream(queryResultID + STREAM_FLAG);
    dis=new DataInputStream(inputStream);
    String name=IOUtil.readString(dis);
    ICubeQueryDefinition cqd=new CubeQueryDefinition(name);
    cqd.setCacheQueryResults(IOUtil.readBool(dis));
    cqd.setFilterOption(IOUtil.readInt(dis));
    loadBindings(dis,cqd,version);
    loadFilters(dis,cqd,version);
    loadSortDefns(dis,cqd);
    loadMeasures(dis,cqd);
    loadComputedMeasures(dis,cqd);
    loadCalculatedMeasures(dis,cqd,version);
    loadEdges(dis,cqd,version);
    loadCubeOperations(dis,cqd,version);
    return cqd;
  }
  finally {
    if (dis != null) {
      dis.close();
    }
  }
}
Program: 65862
Project: 65862
Buggy source:
private IAggregationResultSet[] populateRs(BirtCubeView view,AggregationDefinition[] aggrDefns,CubeQueryExecutorHelper cubeQueryExcutorHelper2,StopSign stopSign,boolean saveToRD,IBindingValueFetcher fetcher) throws IOException, BirtException {
  IAggregationResultSet[] rs=null;
  String id=null;
  CubeQueryExecutor executor=view.getCubeQueryExecutor();
  if (executor.getCubeQueryDefinition().getQueryResultsID() == null) {
    if (saveToRD || executor.getCubeQueryDefinition().cacheQueryResults())     id=executor.getSession().getQueryResultIDUtil().nextID();
    rs=executeQuery(view,aggrDefns,saveToRD,id,fetcher);
  }
 else {
    id=executor.getCubeQueryDefinition().getQueryResultsID();
    if (executor.getCubeQueryDefinition().cacheQueryResults()) {
      rs=AggregationResultSetSaveUtil.load(id,new FileArchiveReader(executor.getSession().getTempDir() + "String_Node_Str"),VersionManager.getLatestVersion(),cubeQueryExecutorHelper.getMemoryCacheSize());
      initLoadedAggregationResultSets(rs,aggrDefns);
    }
 else {
      if (executor.getContext().getDocReader() != null) {
        rs=AggregationResultSetSaveUtil.load(executor.getCubeQueryDefinition().getQueryResultsID(),executor.getContext().getDocReader(),new VersionManager(executor.getContext()).getVersion(),cubeQueryExecutorHelper.getMemoryCacheSize());
        initLoadedAggregationResultSets(rs,aggrDefns);
      }
 else {
        rs=executeQuery(view,aggrDefns,saveToRD,id,fetcher);
      }
    }
  }
  executor.setQueryResultsId(id);
  return rs;
}

Fixed version (ground truth):
private IAggregationResultSet[] populateRs(BirtCubeView view,AggregationDefinition[] aggrDefns,CubeQueryExecutorHelper cubeQueryExcutorHelper2,StopSign stopSign,boolean saveToRD,IBindingValueFetcher fetcher) throws IOException, BirtException {
  IAggregationResultSet[] rs=null;
  String id=null;
  CubeQueryExecutor executor=view.getCubeQueryExecutor();
  if (executor.getCubeQueryDefinition().getQueryResultsID() == null) {
    if (saveToRD || executor.getCubeQueryDefinition().cacheQueryResults())     id=executor.getSession().getQueryResultIDUtil().nextID();
    rs=executeQuery(view,aggrDefns,saveToRD,id,fetcher);
  }
 else {
    id=executor.getCubeQueryDefinition().getQueryResultsID();
    if (executor.getCubeQueryDefinition().cacheQueryResults()) {
      rs=AggregationResultSetSaveUtil.load(id,new FileArchiveReader(executor.getSession().getTempDir() + "String_Node_Str"),VersionManager.getLatestVersion(),cubeQueryExecutorHelper.getMemoryCacheSize());
      initLoadedAggregationResultSets(rs,aggrDefns);
    }
 else {
      if (executor.getContext().getDocReader() != null) {
        rs=AggregationResultSetSaveUtil.load(executor.getCubeQueryDefinition().getQueryResultsID(),executor.getContext().getDocReader(),new VersionManager(executor.getContext()).getVersion(id),cubeQueryExecutorHelper.getMemoryCacheSize());
        initLoadedAggregationResultSets(rs,aggrDefns);
      }
 else {
        rs=executeQuery(view,aggrDefns,saveToRD,id,fetcher);
      }
    }
  }
  executor.setQueryResultsId(id);
  return rs;
}
Program: 65864
Project: 65864
Buggy source:
/** 
 * Loads   {@code CubeQueryDefinition} instance from report document
 * @param queryResultID
 * @param reader
 * @return
 * @throws DataException
 * @throws IOException
 */
public static ICubeQueryDefinition load(String queryResultID,DataEngineContext context) throws DataException, IOException {
  DataInputStream dis=null;
  IDocArchiveReader reader=context.getDocReader();
  int version;
  StreamManager manager=new StreamManager(context,new QueryResultInfo(queryResultID,null,0));
  version=manager.getVersion();
  try {
    RAInputStream inputStream=reader.getStream(queryResultID + STREAM_FLAG);
    dis=new DataInputStream(inputStream);
    String name=IOUtil.readString(dis);
    ICubeQueryDefinition cqd=new CubeQueryDefinition(name);
    cqd.setCacheQueryResults(IOUtil.readBool(dis));
    cqd.setFilterOption(IOUtil.readInt(dis));
    loadBindings(dis,cqd,version);
    loadFilters(dis,cqd,version);
    loadSortDefns(dis,cqd);
    loadMeasures(dis,cqd);
    loadComputedMeasures(dis,cqd);
    loadCalculatedMeasures(dis,cqd,version);
    loadEdges(dis,cqd,version);
    loadCubeOperations(dis,cqd,version);
    return cqd;
  }
  finally {
    if (dis != null) {
      dis.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Loads   {@code CubeQueryDefinition} instance from report document
 * @param queryResultID
 * @param reader
 * @return
 * @throws DataException
 * @throws IOException
 */
public static ICubeQueryDefinition load(String queryResultID,DataEngineContext context) throws DataException, IOException {
  DataInputStream dis=null;
  IDocArchiveReader reader=context.getDocReader();
  VersionManager vm=new VersionManager(context);
  int version=vm.getVersion(queryResultID);
  try {
    RAInputStream inputStream=reader.getStream(queryResultID + STREAM_FLAG);
    dis=new DataInputStream(inputStream);
    String name=IOUtil.readString(dis);
    ICubeQueryDefinition cqd=new CubeQueryDefinition(name);
    cqd.setCacheQueryResults(IOUtil.readBool(dis));
    cqd.setFilterOption(IOUtil.readInt(dis));
    loadBindings(dis,cqd,version);
    loadFilters(dis,cqd,version);
    loadSortDefns(dis,cqd);
    loadMeasures(dis,cqd);
    loadComputedMeasures(dis,cqd);
    loadCalculatedMeasures(dis,cqd,version);
    loadEdges(dis,cqd,version);
    loadCubeOperations(dis,cqd,version);
    return cqd;
  }
  finally {
    if (dis != null) {
      dis.close();
    }
  }
}
Program: 65865
Project: 65865
Buggy source:
public RDAggrUtil(StreamManager manager,IBaseQueryDefinition qd) throws DataException {
  this.qd=qd;
  try {
    RAInputStream aggrIndexStream=manager.getInStream(DataEngineContext.AGGR_INDEX_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    int aggrSize=IOUtil.readInt(aggrIndexStream);
    DataInputStream aggrIndexDis=new DataInputStream(aggrIndexStream);
    DataInputStream valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),0,-1));
    for (int i=0; i < aggrSize; i++) {
      RDAggrValueHolder holder=new RDAggrValueHolder(valueStream);
      holders.put(holder.getName(),holder);
      if (i < aggrSize - 1) {
        long offset=IOUtil.readLong(aggrIndexDis);
        if (manager.getVersion() >= VersionManager.VERSION_2_5_2_1) {
          valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),offset,-1));
        }
 else {
          valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),offset + 1,-1));
        }
      }
    }
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
public RDAggrUtil(StreamManager manager,IBaseQueryDefinition qd) throws DataException {
  this.qd=qd;
  try {
    aggrIndexStream=manager.getInStream(DataEngineContext.AGGR_INDEX_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    int aggrSize=IOUtil.readInt(aggrIndexStream);
    DataInputStream aggrIndexDis=new DataInputStream(aggrIndexStream);
    valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),0,-1));
    for (int i=0; i < aggrSize; i++) {
      RDAggrValueHolder holder=new RDAggrValueHolder(valueStream);
      holders.put(holder.getName(),holder);
      valueStream.close();
      if (i < aggrSize - 1) {
        long offset=IOUtil.readLong(aggrIndexDis);
        if (manager.getVersion() >= VersionManager.VERSION_2_5_2_1) {
          valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),offset,-1));
        }
 else {
          valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),offset + 1,-1));
        }
      }
    }
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}
Program: 65866
Project: 65866
Buggy source:
public void close() throws DataException {
}

Fixed version (ground truth):
public void close() throws DataException {
  try {
    if (valueStream != null) {
      valueStream.close();
    }
    if (aggrIndexStream != null) {
      aggrIndexStream.close();
    }
  }
 catch (  IOException ex) {
  }
}
Program: 65868
Project: 65868
Buggy source:
public void close() throws DataException {
  try {
    if (exprResultReader != null) {
      exprResultReader.close();
      exprResultReader=null;
    }
    if (rowExprsRAIs != null) {
      rowExprsRAIs.close();
      rowExprsRAIs=null;
    }
    if (rowLenRAIs != null) {
      rowLenRAIs.close();
      rowLenRAIs=null;
    }
    if (rowInfoRAIs != null) {
      rowInfoRAIs.close();
      rowInfoRAIs=null;
    }
    if (dataSetResultSet != null) {
      dataSetResultSet.close();
      dataSetResultSet=null;
    }
    if (aggrUtil != null) {
      aggrUtil.close();
      aggrUtil=null;
    }
    if (rdGroupUtil != null) {
      rdGroupUtil.close();
      rdGroupUtil=null;
    }
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
public void close() throws DataException {
  try {
    if (exprResultReader != null) {
      exprResultReader.close();
      exprResultReader=null;
    }
    if (rowExprsRAIs != null) {
      rowExprsRAIs.close();
      rowExprsRAIs=null;
    }
    if (rowLenRAIs != null) {
      rowLenRAIs.close();
      rowLenRAIs=null;
    }
    if (rowInfoRAIs != null) {
      rowInfoRAIs.close();
      rowInfoRAIs=null;
    }
    if (dataSetResultSet != null) {
      dataSetResultSet.close();
      dataSetResultSet=null;
    }
    if (aggrUtil != null) {
      aggrUtil.close();
      aggrUtil=null;
    }
    if (rdGroupUtil != null) {
      rdGroupUtil.close();
      rdGroupUtil=null;
    }
    if (aggrIndexStreams != null) {
      for (int i=0; i < aggrIndexStreams.size(); i++) {
        aggrIndexStreams.get(i).close();
      }
    }
    if (aggrStreams != null) {
      for (int i=0; i < aggrStreams.size(); i++) {
        aggrStreams.get(i).close();
      }
    }
  }
 catch (  IOException e) {
  }
}
Program: 65869
Project: 65869
Buggy source:
/** 
 * @return
 */
public static int getLatestVersion(){
  return VERSION_2_6_3_1;
}

Fixed version (ground truth):
/** 
 * @return
 */
public static int getLatestVersion(){
  return VERSION_2_6_3_2;
}
Program: 65870
Project: 65870
Buggy source:
private static void saveFilters(DataOutputStream dos,List<IFilterDefinition> filters) throws DataException, IOException {
  if (writeSize(dos,filters) > 0) {
    for (    IFilterDefinition fd : filters) {
      saveFilterDefn(dos,fd);
    }
  }
}

Fixed version (ground truth):
private static void saveFilters(DataOutputStream dos,List<IFilterDefinition> filters,int version) throws DataException, IOException {
  if (writeSize(dos,filters) > 0) {
    for (    IFilterDefinition fd : filters) {
      saveFilterDefn(dos,fd,version);
    }
  }
}
Program: 65871
Project: 65871
Buggy source:
/** 
 * Saves   {@code CubeQueryDefinition} instance into report document
 * @param queryResultID
 * @param writer
 * @param qd
 * @throws DataException
 * @throws IOException
 */
public static void save(String queryResultID,DataEngineContext context,ICubeQueryDefinition qd) throws DataException, IOException {
  DataOutputStream dos=null;
  try {
    StreamManager manager=new StreamManager(context,new QueryResultInfo(queryResultID,null,0));
    int version=manager.getVersion();
    IDocArchiveWriter writer=context.getDocWriter();
    RAOutputStream outputStream=writer.createRandomAccessStream(queryResultID + STREAM_FLAG);
    dos=new DataOutputStream(outputStream);
    IOUtil.writeString(dos,qd.getName());
    IOUtil.writeBool(dos,qd.cacheQueryResults());
    IOUtil.writeInt(dos,qd.getFilterOption());
    saveBindings(dos,qd.getBindings(),version);
    saveFilters(dos,qd.getFilters());
    saveSortDefns(dos,qd.getSorts());
    saveMeasures(dos,qd.getMeasures());
    saveComputedMeasures(dos,qd.getComputedMeasures());
    saveCalculatedMeasures(dos,qd.getDerivedMeasures(),version);
    saveEdges(dos,qd);
    saveCubeOperations(dos,qd.getCubeOperations(),version);
    dos.flush();
  }
  finally {
    if (dos != null) {
      dos.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Saves   {@code CubeQueryDefinition} instance into report document
 * @param queryResultID
 * @param writer
 * @param qd
 * @throws DataException
 * @throws IOException
 */
public static void save(String queryResultID,DataEngineContext context,ICubeQueryDefinition qd) throws DataException, IOException {
  DataOutputStream dos=null;
  try {
    StreamManager manager=new StreamManager(context,new QueryResultInfo(queryResultID,null,0));
    int version=manager.getVersion();
    IDocArchiveWriter writer=context.getDocWriter();
    RAOutputStream outputStream=writer.createRandomAccessStream(queryResultID + STREAM_FLAG);
    dos=new DataOutputStream(outputStream);
    IOUtil.writeString(dos,qd.getName());
    IOUtil.writeBool(dos,qd.cacheQueryResults());
    IOUtil.writeInt(dos,qd.getFilterOption());
    saveBindings(dos,qd.getBindings(),version);
    saveFilters(dos,qd.getFilters(),version);
    saveSortDefns(dos,qd.getSorts());
    saveMeasures(dos,qd.getMeasures());
    saveComputedMeasures(dos,qd.getComputedMeasures());
    saveCalculatedMeasures(dos,qd.getDerivedMeasures(),version);
    saveEdges(dos,qd,version);
    saveCubeOperations(dos,qd.getCubeOperations(),version);
    dos.flush();
  }
  finally {
    if (dos != null) {
      dos.close();
    }
  }
}
Program: 65872
Project: 65872
Buggy source:
private static void loadEdges(DataInputStream dis,ICubeQueryDefinition qd) throws DataException, IOException {
  IEdgeDefinition ed=loadEdge(dis);
  if (ed != null) {
    IEdgeDefinition ed1=qd.createEdge(ICubeQueryDefinition.ROW_EDGE);
    copy(ed,ed1);
  }
  ed=loadEdge(dis);
  if (ed != null) {
    IEdgeDefinition ed1=qd.createEdge(ICubeQueryDefinition.COLUMN_EDGE);
    copy(ed,ed1);
  }
  ed=loadEdge(dis);
  if (ed != null) {
    IEdgeDefinition ed1=qd.createEdge(ICubeQueryDefinition.PAGE_EDGE);
    copy(ed,ed1);
  }
}

Fixed version (ground truth):
private static void loadEdges(DataInputStream dis,ICubeQueryDefinition qd,int version) throws DataException, IOException {
  IEdgeDefinition ed=loadEdge(dis,version);
  if (ed != null) {
    IEdgeDefinition ed1=qd.createEdge(ICubeQueryDefinition.ROW_EDGE);
    copy(ed,ed1);
  }
  ed=loadEdge(dis,version);
  if (ed != null) {
    IEdgeDefinition ed1=qd.createEdge(ICubeQueryDefinition.COLUMN_EDGE);
    copy(ed,ed1);
  }
  ed=loadEdge(dis,version);
  if (ed != null) {
    IEdgeDefinition ed1=qd.createEdge(ICubeQueryDefinition.PAGE_EDGE);
    copy(ed,ed1);
  }
}
Program: 65873
Project: 65873
Buggy source:
private static IEdgeDrillFilter loadEdgeDrillFilter(DataInputStream dis) throws DataException, IOException {
  if (!IOUtil.readBool(dis)) {
    return null;
  }
  String name=IOUtil.readString(dis);
  EdgeDrillingFilterDefinition edf=new EdgeDrillingFilterDefinition(name);
  edf.setTargetHierarchy(loadHierarchyDefinition(dis));
  edf.setTargetLevelName(IOUtil.readString(dis));
  loadFilters(dis,edf);
  loadSortDefns(dis,edf);
  int count=IOUtil.readInt(dis);
  List<Object[]> tuples=new ArrayList<Object[]>();
  for (int i=0; i < count; i++) {
    int size=IOUtil.readInt(dis);
    Object[] tuple=new Object[size];
    for (int j=0; j < size; j++) {
      tuple[j]=IOUtil.readObject(dis,org.eclipse.birt.data.engine.impl.DataEngineSession.getCurrentClassLoader());
    }
    tuples.add(tuple);
  }
  edf.setTuple(tuples);
  return edf;
}

Fixed version (ground truth):
private static IEdgeDrillFilter loadEdgeDrillFilter(DataInputStream dis,int version) throws DataException, IOException {
  if (!IOUtil.readBool(dis)) {
    return null;
  }
  String name=IOUtil.readString(dis);
  EdgeDrillingFilterDefinition edf=new EdgeDrillingFilterDefinition(name);
  edf.setTargetHierarchy(loadHierarchyDefinition(dis));
  edf.setTargetLevelName(IOUtil.readString(dis));
  loadFilters(dis,edf,version);
  loadSortDefns(dis,edf);
  int count=IOUtil.readInt(dis);
  List<Object[]> tuples=new ArrayList<Object[]>();
  for (int i=0; i < count; i++) {
    int size=IOUtil.readInt(dis);
    Object[] tuple=new Object[size];
    for (int j=0; j < size; j++) {
      tuple[j]=IOUtil.readObject(dis,org.eclipse.birt.data.engine.impl.DataEngineSession.getCurrentClassLoader());
    }
    tuples.add(tuple);
  }
  edf.setTuple(tuples);
  return edf;
}
Program: 65874
Project: 65874
Buggy source:
/** 
 * Loads   {@code CubeQueryDefinition} instance from report document
 * @param queryResultID
 * @param reader
 * @return
 * @throws DataException
 * @throws IOException
 */
public static ICubeQueryDefinition load(String queryResultID,DataEngineContext context) throws DataException, IOException {
  DataInputStream dis=null;
  IDocArchiveReader reader=context.getDocReader();
  int version;
  if (context.hasInStream(null,null,DataEngineContext.VERSION_INFO_STREAM) == false) {
    version=0;
  }
 else {
    StreamManager manager=new StreamManager(context,new QueryResultInfo(queryResultID,null,0));
    version=manager.getVersion();
  }
  try {
    RAInputStream inputStream=reader.getStream(queryResultID + STREAM_FLAG);
    dis=new DataInputStream(inputStream);
    String name=IOUtil.readString(dis);
    ICubeQueryDefinition cqd=new CubeQueryDefinition(name);
    cqd.setCacheQueryResults(IOUtil.readBool(dis));
    cqd.setFilterOption(IOUtil.readInt(dis));
    loadBindings(dis,cqd,version);
    loadFilters(dis,cqd);
    loadSortDefns(dis,cqd);
    loadMeasures(dis,cqd);
    loadComputedMeasures(dis,cqd);
    loadCalculatedMeasures(dis,cqd,version);
    loadEdges(dis,cqd);
    loadCubeOperations(dis,cqd,version);
    return cqd;
  }
  finally {
    if (dis != null) {
      dis.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Loads   {@code CubeQueryDefinition} instance from report document
 * @param queryResultID
 * @param reader
 * @return
 * @throws DataException
 * @throws IOException
 */
public static ICubeQueryDefinition load(String queryResultID,DataEngineContext context) throws DataException, IOException {
  DataInputStream dis=null;
  IDocArchiveReader reader=context.getDocReader();
  int version;
  if (context.hasInStream(null,null,DataEngineContext.VERSION_INFO_STREAM) == false) {
    version=0;
  }
 else {
    StreamManager manager=new StreamManager(context,new QueryResultInfo(queryResultID,null,0));
    version=manager.getVersion();
  }
  try {
    RAInputStream inputStream=reader.getStream(queryResultID + STREAM_FLAG);
    dis=new DataInputStream(inputStream);
    String name=IOUtil.readString(dis);
    ICubeQueryDefinition cqd=new CubeQueryDefinition(name);
    cqd.setCacheQueryResults(IOUtil.readBool(dis));
    cqd.setFilterOption(IOUtil.readInt(dis));
    loadBindings(dis,cqd,version);
    loadFilters(dis,cqd,version);
    loadSortDefns(dis,cqd);
    loadMeasures(dis,cqd);
    loadComputedMeasures(dis,cqd);
    loadCalculatedMeasures(dis,cqd,version);
    loadEdges(dis,cqd,version);
    loadCubeOperations(dis,cqd,version);
    return cqd;
  }
  finally {
    if (dis != null) {
      dis.close();
    }
  }
}
Program: 65875
Project: 65875
Buggy source:
private static IFilterDefinition loadFilterDefn(DataInputStream dis) throws IOException {
}

Fixed version (ground truth):
private static IFilterDefinition loadFilterDefn(DataInputStream dis,int version) throws IOException {
}
Program: 65876
Project: 65876
Buggy source:
private static void saveEdges(DataOutputStream dos,ICubeQueryDefinition qd) throws DataException, IOException {
  saveEdge(dos,qd.getEdge(ICubeQueryDefinition.ROW_EDGE));
  saveEdge(dos,qd.getEdge(ICubeQueryDefinition.COLUMN_EDGE));
  saveEdge(dos,qd.getEdge(ICubeQueryDefinition.PAGE_EDGE));
}

Fixed version (ground truth):
private static void saveEdges(DataOutputStream dos,ICubeQueryDefinition qd,int version) throws DataException, IOException {
  saveEdge(dos,qd.getEdge(ICubeQueryDefinition.ROW_EDGE),version);
  saveEdge(dos,qd.getEdge(ICubeQueryDefinition.COLUMN_EDGE),version);
  saveEdge(dos,qd.getEdge(ICubeQueryDefinition.PAGE_EDGE),version);
}
Program: 65877
Project: 65877
Buggy source:
private static void saveFilterDefn(DataOutputStream dos,IFilterDefinition fd) throws IOException {
  if (fd == null) {
    IOUtil.writeBool(dos,false);
    return;
  }
  IOUtil.writeBool(dos,true);
  ExprUtil.saveBaseExpr(dos,fd.getExpression());
  if (!(fd instanceof ICubeFilterDefinition)) {
    IOUtil.writeInt(dos,FILTER_DEFN_FLAG_COMMON);
  }
 else {
    IOUtil.writeInt(dos,FILTER_DEFN_FLAG_CUBE);
    ICubeFilterDefinition cfd=(ICubeFilterDefinition)fd;
    saveLevelDefinition(dos,cfd.getTargetLevel());
    if (writeSize(dos,cfd.getAxisQualifierLevels()) > 0) {
      for (      ILevelDefinition ld : cfd.getAxisQualifierLevels()) {
        saveLevelDefinition(dos,ld);
      }
    }
    if (writeSize(dos,cfd.getAxisQualifierValues()) > 0) {
      for (      Object o : cfd.getAxisQualifierValues()) {
        IOUtil.writeObject(dos,o);
      }
    }
  }
}

Fixed version (ground truth):
private static void saveFilterDefn(DataOutputStream dos,IFilterDefinition fd,int version) throws IOException {
  if (fd == null) {
    IOUtil.writeBool(dos,false);
    return;
  }
  IOUtil.writeBool(dos,true);
  ExprUtil.saveBaseExpr(dos,fd.getExpression());
  if (!(fd instanceof ICubeFilterDefinition)) {
    IOUtil.writeInt(dos,FILTER_DEFN_FLAG_COMMON);
  }
 else {
    IOUtil.writeInt(dos,FILTER_DEFN_FLAG_CUBE);
    ICubeFilterDefinition cfd=(ICubeFilterDefinition)fd;
    saveLevelDefinition(dos,cfd.getTargetLevel());
    if (writeSize(dos,cfd.getAxisQualifierLevels()) > 0) {
      for (      ILevelDefinition ld : cfd.getAxisQualifierLevels()) {
        saveLevelDefinition(dos,ld);
      }
    }
    if (writeSize(dos,cfd.getAxisQualifierValues()) > 0) {
      for (      Object o : cfd.getAxisQualifierValues()) {
        IOUtil.writeObject(dos,o);
      }
    }
  }
  if (version >= VersionManager.VERSION_2_6_3_2)   IOUtil.writeBool(dos,fd.updateAggregation());
}
Program: 65878
Project: 65878
Buggy source:
private static void saveEdgeDrillFilter(DataOutputStream dos,IEdgeDrillFilter edf) throws DataException, IOException {
  if (edf == null) {
    IOUtil.writeBool(dos,false);
    return;
  }
  IOUtil.writeBool(dos,true);
  IOUtil.writeString(dos,edf.getName());
  saveHierarchyDefinition(dos,edf.getTargetHierarchy());
  IOUtil.writeString(dos,edf.getTargetLevelName());
  saveFilters(dos,edf.getLevelFilter());
  saveSortDefns(dos,edf.getLevelSort());
  if (writeSize(dos,edf.getTuple()) > 0) {
    for (    Object[] tuple : edf.getTuple()) {
      if (writeSize(dos,tuple) > 0) {
        for (        Object o : tuple) {
          IOUtil.writeObject(dos,o);
        }
      }
    }
  }
}

Fixed version (ground truth):
private static void saveEdgeDrillFilter(DataOutputStream dos,IEdgeDrillFilter edf,int version) throws DataException, IOException {
  if (edf == null) {
    IOUtil.writeBool(dos,false);
    return;
  }
  IOUtil.writeBool(dos,true);
  IOUtil.writeString(dos,edf.getName());
  saveHierarchyDefinition(dos,edf.getTargetHierarchy());
  IOUtil.writeString(dos,edf.getTargetLevelName());
  saveFilters(dos,edf.getLevelFilter(),version);
  saveSortDefns(dos,edf.getLevelSort());
  if (writeSize(dos,edf.getTuple()) > 0) {
    for (    Object[] tuple : edf.getTuple()) {
      if (writeSize(dos,tuple) > 0) {
        for (        Object o : tuple) {
          IOUtil.writeObject(dos,o);
        }
      }
    }
  }
}
Program: 65879
Project: 65879
Buggy source:
private static void loadFilters(DataInputStream dis,IEdgeDrillFilter edf) throws DataException, IOException {
  int size=IOUtil.readInt(dis);
  for (int i=0; i < size; i++) {
    IFilterDefinition fd=loadFilterDefn(dis);
    edf.addLevelFilter(fd);
  }
}

Fixed version (ground truth):
private static void loadFilters(DataInputStream dis,IEdgeDrillFilter edf,int version) throws DataException, IOException {
  int size=IOUtil.readInt(dis);
  for (int i=0; i < size; i++) {
    IFilterDefinition fd=loadFilterDefn(dis,version);
    edf.addLevelFilter(fd);
  }
}
Program: 65880
Project: 65880
Buggy source:
private static void saveEdge(DataOutputStream dos,IEdgeDefinition ed) throws DataException, IOException {
  if (ed == null) {
    IOUtil.writeBool(dos,false);
    return;
  }
  IOUtil.writeBool(dos,true);
  IOUtil.writeString(dos,ed.getName());
  if (writeSize(dos,ed.getDimensions()) > 0) {
    for (    IDimensionDefinition dd : ed.getDimensions()) {
      saveDimensionDefinition(dos,dd);
    }
  }
  if (writeSize(dos,ed.getDrillFilter()) > 0) {
    for (    IEdgeDrillFilter edf : ed.getDrillFilter()) {
      saveEdgeDrillFilter(dos,edf);
    }
  }
  saveMirroredDefn(dos,ed.getMirroredDefinition());
}

Fixed version (ground truth):
private static void saveEdge(DataOutputStream dos,IEdgeDefinition ed,int version) throws DataException, IOException {
  if (ed == null) {
    IOUtil.writeBool(dos,false);
    return;
  }
  IOUtil.writeBool(dos,true);
  IOUtil.writeString(dos,ed.getName());
  if (writeSize(dos,ed.getDimensions()) > 0) {
    for (    IDimensionDefinition dd : ed.getDimensions()) {
      saveDimensionDefinition(dos,dd);
    }
  }
  if (writeSize(dos,ed.getDrillFilter()) > 0) {
    for (    IEdgeDrillFilter edf : ed.getDrillFilter()) {
      saveEdgeDrillFilter(dos,edf,version);
    }
  }
  saveMirroredDefn(dos,ed.getMirroredDefinition());
}