nus-yam/ex-repair huggingface dataset:
Program: 66649
Project: 66649
Buggy source:
public void handleBeforeOpen(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeOpenEventHandler) {
      Scriptable scope=getScriptScope(dataSet);
      ScriptStatus status=handleJS(scope,dataSet.getName(),BEFORE_OPEN,dataSetHandle.getBeforeOpen());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeOpen(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleBeforeOpen(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeOpenEventHandler) {
      Scriptable scope=getScriptScope(dataSet);
      ScriptStatus status=handleJS(scope,dataSet.getName(),BEFORE_OPEN,dataSetHandle.getBeforeOpen(),beforeOpenMethodID);
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeOpen(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 66650
Project: 66650
Buggy source:
public void handleBeforeClose(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeCloseEventHandler) {
      Scriptable scope=getScriptScope(dataSet);
      ScriptStatus status=handleJS(scope,dataSet.getName(),BEFORE_CLOSE,dataSetHandle.getBeforeClose());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeClose(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleBeforeClose(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeCloseEventHandler) {
      Scriptable scope=getScriptScope(dataSet);
      ScriptStatus status=handleJS(scope,dataSet.getName(),BEFORE_CLOSE,dataSetHandle.getBeforeClose(),beforeCloseMethodID);
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeClose(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 66651
Project: 66651
Buggy source:
public void handleAfterClose(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterCloseEventHandler) {
      Scriptable scope=getScriptScope(dataSet);
      ScriptStatus status=handleJS(scope,dataSet.getName(),AFTER_CLOSE,dataSetHandle.getAfterClose());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterClose(reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleAfterClose(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterCloseEventHandler) {
      Scriptable scope=getScriptScope(dataSet);
      ScriptStatus status=handleJS(scope,dataSet.getName(),AFTER_CLOSE,dataSetHandle.getAfterClose(),afterCloseMethodID);
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterClose(reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 66652
Project: 66652
Buggy source:
public DataSetScriptExecutor(DataSetHandle dataSetHandle,ExecutionContext context) throws BirtException {
  super(context);
  this.dataSetHandle=dataSetHandle;
  String className=dataSetHandle.getEventHandlerClass();
  initEventHandler(className);
  useOnFetchEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getOnFetch());
  useAfterCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getAfterClose());
  useAfterOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getAfterOpen());
  useBeforeOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getBeforeOpen());
  useBeforeCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getBeforeClose());
}

Fixed version (ground truth):
public DataSetScriptExecutor(DataSetHandle dataSetHandle,ExecutionContext context) throws BirtException {
  super(context);
  this.dataSetHandle=dataSetHandle;
  String className=dataSetHandle.getEventHandlerClass();
  initEventHandler(className);
  useOnFetchEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getOnFetch());
  useAfterCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getAfterClose());
  useAfterOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getAfterOpen());
  useBeforeOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getBeforeOpen());
  useBeforeCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getBeforeClose());
  beforeOpenMethodID=ModuleUtil.getScriptUID(dataSetHandle.getPropertyHandle(ISimpleDataSetModel.BEFORE_OPEN_METHOD));
  beforeCloseMethodID=ModuleUtil.getScriptUID(dataSetHandle.getPropertyHandle(ISimpleDataSetModel.BEFORE_CLOSE_METHOD));
  afterOpenMethodID=ModuleUtil.getScriptUID(dataSetHandle.getPropertyHandle(ISimpleDataSetModel.AFTER_OPEN_METHOD));
  afterCloseMethodID=ModuleUtil.getScriptUID(dataSetHandle.getPropertyHandle(ISimpleDataSetModel.AFTER_CLOSE_METHOD));
  onFetchMethodID=ModuleUtil.getScriptUID(dataSetHandle.getPropertyHandle(ISimpleDataSetModel.ON_FETCH_METHOD));
}
Program: 66653
Project: 66653
Buggy source:
public void handleAfterOpen(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterOpenEventHandler) {
      Scriptable scope=getScriptScope(dataSet);
      ScriptStatus status=handleJS(scope,dataSet.getName(),AFTER_OPEN,dataSetHandle.getAfterOpen());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterOpen(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleAfterOpen(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterOpenEventHandler) {
      Scriptable scope=getScriptScope(dataSet);
      ScriptStatus status=handleJS(scope,dataSet.getName(),AFTER_OPEN,dataSetHandle.getAfterOpen(),afterOpenMethodID);
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterOpen(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 66654
Project: 66654
Buggy source:
protected ScriptStatus handleJS(Scriptable scope,String name,String method,String script){
  return handleJS(scope,DATA_SET,name,method,script);
}

Fixed version (ground truth):
protected ScriptStatus handleJS(Scriptable scope,String name,String method,String script,String id){
  return handleJS(scope,DATA_SET,name,method,script,id);
}
Program: 66655
Project: 66655
Buggy source:
public DataSourceScriptExecutor(DataSourceHandle dataSourceHandle,ExecutionContext context) throws BirtException {
  super(context);
  this.dataSourceHandle=dataSourceHandle;
  String className=dataSourceHandle.getEventHandlerClass();
  initEventHandler(className);
  this.useBeforeOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSourceHandle.getBeforeOpen());
  this.useBeforeCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSourceHandle.getBeforeClose());
  this.useAfterOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSourceHandle.getAfterOpen());
  this.useAfterCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSourceHandle.getAfterClose());
}

Fixed version (ground truth):
public DataSourceScriptExecutor(DataSourceHandle dataSourceHandle,ExecutionContext context) throws BirtException {
  super(context);
  this.dataSourceHandle=dataSourceHandle;
  String className=dataSourceHandle.getEventHandlerClass();
  initEventHandler(className);
  this.useBeforeOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSourceHandle.getBeforeOpen());
  this.useBeforeCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSourceHandle.getBeforeClose());
  this.useAfterOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSourceHandle.getAfterOpen());
  this.useAfterCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSourceHandle.getAfterClose());
  beforeOpenMethodID=ModuleUtil.getScriptUID(dataSourceHandle.getPropertyHandle(IDataSourceModel.BEFORE_OPEN_METHOD));
  beforeCloseMethodID=ModuleUtil.getScriptUID(dataSourceHandle.getPropertyHandle(IDataSourceModel.BEFORE_CLOSE_METHOD));
  afterOpenMethodID=ModuleUtil.getScriptUID(dataSourceHandle.getPropertyHandle(IDataSourceModel.AFTER_OPEN_METHOD));
  afterCloseMethodID=ModuleUtil.getScriptUID(dataSourceHandle.getPropertyHandle(IDataSourceModel.AFTER_CLOSE_METHOD));
}
Program: 66656
Project: 66656
Buggy source:
public void handleBeforeOpen(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeOpenEventHandler) {
      ScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),BEFORE_OPEN,dataSourceHandle.getBeforeOpen());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeOpen(new DataSourceInstance(dataSource),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleBeforeOpen(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeOpenEventHandler) {
      ScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),BEFORE_OPEN,dataSourceHandle.getBeforeOpen(),beforeOpenMethodID);
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeOpen(new DataSourceInstance(dataSource),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 66657
Project: 66657
Buggy source:
public void handleBeforeClose(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeCloseEventHandler) {
      ScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),BEFORE_CLOSE,dataSourceHandle.getBeforeClose());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeClose(new DataSourceInstance(dataSource),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleBeforeClose(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeCloseEventHandler) {
      ScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),BEFORE_CLOSE,dataSourceHandle.getBeforeClose(),beforeCloseMethodID);
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeClose(new DataSourceInstance(dataSource),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 66658
Project: 66658
Buggy source:
public void handleAfterClose(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterCloseEventHandler) {
      ScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),AFTER_CLOSE,dataSourceHandle.getAfterClose());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterClose(reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleAfterClose(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterCloseEventHandler) {
      ScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),AFTER_CLOSE,dataSourceHandle.getAfterClose(),afterCloseMethodID);
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterClose(reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 66659
Project: 66659
Buggy source:
public void handleAfterOpen(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterOpenEventHandler) {
      ScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),AFTER_OPEN,dataSourceHandle.getAfterOpen());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterOpen(new DataSourceInstance(dataSource),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleAfterOpen(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterOpenEventHandler) {
      ScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),AFTER_OPEN,dataSourceHandle.getAfterOpen(),afterOpenMethodID);
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterOpen(new DataSourceInstance(dataSource),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 66660
Project: 66660
Buggy source:
protected ScriptStatus handleJS(Scriptable scope,String name,String method,String script){
  return handleJS(scope,DATA_SOURCE,name,method,script);
}

Fixed version (ground truth):
protected ScriptStatus handleJS(Scriptable scope,String name,String method,String script,String id){
  return handleJS(scope,DATA_SOURCE,name,method,script,id);
}
Program: 66661
Project: 66661
Buggy source:
protected abstract ScriptStatus handleJS(Scriptable scope,String name,String method,String script);

Fixed version (ground truth):
protected abstract ScriptStatus handleJS(Scriptable scope,String name,String method,String script,String id);
Program: 66662
Project: 66662
Buggy source:
public boolean handleDescribe(IDataSetInstanceHandle dataSet,IScriptDataSetMetaDataDefinition metaData) throws BirtException {
  try {
    if (!this.useDescribeEventHandler) {
      ScriptStatus status=handleJS(getScriptScope(dataSet),dataSet.getName(),DESCRIBE,((ScriptDataSetHandle)dataSetHandle).getDescribe());
      if (status.didRun()) {
        Object result=status.result();
        if (result instanceof Boolean)         return ((Boolean)result).booleanValue();
 else         throw new DataException(ResourceConstants.EXPECT_BOOLEAN_RETURN_TYPE,new Object[]{"String_Node_Str",result});
      }
    }
    if (scriptedEventHandler != null)     return scriptedEventHandler.describe(new DataSetInstance(dataSet),new ScriptedDataSetMetaData(metaData));
  }
 catch (  Exception e) {
    addException(context,e);
  }
  return false;
}

Fixed version (ground truth):
public boolean handleDescribe(IDataSetInstanceHandle dataSet,IScriptDataSetMetaDataDefinition metaData) throws BirtException {
  try {
    if (!this.useDescribeEventHandler) {
      ScriptStatus status=handleJS(getScriptScope(dataSet),dataSet.getName(),DESCRIBE,((ScriptDataSetHandle)dataSetHandle).getDescribe(),describeMethodID);
      if (status.didRun()) {
        Object result=status.result();
        if (result instanceof Boolean)         return ((Boolean)result).booleanValue();
 else         throw new DataException(ResourceConstants.EXPECT_BOOLEAN_RETURN_TYPE,new Object[]{"String_Node_Str",result});
      }
    }
    if (scriptedEventHandler != null)     return scriptedEventHandler.describe(new DataSetInstance(dataSet),new ScriptedDataSetMetaData(metaData));
  }
 catch (  Exception e) {
    addException(context,e);
  }
  return false;
}
Program: 66663
Project: 66663
Buggy source:
public void handleOpen(IDataSetInstanceHandle dataSet) throws BirtException {
  try {
    if (!this.useOpenEventHandler) {
      ScriptStatus status=handleJS(getScriptScope(dataSet),dataSet.getName(),OPEN,((ScriptDataSetHandle)dataSetHandle).getOpen());
      if (status.didRun())       return;
    }
    if (scriptedEventHandler != null)     scriptedEventHandler.open(new DataSetInstance(dataSet));
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleOpen(IDataSetInstanceHandle dataSet) throws BirtException {
  try {
    if (!this.useOpenEventHandler) {
      ScriptStatus status=handleJS(getScriptScope(dataSet),dataSet.getName(),OPEN,((ScriptDataSetHandle)dataSetHandle).getOpen(),openMethodID);
      if (status.didRun())       return;
    }
    if (scriptedEventHandler != null)     scriptedEventHandler.open(new DataSetInstance(dataSet));
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 66664
Project: 66664
Buggy source:
public void handleClose(IDataSetInstanceHandle dataSet){
  try {
    if (!this.useCloseEventHandler) {
      ScriptStatus status=handleJS(getScriptScope(dataSet),dataSet.getName(),CLOSE,((ScriptDataSetHandle)dataSetHandle).getClose());
      if (status.didRun())       return;
    }
    if (scriptedEventHandler != null)     scriptedEventHandler.close(new DataSetInstance(dataSet));
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleClose(IDataSetInstanceHandle dataSet){
  try {
    if (!this.useCloseEventHandler) {
      ScriptStatus status=handleJS(getScriptScope(dataSet),dataSet.getName(),CLOSE,((ScriptDataSetHandle)dataSetHandle).getClose(),closeMethodID);
      if (status.didRun())       return;
    }
    if (scriptedEventHandler != null)     scriptedEventHandler.close(new DataSetInstance(dataSet));
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 66665
Project: 66665
Buggy source:
public ScriptDataSetScriptExecutor(ScriptDataSetHandle dataSetHandle,ExecutionContext context) throws BirtException {
  super(dataSetHandle,context);
  this.fetchScript=dataSetHandle.getFetch();
  useOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getOpen());
  useFetchEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getFetch());
  useCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getClose());
  useDescribeEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getDescribe());
}

Fixed version (ground truth):
public ScriptDataSetScriptExecutor(ScriptDataSetHandle dataSetHandle,ExecutionContext context) throws BirtException {
  super(dataSetHandle,context);
  this.fetchScript=dataSetHandle.getFetch();
  useOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getOpen());
  useFetchEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getFetch());
  useCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getClose());
  useDescribeEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getDescribe());
  openMethodID=ModuleUtil.getScriptUID(dataSetHandle.getPropertyHandle(IScriptDataSetModel.OPEN_METHOD));
  closeMethodID=ModuleUtil.getScriptUID(dataSetHandle.getPropertyHandle(IScriptDataSetModel.CLOSE_METHOD));
  fetchMethodID=ModuleUtil.getScriptUID(dataSetHandle.getPropertyHandle(IScriptDataSetModel.FETCH_METHOD));
  describeMethodID=ModuleUtil.getScriptUID(dataSetHandle.getPropertyHandle(IScriptDataSetModel.DESCRIBE_METHOD));
}
Program: 66666
Project: 66666
Buggy source:
public boolean handleFetch(IDataSetInstanceHandle dataSet,IDataRow row){
  try {
    if (!useFetchEventHandler) {
      ScriptStatus status=handleJS(getScriptScope(dataSet),dataSet.getName(),FETCH,this.fetchScript);
      if (status.didRun()) {
        Object result=status.result();
        if (result instanceof Boolean)         return ((Boolean)result).booleanValue();
 else         throw new DataException(ResourceConstants.EXPECT_BOOLEAN_RETURN_TYPE,new Object[]{"String_Node_Str",result});
      }
    }
    if (scriptedEventHandler != null)     return scriptedEventHandler.fetch(new DataSetInstance(dataSet),new UpdatableDataSetRow(row));
  }
 catch (  Exception e) {
    addException(context,e);
  }
  return false;
}

Fixed version (ground truth):
public boolean handleFetch(IDataSetInstanceHandle dataSet,IDataRow row){
  try {
    if (!useFetchEventHandler) {
      ScriptStatus status=handleJS(getScriptScope(dataSet),dataSet.getName(),FETCH,this.fetchScript,fetchMethodID);
      if (status.didRun()) {
        Object result=status.result();
        if (result instanceof Boolean)         return ((Boolean)result).booleanValue();
 else         throw new DataException(ResourceConstants.EXPECT_BOOLEAN_RETURN_TYPE,new Object[]{"String_Node_Str",result});
      }
    }
    if (scriptedEventHandler != null)     return scriptedEventHandler.fetch(new DataSetInstance(dataSet),new UpdatableDataSetRow(row));
  }
 catch (  Exception e) {
    addException(context,e);
  }
  return false;
}
Program: 66667
Project: 66667
Buggy source:
public void handleOpen(IDataSourceInstanceHandle dataSource){
  try {
    ScriptStatus status=super.handleJS(dataSource.getScriptScope(),dataSource.getName(),OPEN,((ScriptDataSourceHandle)dataSourceHandle).getOpen());
    if (status.didRun())     return;
    if (scriptedEventHandler != null)     scriptedEventHandler.open(new DataSourceInstance(dataSource));
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleOpen(IDataSourceInstanceHandle dataSource){
  try {
    String id=ModuleUtil.getScriptUID(dataSourceHandle.getPropertyHandle(IScriptDataSourceModel.OPEN_METHOD));
    ScriptStatus status=super.handleJS(dataSource.getScriptScope(),dataSource.getName(),OPEN,((ScriptDataSourceHandle)dataSourceHandle).getOpen(),id);
    if (status.didRun())     return;
    if (scriptedEventHandler != null)     scriptedEventHandler.open(new DataSourceInstance(dataSource));
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 66668
Project: 66668
Buggy source:
public void handleClose(IDataSourceInstanceHandle dataSource){
  try {
    ScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),CLOSE,((ScriptDataSourceHandle)dataSourceHandle).getClose());
    if (status.didRun())     return;
    if (scriptedEventHandler != null)     scriptedEventHandler.close(new DataSourceInstance(dataSource));
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleClose(IDataSourceInstanceHandle dataSource){
  try {
    String id=ModuleUtil.getScriptUID(dataSourceHandle.getPropertyHandle(IScriptDataSourceModel.CLOSE_METHOD));
    ScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),CLOSE,((ScriptDataSourceHandle)dataSourceHandle).getClose(),id);
    if (status.didRun())     return;
    if (scriptedEventHandler != null)     scriptedEventHandler.close(new DataSourceInstance(dataSource));
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 66669
Project: 66669
Buggy source:
public void add(DocumentExtension ext){
  ext.setParent(index);
  if (firstChild == -1) {
    updateFirstChild(ext);
    lastChild=firstChild;
    lastChildId=firstChildId;
    return;
  }
  if (head == null) {
    if (ext.contentId == lastChildId + 1) {
      ext.setPrevious(lastChild);
      ext.setNext(-1);
      lastChild=ext.index;
      lastChildId=ext.contentId;
    }
 else {
      head=new ExtensionSegment(firstChildId,firstChild,lastChildId,lastChild);
      insert(ext);
    }
  }
 else {
    if (ext.contentId == latest.endId + 1) {
      ext.setPrevious(latest.endIndex);
      if (latest.next != null) {
        ext.setNext(latest.next.startIndex);
      }
 else {
        ext.setNext(-1);
      }
      latest.endId=ext.contentId;
      latest.endIndex=ext.index;
    }
 else {
      insert(ext);
    }
  }
}

Fixed version (ground truth):
public void add(DocumentExtension ext){
  ext.setParent(index);
  if (firstChild == -1) {
    updateFirstChild(ext);
    lastChild=firstChild;
    lastChildId=firstChildId;
    return;
  }
  if (head == null) {
    if (ext.contentId == lastChildId + 1) {
      ext.setPrevious(lastChild);
      ext.setNext(-1);
      lastChild=ext.index;
      lastChildId=ext.contentId;
    }
 else {
      head=new ExtensionSegment(firstChildId,firstChild,lastChildId,lastChild);
      insert(ext);
    }
  }
 else {
    if (latest != null && ext.contentId == latest.endId + 1) {
      ext.setPrevious(latest.endIndex);
      if (latest.next != null) {
        ext.setNext(latest.next.startIndex);
      }
 else {
        ext.setNext(-1);
      }
      latest.endId=ext.contentId;
      latest.endIndex=ext.index;
    }
 else {
      insert(ext);
    }
  }
}
Program: 66670
Project: 66670
Buggy source:
/** 
 * @param bindingName
 * @param bindings
 * @return
 * @throws DataException
 */
private static boolean isAggregationBinding(String bindingName,List bindings) throws DataException {
  boolean find=false;
  for (int i=0; i < bindings.size(); i++) {
    IBinding binding=(IBinding)bindings.get(i);
    if (bindingName.equals(binding.getBindingName())) {
      find=true;
      if (OlapExpressionUtil.isAggregationBinding(binding))       return true;
      List refBindingName=ExpressionCompilerUtil.extractColumnExpression(binding.getExpression(),ScriptConstants.DATA_BINDING_SCRIPTABLE);
      for (int j=0; j < refBindingName.size(); j++) {
        if (isAggregationBinding((String)refBindingName.get(j),bindings))         return true;
      }
    }
  }
  if (!find)   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * @param bindingName
 * @param bindings
 * @return
 * @throws DataException
 */
private static boolean isAggregationBinding(String bindingName,List bindings) throws DataException {
  boolean find=false;
  for (int i=0; i < bindings.size(); i++) {
    IBinding binding=(IBinding)bindings.get(i);
    if (bindingName.equals(binding.getBindingName())) {
      find=true;
      if (OlapExpressionUtil.isAggregationBinding(binding)) {
        return true;
      }
      if (OlapExpressionUtil.isDirectRerenrence(binding.getExpression(),bindings)) {
        return false;
      }
      List refBindingName=ExpressionCompilerUtil.extractColumnExpression(binding.getExpression(),ScriptConstants.DATA_BINDING_SCRIPTABLE);
      for (int j=0; j < refBindingName.size(); j++) {
        if (isAggregationBinding((String)refBindingName.get(j),bindings))         return true;
      }
    }
  }
  if (!find)   return true;
  return false;
}
Program: 66671
Project: 66671
Buggy source:
/** 
 * Gets the area which is split from the original area.
 * @param ablatedChildren the children which is split off the original area.
 * @param newHeight the new content height
 * @return
 */
protected BlockContainerArea getSplitArea(ArrayList ablatedChildren,int newHeight){
  BlockContainerArea newContainer=cloneArea();
  for (int i=0; i < ablatedChildren.size(); i++) {
    ContainerArea child=(ContainerArea)ablatedChildren.get(i);
    child.setParent(newContainer);
    newContainer.addChild(child);
    children.remove(child);
  }
  newContainer.updateContentHeight(newHeight);
  return newContainer;
}

Fixed version (ground truth):
/** 
 * Gets the area which is split from the original area.
 * @param ablatedChildren the children which is split off the original area.
 * @param newHeight the new content height
 * @return
 */
protected BlockContainerArea getSplitArea(ArrayList ablatedChildren,int newHeight){
  BlockContainerArea newContainer=cloneArea();
  for (int i=0; i < ablatedChildren.size(); i++) {
    ContainerArea child=(ContainerArea)ablatedChildren.get(i);
    child.setParent(newContainer);
    newContainer.addChild(child);
    children.remove(child);
  }
  newContainer.updateContentHeight(newHeight);
  applyAlignment(newContainer);
  return newContainer;
}
Program: 66672
Project: 66672
Buggy source:
/** 
 * Updates the row height and the height of the cells in the row.
 * @param rowArea
 * @param height
 */
private void updateRowHeight(RowArea row,int height,boolean isFixedLayout){
  if (height < 0)   return;
  row.setHeight(height);
  for (int i=startCol; i <= endCol; i++) {
    CellArea cell=row.getCell(i);
    if (cell != null) {
      if (cell.getRowSpan() == 1) {
        if (cell instanceof DummyCell) {
          CellArea refCell=((DummyCell)cell).getCell();
          int delta=((DummyCell)cell).getDelta();
          refCell.setHeight(delta + height);
          verticalAlign(refCell);
        }
 else {
          int cellHeight=cell.getHeight();
          cell.setHeight(height);
          verticalAlign(cell);
          if (isFixedLayout && cellHeight > height) {
            cell.setNeedClip(true);
          }
        }
      }
      i=i + cell.getColSpan() - 1;
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the row height and the height of the cells in the row.
 * @param rowArea
 * @param height
 */
private void updateRowHeight(RowArea row,int height,boolean isFixedLayout){
  if (height < 0)   return;
  row.setHeight(height);
  for (int i=startCol; i <= endCol; i++) {
    CellArea cell=row.getCell(i);
    if (cell != null) {
      if (cell.getRowSpan() == 1) {
        if (cell instanceof DummyCell) {
          CellArea refCell=((DummyCell)cell).getCell();
          int delta=((DummyCell)cell).getDelta();
          refCell.setHeight(delta + height);
          align(refCell);
        }
 else {
          int cellHeight=cell.getHeight();
          cell.setHeight(height);
          align(cell);
          if (isFixedLayout && cellHeight > height) {
            cell.setNeedClip(true);
          }
        }
      }
      i=i + cell.getColSpan() - 1;
    }
  }
}
Program: 66673
Project: 66673
Buggy source:
/** 
 * When pagination happens, if drop cells should be finished by force, we need to end these cells and vertical align for them.
 */
public int resolveAll(RowArea row){
  if (row == null || rows.size() == 0) {
    return 0;
  }
  int originalRowHeight=row.getHeight();
  int height=originalRowHeight;
  for (int i=startCol; i <= endCol; i++) {
    CellArea cell=row.getCell(i);
    if (null == cell) {
      continue;
    }
    if (cell instanceof DummyCell) {
      DummyCell dummyCell=(DummyCell)cell;
      int delta=dummyCell.getDelta();
    }
 else {
      height=Math.max(height,cell.getHeight());
    }
    i=i + cell.getColSpan() - 1;
  }
  int dValue=height - originalRowHeight;
  for (int i=startCol; i <= endCol; i++) {
    CellArea cell=row.getCell(i);
    if (cell == null) {
      continue;
    }
    if (cell instanceof DummyCell) {
      int delta=((DummyCell)cell).getDelta();
      if (cell.getRowSpan() == 1) {
        CellArea refCell=((DummyCell)cell).getCell();
        refCell.setHeight(delta + height);
        verticalAlign(refCell);
      }
 else {
        CellArea refCell=((DummyCell)cell).getCell();
        refCell.setHeight(delta + height);
        verticalAlign(refCell);
      }
    }
 else {
      int oh=cell.getHeight();
      cell.setHeight(height);
      if (oh != height) {
        verticalAlign(cell);
      }
    }
    i=i + cell.getColSpan() - 1;
  }
  row.setHeight(height);
  return dValue;
}

Fixed version (ground truth):
/** 
 * When pagination happens, if drop cells should be finished by force, we need to end these cells and vertical align for them.
 */
public int resolveAll(RowArea row){
  if (row == null || rows.size() == 0) {
    return 0;
  }
  int originalRowHeight=row.getHeight();
  int height=originalRowHeight;
  for (int i=startCol; i <= endCol; i++) {
    CellArea cell=row.getCell(i);
    if (null == cell) {
      continue;
    }
    if (cell instanceof DummyCell) {
      DummyCell dummyCell=(DummyCell)cell;
      int delta=dummyCell.getDelta();
    }
 else {
      height=Math.max(height,cell.getHeight());
    }
    i=i + cell.getColSpan() - 1;
  }
  int dValue=height - originalRowHeight;
  for (int i=startCol; i <= endCol; i++) {
    CellArea cell=row.getCell(i);
    if (cell == null) {
      continue;
    }
    if (cell instanceof DummyCell) {
      int delta=((DummyCell)cell).getDelta();
      if (cell.getRowSpan() == 1) {
        CellArea refCell=((DummyCell)cell).getCell();
        refCell.setHeight(delta + height);
        align(refCell);
      }
 else {
        CellArea refCell=((DummyCell)cell).getCell();
        refCell.setHeight(delta + height);
        align(refCell);
      }
    }
 else {
      int oh=cell.getHeight();
      cell.setHeight(height);
      if (oh != height) {
        align(cell);
      }
    }
    i=i + cell.getColSpan() - 1;
  }
  row.setHeight(height);
  return dValue;
}
Program: 66674
Project: 66674
Buggy source:
private static void saveCubeOperation(DataOutputStream dos,ICubeOperation co) throws DataException, IOException {
}

Fixed version (ground truth):
private static void saveCubeOperation(DataOutputStream dos,ICubeOperation co) throws DataException, IOException {
  if (co == null) {
    IOUtil.writeBool(dos,false);
    return;
  }
  IOUtil.writeBool(dos,true);
  if (co instanceof AddingNestAggregations) {
    IOUtil.writeInt(dos,CUBE_OPERATION_FLAG_ADDING_NEST_AGGRS);
    saveBindings(dos,Arrays.asList(co.getNewBindings()));
  }
}
Program: 66675
Project: 66675
Buggy source:
/** 
 * @param session
 * @param filterIterator
 * @param query
 * @throws AdapterException 
 */
private static void popualteFilter(DataRequestSession session,Iterator filterIterator,QueryDefinition query) throws AdapterException {
  while (filterIterator.hasNext()) {
    FilterConditionHandle filter=(FilterConditionHandle)filterIterator.next();
    query.addFilter(session.getModelAdaptor().adaptFilter(filter));
  }
}

Fixed version (ground truth):
/** 
 * @param session
 * @param filterIterator
 * @param query
 * @throws AdapterException 
 */
private static void popualteFilter(DataRequestSession session,Iterator filterIterator,QueryDefinition query) throws AdapterException {
  while (filterIterator.hasNext()) {
    FilterConditionHandle filter=(FilterConditionHandle)filterIterator.next();
    if (query instanceof CubeCreationQueryDefinition) {
      ((CubeCreationQueryDefinition)query).addDataSetFilter(session.getModelAdaptor().adaptFilter(filter));
    }
 else     query.addFilter(session.getModelAdaptor().adaptFilter(filter));
  }
}
Program: 66679
Project: 66679
Buggy source:
public void startTable(ITableContent table){
  XlsContainer currentContainer=getCurrentContainer();
  if (currentContainer == null) {
    addContainer(null);
    return;
  }
  ContainerSizeInfo sizeInfo=currentContainer.getSizeInfo();
  int width=sizeInfo.getWidth();
  ColumnsInfo info=null;
  int dpi=context.getDpi();
  if (autoExtend()) {
    info=LayoutUtil.createTable(table,width,dpi);
  }
 else {
    int[] columns=LayoutUtil.createFixedTable(table,LayoutUtil.getElementWidth(table,width,dpi),dpi);
    info=new ColumnsInfo(columns);
  }
  String caption=table.getCaption();
  if (caption != null) {
    addCaption(caption,table.getComputedStyle());
  }
  addTable(table,info,sizeInfo);
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  XlsContainer currentContainer=getCurrentContainer();
  if (currentContainer == null) {
    addContainer(null);
    return;
  }
  ContainerSizeInfo sizeInfo=currentContainer.getSizeInfo();
  int width=sizeInfo.getWidth();
  ColumnsInfo info=null;
  int dpi=context.getDpi();
  if (context.isAutoLayout()) {
    info=LayoutUtil.createTable(table,width,dpi,autoExtend());
  }
 else {
    int[] columns=LayoutUtil.createFixedTable(table,LayoutUtil.getElementWidth(table,width,dpi),dpi);
    info=new ColumnsInfo(columns);
  }
  String caption=table.getCaption();
  if (caption != null) {
    addCaption(caption,table.getComputedStyle());
  }
  addTable(table,info,sizeInfo);
}
Program: 66681
Project: 66681
Buggy source:
public void doSave(DataOutputStream outputStream,DataOutputStream rowLensStream,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> map,List<IBinding> cacheRequestMap) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.diskBasedResultSet.getCount();
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(dos,rowCount);
    int currIndex=this.currResultIndex;
    this.reset();
    long offset=4;
    for (int i=0; i < rowCount; i++) {
      IOUtil.writeLong(rowLensStream,offset);
      offset+=ResultSetUtil.writeResultObject(dos,this.diskBasedResultSet.nextRow(),colCount,resultSetNameSet,stringTable,map,i);
    }
    this.reset();
    this.moveTo(currIndex);
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
public void doSave(DataOutputStream outputStream,DataOutputStream rowLensStream,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> map,List<IBinding> cacheRequestMap) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.diskBasedResultSet.getCount();
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(dos,rowCount);
    int currIndex=this.currResultIndex;
    this.reset();
    long offset=4;
    for (int i=0; i < rowCount; i++) {
      IResultObject ro=this.diskBasedResultSet.nextRow();
      if (ro == null)       return;
      IOUtil.writeLong(rowLensStream,offset);
      offset+=ResultSetUtil.writeResultObject(dos,ro,colCount,resultSetNameSet,stringTable,map,i);
    }
    this.reset();
    this.moveTo(currIndex);
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 66682
Project: 66682
Buggy source:
public void incrementalUpdate(OutputStream outputStream,OutputStream rowLensStream,int originalRowCount,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> map,List<IBinding> cacheRequestMap) throws DataException {
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=originalRowCount + this.resultObjects.length;
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(outputStream,rowCount);
    if (outputStream instanceof RAOutputStream)     ((RAOutputStream)outputStream).seek(((RAOutputStream)outputStream).length());
    if (rowLensStream instanceof RAOutputStream)     ((RAOutputStream)rowLensStream).seek(((RAOutputStream)rowLensStream).length());
    DataOutputStream dos=new DataOutputStream(outputStream);
    DataOutputStream rlos=new DataOutputStream(rowLensStream);
    long offset=4;
    if (outputStream instanceof RAOutputStream)     offset=((RAOutputStream)outputStream).length();
    for (int i=0; i < rowCount; i++) {
      IOUtil.writeLong(rlos,offset);
      offset+=ResultSetUtil.writeResultObject(dos,resultObjects[i],colCount,resultSetNameSet,stringTable,map,originalRowCount + i);
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
public void incrementalUpdate(OutputStream outputStream,OutputStream rowLensStream,int originalRowCount,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> map,List<IBinding> cacheRequestMap) throws DataException {
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=originalRowCount + this.resultObjects.length;
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(outputStream,rowCount);
    if (outputStream instanceof RAOutputStream)     ((RAOutputStream)outputStream).seek(((RAOutputStream)outputStream).length());
    if (rowLensStream instanceof RAOutputStream)     ((RAOutputStream)rowLensStream).seek(((RAOutputStream)rowLensStream).length());
    DataOutputStream dos=new DataOutputStream(outputStream);
    DataOutputStream rlos=new DataOutputStream(rowLensStream);
    long offset=4;
    if (outputStream instanceof RAOutputStream)     offset=((RAOutputStream)outputStream).length();
    for (int i=0; i < rowCount - originalRowCount; i++) {
      IOUtil.writeLong(rlos,offset);
      offset+=ResultSetUtil.writeResultObject(dos,resultObjects[i],colCount,resultSetNameSet,stringTable,map,originalRowCount + i);
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 66683
Project: 66683
Buggy source:
public void incrementalUpdate(OutputStream outputStream,OutputStream rowLensStream,int originalRowCount,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> map,List<IBinding> cacheRequestMap) throws DataException {
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=originalRowCount + this.diskBasedResultSet.getCount();
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(outputStream,rowCount);
    if (outputStream instanceof RAOutputStream)     ((RAOutputStream)outputStream).seek(((RAOutputStream)outputStream).length());
    if (rowLensStream instanceof RAOutputStream)     ((RAOutputStream)rowLensStream).seek(((RAOutputStream)rowLensStream).length());
    DataOutputStream dos=new DataOutputStream(outputStream);
    DataOutputStream rlos=new DataOutputStream(rowLensStream);
    int currIndex=this.currResultIndex;
    this.reset();
    long offset=4;
    if (outputStream instanceof RAOutputStream)     offset=((RAOutputStream)outputStream).length();
    for (int i=0; i < rowCount; i++) {
      IOUtil.writeLong(rlos,offset);
      offset+=ResultSetUtil.writeResultObject(dos,this.diskBasedResultSet.nextRow(),colCount,resultSetNameSet,stringTable,map,i + originalRowCount);
    }
    this.reset();
    this.moveTo(currIndex);
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
public void incrementalUpdate(OutputStream outputStream,OutputStream rowLensStream,int originalRowCount,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> map,List<IBinding> cacheRequestMap) throws DataException {
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=originalRowCount + this.diskBasedResultSet.getCount();
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(outputStream,rowCount);
    if (outputStream instanceof RAOutputStream)     ((RAOutputStream)outputStream).seek(((RAOutputStream)outputStream).length());
    if (rowLensStream instanceof RAOutputStream)     ((RAOutputStream)rowLensStream).seek(((RAOutputStream)rowLensStream).length());
    DataOutputStream dos=new DataOutputStream(outputStream);
    DataOutputStream rlos=new DataOutputStream(rowLensStream);
    int currIndex=this.currResultIndex;
    this.reset();
    long offset=4;
    if (outputStream instanceof RAOutputStream)     offset=((RAOutputStream)outputStream).length();
    for (int i=0; i < rowCount - originalRowCount; i++) {
      IOUtil.writeLong(rlos,offset);
      offset+=ResultSetUtil.writeResultObject(dos,this.diskBasedResultSet.nextRow(),colCount,resultSetNameSet,stringTable,map,i + originalRowCount);
    }
    this.reset();
    this.moveTo(currIndex);
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 66686
Project: 66686
Buggy source:
protected boolean canLeave(){
  return false;
}

Fixed version (ground truth):
protected boolean canLeave(){
  return true;
}
Program: 66687
Project: 66687
Buggy source:
protected void doSkipToExecutor(InstanceID iid,long offset) throws Exception {
  IQueryResultSet rset=(IQueryResultSet)rsets[0];
  long uid=iid.getUniqueID();
  DataID dataId=iid.getDataID();
  long rowId=dataId.getRowID();
  long rsetPosition=rset.getRowIndex();
  if (rsetPosition == rowId) {
    if (currentElement >= totalElements) {
      collectExecutables(uid == 0,true);
    }
  }
 else {
    rset.skipTo(rowId);
    collectExecutables(uid == 0,true);
  }
  for (int i=0; i < totalElements; i++) {
    if (executableElements[i].getID() == iid.getComponentID()) {
      currentElement=i;
      return;
    }
  }
  currentElement=totalElements;
}

Fixed version (ground truth):
protected void doSkipToExecutor(InstanceID iid,long offset) throws Exception {
  IQueryResultSet rset=(IQueryResultSet)rsets[0];
  long uid=iid.getUniqueID();
  DataID dataId=iid.getDataID();
  long rowId=0;
  if (dataId != null) {
    rowId=dataId.getRowID();
  }
  long rsetPosition=rset.getRowIndex();
  if (rsetPosition == rowId) {
    if (currentElement >= totalElements) {
      collectExecutables(uid == 0,true);
    }
  }
 else {
    rset.skipTo(rowId);
    collectExecutables(uid == 0,true);
  }
  for (int i=0; i < totalElements; i++) {
    if (executableElements[i].getID() == iid.getComponentID()) {
      currentElement=i;
      return;
    }
  }
  currentElement=totalElements;
}
Program: 66688
Project: 66688
Buggy source:
protected void doSkipToExecutor(InstanceID iid,long offset) throws Exception {
  IQueryResultSet rset=(IQueryResultSet)rsets[0];
  long uid=iid.getUniqueID();
  DataID dataId=iid.getDataID();
  long rowId=dataId.getRowID();
  long rsetPosition=rset.getRowIndex();
  if (rsetPosition == rowId) {
    if (currentElement >= totalElements) {
      collectExecutables(uid == 0,true);
    }
  }
 else {
    rset.skipTo(rowId);
    collectExecutables(uid == 0,true);
  }
  for (int i=0; i < totalElements; i++) {
    if (executableElements[i].getID() == iid.getComponentID()) {
      currentElement=i;
      return;
    }
  }
  currentElement=totalElements;
}

Fixed version (ground truth):
protected void doSkipToExecutor(InstanceID iid,long offset) throws Exception {
  IQueryResultSet rset=(IQueryResultSet)rsets[0];
  long uid=iid.getUniqueID();
  DataID dataId=iid.getDataID();
  long rowId=0;
  if (dataId != null) {
    rowId=dataId.getRowID();
  }
  long rsetPosition=rset.getRowIndex();
  if (rsetPosition == rowId) {
    if (currentElement >= totalElements) {
      collectExecutables(uid == 0,true);
    }
  }
 else {
    rset.skipTo(rowId);
    collectExecutables(uid == 0,true);
  }
  for (int i=0; i < totalElements; i++) {
    if (executableElements[i].getID() == iid.getComponentID()) {
      currentElement=i;
      return;
    }
  }
  currentElement=totalElements;
}
Program: 66689
Project: 66689
Buggy source:
/** 
 * to indicate whether the specified <code>resultSet</code> has aggregation definition for any one of the <code>aggregationNames</code>.
 * @param resultSet
 * @param aggregationNames
 * @return
 * @throws IOException
 */
private boolean hasDefinition(IAggregationResultSet resultSet,String[] aggregationNames) throws IOException {
  for (int j=0; j < aggregationNames.length; j++) {
    if (resultSet.getAggregationIndex(aggregationNames[j]) >= 0) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * to indicate whether the specified <code>resultSet</code> has aggregation definition for any one of the <code>aggregationNames</code>. //TODO Currently we do not support the filter on drilled aggregate result. 
 * @param resultSet
 * @param aggregationNames
 * @return
 * @throws IOException
 */
private boolean hasDefinition(IAggregationResultSet resultSet,String[] aggregationNames) throws IOException {
  for (int j=0; j < aggregationNames.length; j++) {
    if (resultSet.getAggregationIndex(aggregationNames[j]) >= 0 && !(resultSet.getAggregationDefinition() instanceof DrilledAggregationDefinition)) {
      return true;
    }
  }
  return false;
}
Program: 66690
Project: 66690
Buggy source:
/** 
 * Return the enclosed document iterator.
 * @return
 */
ResultIterator getDocumentIterator(){
  return this.docIt;
}

Fixed version (ground truth):
/** 
 * Return the enclosed document iterator.
 * @return
 */
public ResultIterator getDocumentIterator(){
  return this.docIt;
}