nus-yam/ex-repair huggingface dataset:
Program: 73861
Project: 73861
Buggy source:
public IReportItemExecutor createPageExecutor(long pageNumber,MasterPageDesign pageDesign){
  IPageContent pageContent=(IPageContent)pages.get(pageDesign);
  if (pageContent == null) {
    IReportItemExecutor pageExecutor=new MasterPageExecutor(manager,pageNumber,pageDesign);
    pageContent=(IPageContent)pageExecutor.execute();
    IContentEmitter domEmitter=new DOMBuilderEmitter(pageContent);
    ReportExecutorUtil.executeAll(pageExecutor,domEmitter);
    pageExecutor.close();
    pages.put(pageDesign,pageContent);
  }
 else {
    pageContent.setPageNumber(pageNumber);
  }
  return new DOMReportItemExecutor(pageContent,true);
}

Fixed version (ground truth):
public IReportItemExecutor createPageExecutor(long pageNumber,MasterPageDesign pageDesign){
  IPageContent pageContent=(IPageContent)pages.get(pageDesign);
  if (pageContent == null) {
    IReportItemExecutor pageExecutor=new MasterPageExecutor(manager,pageNumber,pageDesign);
    pageContent=(IPageContent)pageExecutor.execute();
    IContentEmitter domEmitter=new DOMBuilderEmitter(pageContent);
    ReportExecutorUtil.executeAll(pageExecutor,domEmitter);
    pageExecutor.close();
    pages.put(pageDesign,pageContent);
  }
 else {
    pageContent.setPageNumber(pageNumber);
    context.setPageNumber(pageNumber);
  }
  return new DOMReportItemExecutor(pageContent,true);
}
Program: 73863
Project: 73863
Buggy source:
/** 
 * Check whether the output format uses PDF Layout
 * @param format
 * @return
 */
public static boolean isPDFLayout(String format){
  if (format == null)   return false;
  if (IBirtConstants.PDF_RENDER_FORMAT.equalsIgnoreCase(format) || IBirtConstants.POSTSCRIPT_RENDER_FORMAT.equalsIgnoreCase(format))   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * Check whether the output format uses PDF Layout
 * @param format
 * @return
 */
public static boolean isPDFLayout(String format){
  if (format == null)   return false;
  if (IBirtConstants.PDF_RENDER_FORMAT.equalsIgnoreCase(format) || IBirtConstants.POSTSCRIPT_RENDER_FORMAT.equalsIgnoreCase(format) || IBirtConstants.PPT_RENDER_FORMAT.equalsIgnoreCase(format))   return true;
  return false;
}
Program: 73864
Project: 73864
Buggy source:
/** 
 * Generate document name according to report name.
 * @param reportName
 * @param id
 * @return document name.
 */
protected static String generateDocumentFromReport(String reportName,String id){
  if (reportName == null)   return null;
  String documentFile="String_Node_Str";
  if (reportName.indexOf('.') >= 0) {
    documentFile=reportName.substring(0,reportName.lastIndexOf('.'));
  }
  if (id != null && id.length() > 0) {
    documentFile=documentFile + id + SUFFIX_REPORT_DOCUMENT;
  }
 else {
    documentFile=documentFile + SUFFIX_REPORT_DOCUMENT;
  }
  return documentFile;
}

Fixed version (ground truth):
/** 
 * Generate document name according to report name.
 * @param reportName
 * @param id
 * @return document name.
 */
protected static String generateDocumentFromReport(String reportName,String id){
  if (reportName == null)   return null;
  String documentFile=reportName;
  if (reportName.indexOf('.') >= 0) {
    documentFile=reportName.substring(0,reportName.lastIndexOf('.'));
  }
  if (id != null && id.length() > 0) {
    documentFile=documentFile + id + SUFFIX_REPORT_DOCUMENT;
  }
 else {
    documentFile=documentFile + SUFFIX_REPORT_DOCUMENT;
  }
  return documentFile;
}
Program: 73865
Project: 73865
Buggy source:
/** 
 * move the cursor to the previous row.
 * @return
 */
boolean previous(){
  this.currentPosition--;
  this.curPosOnMap--;
  if (currentPosition >= this.traverseLength - 1 || currentPosition > 0) {
    return true;
  }
 else {
    currentPosition=-1;
    return false;
  }
}

Fixed version (ground truth):
/** 
 * move the cursor to the previous row.
 * @return
 */
boolean previous(){
  this.currentPosition--;
  this.curPosOnMap--;
  if (currentPosition >= 0) {
    return true;
  }
 else {
    currentPosition=-1;
    return false;
  }
}
Program: 73866
Project: 73866
Buggy source:
public void deserialize(InputStream is){
  try {
    ObjectInputStream ois=new ObjectInputStream(is);
    Object o=ois.readObject();
    if (o instanceof RunTimeContext) {
      RunTimeContext drtc=(RunTimeContext)o;
      if (rtc != null) {
        drtc.setULocale(rtc.getULocale());
        drtc.setScale(rtc.getScale());
      }
      rtc=drtc;
      cm=rtc.getScriptContext().getChartInstance();
      if (cm != null && handle != null) {
        IReportItem item=handle.getReportItem();
        ((ChartReportItemImpl)item).setModel(cm);
        ((ChartReportItemImpl)item).setScale(rtc.getScale());
      }
      Object oMaxRow=context.getAppContext().get(EngineConstants.PROPERTY_EXTENDED_ITEM_MAX_ROW);
      if (oMaxRow != null) {
        rtc.putState(ChartUtil.CHART_MAX_ROW,oMaxRow);
      }
 else {
        oMaxRow=context.getGlobalVariable(EngineConstants.PROPERTY_EXTENDED_ITEM_MAX_ROW);
        if (oMaxRow != null) {
          rtc.putState(ChartUtil.CHART_MAX_ROW,oMaxRow);
        }
      }
    }
    ois.close();
  }
 catch (  Exception e) {
    logger.log(e);
  }
}

Fixed version (ground truth):
public void deserialize(InputStream is){
  try {
    ObjectInputStream ois=new ObjectInputStream(is){
      protected Class resolveClass(      ObjectStreamClass desc) throws IOException, ClassNotFoundException {
        if ("String_Node_Str".equals(desc.getName())) {
          return ChartScriptContext.class;
        }
        return super.resolveClass(desc);
      }
    }
;
    Object o=ois.readObject();
    if (o instanceof RunTimeContext) {
      RunTimeContext drtc=(RunTimeContext)o;
      if (rtc != null) {
        drtc.setULocale(rtc.getULocale());
        drtc.setScale(rtc.getScale());
      }
      rtc=drtc;
      cm=rtc.getScriptContext().getChartInstance();
      if (cm != null && handle != null) {
        IReportItem item=handle.getReportItem();
        ((ChartReportItemImpl)item).setModel(cm);
        ((ChartReportItemImpl)item).setScale(rtc.getScale());
      }
      Object oMaxRow=context.getAppContext().get(EngineConstants.PROPERTY_EXTENDED_ITEM_MAX_ROW);
      if (oMaxRow != null) {
        rtc.putState(ChartUtil.CHART_MAX_ROW,oMaxRow);
      }
 else {
        oMaxRow=context.getGlobalVariable(EngineConstants.PROPERTY_EXTENDED_ITEM_MAX_ROW);
        if (oMaxRow != null) {
          rtc.putState(ChartUtil.CHART_MAX_ROW,oMaxRow);
        }
      }
    }
    ois.close();
  }
 catch (  Exception e) {
    logger.log(e);
  }
}
Program: 73867
Project: 73867
Buggy source:
public void prepare(Report report,Map appContext){
  ReportDesignHandle rptHandle=report.getReportDesign();
  List dataSetList=rptHandle.getAllDataSets();
  for (int i=0; i < dataSetList.size(); i++) {
    DataSetHandle dataset=(DataSetHandle)dataSetList.get(i);
    try {
      adapter.defineDataSet(dataset,dteSession);
    }
 catch (    BirtException be) {
      logger.log(Level.SEVERE,be.getMessage(),be);
      context.addException(dataset,be);
    }
  }
  List cubeList=rptHandle.getAllCubes();
  for (int i=0; i < cubeList.size(); i++) {
    CubeHandle cube=(CubeHandle)cubeList.get(i);
    if (cube.clientsIterator().hasNext()) {
      try {
        dteSession.defineCube(cube);
      }
 catch (      BirtException be) {
        logger.log(Level.SEVERE,be.getMessage(),be);
        context.addException(cube,be);
      }
    }
  }
  new ReportQueryBuilder(report,context).build();
  doPrepareQuery(report,appContext);
}

Fixed version (ground truth):
public void prepare(Report report,Map appContext){
  ReportDesignHandle rptHandle=report.getReportDesign();
  List dataSetList=rptHandle.getAllDataSets();
  for (int i=0; i < dataSetList.size(); i++) {
    DataSetHandle dataset=(DataSetHandle)dataSetList.get(i);
    try {
      adapter.defineDataSet(dataset,dteSession);
    }
 catch (    BirtException be) {
      logger.log(Level.SEVERE,be.getMessage(),be);
      context.addException(dataset,be);
    }
  }
  List cubeList=rptHandle.getAllCubes();
  for (int i=0; i < cubeList.size(); i++) {
    CubeHandle cube=(CubeHandle)cubeList.get(i);
    if (cube.clientsIterator().hasNext()) {
      try {
        dteSession.defineCube(cube);
      }
 catch (      BirtException be) {
        logger.log(Level.SEVERE,be.getMessage(),be);
        context.addException(cube,be);
      }
    }
  }
  new ReportQueryBuilder(report,context,dteSession).build();
  doPrepareQuery(report,appContext);
}
Program: 73868
Project: 73868
Buggy source:
/** 
 * prepare the queries defined in the report.
 */
public void prepare(Report report,Map appContext){
  new ReportQueryBuilder(report,context).build();
  doPrepareQuery(report,appContext);
}

Fixed version (ground truth):
/** 
 * prepare the queries defined in the report.
 */
public void prepare(Report report,Map appContext){
  new ReportQueryBuilder(report,context,dteSession).build();
  doPrepareQuery(report,appContext);
}
Program: 73872
Project: 73872
Buggy source:
public CubeCursor getCubeCursor() throws DataException {
  if (this.cubeCursor != null)   return this.cubeCursor;
  try {
    stopSign.start();
    CubeQueryExecutor executor=new CubeQueryExecutor(this.outResults,preparedQuery.getCubeQueryDefinition(),this.session,this.scope,this.context);
    BirtCubeView bcv=new BirtCubeView(executor,appContext);
    CubeCursor cubeCursor=bcv.getCubeCursor(stopSign);
    String newResultSetId=executor.getQueryResultsId();
    if (newResultSetId != null) {
      this.queryResultsId=newResultSetId;
    }
    this.scope.put(ScriptConstants.MEASURE_SCRIPTABLE,this.scope,new JSMeasureAccessor(cubeCursor));
    this.scope.put(ScriptConstants.DIMENSION_SCRIPTABLE,this.scope,new JSLevelAccessor(this.preparedQuery.getCubeQueryDefinition(),bcv));
    this.cubeCursor=new CubeCursorImpl(outResults,cubeCursor,this.scope,this.preparedQuery.getCubeQueryDefinition());
    return this.cubeCursor;
  }
 catch (  OLAPException e) {
    throw new DataException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public CubeCursor getCubeCursor() throws DataException {
  if (this.cubeCursor != null)   return this.cubeCursor;
  try {
    stopSign.start();
    CubeQueryExecutor executor=new CubeQueryExecutor(this.outResults,preparedQuery.getCubeQueryDefinition(),this.session,this.scope,this.context);
    BirtCubeView bcv=new BirtCubeView(executor,appContext);
    CubeCursor cubeCursor=bcv.getCubeCursor(stopSign);
    String newResultSetId=executor.getQueryResultsId();
    if (newResultSetId != null) {
      this.queryResultsId=newResultSetId;
    }
    this.scope.put(ScriptConstants.MEASURE_SCRIPTABLE,this.scope,new JSMeasureAccessor(cubeCursor,bcv.getMeasureMapping()));
    this.scope.put(ScriptConstants.DIMENSION_SCRIPTABLE,this.scope,new JSLevelAccessor(this.preparedQuery.getCubeQueryDefinition(),bcv));
    this.cubeCursor=new CubeCursorImpl(outResults,cubeCursor,this.scope,this.preparedQuery.getCubeQueryDefinition());
    return this.cubeCursor;
  }
 catch (  OLAPException e) {
    throw new DataException(e.getLocalizedMessage());
  }
}
Program: 73873
Project: 73873
Buggy source:
/** 
 * Get cubeCursor for current cubeView.
 * @param stopSign
 * @return CubeCursor
 * @throws OLAPException
 * @throws DataException 
 */
public CubeCursor getCubeCursor(StopSign stopSign) throws OLAPException, DataException {
  Map relationMap=CubeQueryDefinitionUtil.getRelationWithMeasure(queryDefn);
  IResultSet result;
  try {
    result=new QueryExecutor().execute(this,executor,manager,stopSign);
  }
 catch (  IOException e) {
    throw new OLAPException(e.getLocalizedMessage());
  }
catch (  BirtException e) {
    throw new OLAPException(e.getLocalizedMessage());
  }
  CubeCursor cubeCursor;
  if (this.appContext != null && this.executor.getContext().getMode() == DataEngineContext.DIRECT_PRESENTATION) {
    cubeCursor=new CubeCursorImpl(this,result,relationMap,manager,appContext);
  }
 else {
    cubeCursor=new CubeCursorImpl(this,result,relationMap,manager);
  }
  return cubeCursor;
}

Fixed version (ground truth):
/** 
 * Get cubeCursor for current cubeView.
 * @param stopSign
 * @return CubeCursor
 * @throws OLAPException
 * @throws DataException 
 */
public CubeCursor getCubeCursor(StopSign stopSign) throws OLAPException, DataException {
  Map relationMap=CubeQueryDefinitionUtil.getRelationWithMeasure(queryDefn,measureMapping);
  IResultSet result;
  try {
    result=new QueryExecutor().execute(this,executor,manager,stopSign);
  }
 catch (  IOException e) {
    throw new OLAPException(e.getLocalizedMessage());
  }
catch (  BirtException e) {
    throw new OLAPException(e.getLocalizedMessage());
  }
  CubeCursor cubeCursor;
  if (this.appContext != null && this.executor.getContext().getMode() == DataEngineContext.DIRECT_PRESENTATION) {
    cubeCursor=new CubeCursorImpl(this,result,relationMap,manager,appContext);
  }
 else {
    cubeCursor=new CubeCursorImpl(this,result,relationMap,manager);
  }
  return cubeCursor;
}
Program: 73876
Project: 73876
Buggy source:
public JSMeasureAccessor(CubeCursor cursor) throws OLAPException {
  this.cursor=cursor;
}

Fixed version (ground truth):
/** 
 * @param cursor
 * @param measureMapping
 * @throws OLAPException
 */
public JSMeasureAccessor(CubeCursor cursor,Map measureMapping) throws OLAPException {
  this.cursor=cursor;
  this.measureMapping=measureMapping;
}
Program: 73877
Project: 73877
Buggy source:
public Object get(String name,Scriptable start){
  try {
    return this.cursor.getObject(name);
  }
 catch (  OLAPException e) {
    throw new RuntimeException(new DataException(e.getLocalizedMessage()));
  }
}

Fixed version (ground truth):
public Object get(String name,Scriptable start){
  try {
    return this.cursor.getObject((String)measureMapping.get(name));
  }
 catch (  OLAPException e) {
    throw new RuntimeException(new DataException(e.getLocalizedMessage()));
  }
}
Program: 73878
Project: 73878
Buggy source:
/** 
 * This method returns a list of ICubeAggrDefn instances which describes the aggregations that need to be calculated in cube query.
 * @param bindings
 * @return
 * @throws DataException 
 */
public static ICubeAggrDefn[] getAggrDefns(List bindings) throws DataException {
  if (bindings == null || bindings.size() == 0)   return new ICubeAggrDefn[0];
  List cubeAggrDefns=new ArrayList();
  for (Iterator it=bindings.iterator(); it.hasNext(); ) {
    IBinding binding=((IBinding)it.next());
    if (binding.getExpression() instanceof IScriptExpression) {
      if (binding.getAggrFunction() != null)       cubeAggrDefns.add(new CubeAggrDefn(binding.getBindingName(),getMeasure(((IScriptExpression)binding.getExpression()).getText()),convertToDimLevel(binding.getAggregatOns()),binding.getAggrFunction(),convertToDimLevelAttribute(binding.getArguments(),bindings),binding.getFilter()));
    }
  }
  ICubeAggrDefn[] result=new ICubeAggrDefn[cubeAggrDefns.size()];
  for (int i=0; i < result.length; i++) {
    result[i]=(ICubeAggrDefn)cubeAggrDefns.get(i);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * This method returns a list of ICubeAggrDefn instances which describes the aggregations that need to be calculated in cube query.
 * @param bindings
 * @return
 * @throws DataException 
 */
public static ICubeAggrDefn[] getAggrDefns(List bindings) throws DataException {
  if (bindings == null || bindings.size() == 0)   return new ICubeAggrDefn[0];
  List cubeAggrDefns=new ArrayList();
  for (Iterator it=bindings.iterator(); it.hasNext(); ) {
    IBinding binding=((IBinding)it.next());
    if (binding.getExpression() instanceof IScriptExpression) {
      if (binding.getAggrFunction() != null || binding.getAggregatOns().size() != 0)       cubeAggrDefns.add(new CubeAggrDefn(binding.getBindingName(),getMeasure(((IScriptExpression)binding.getExpression()).getText()),convertToDimLevel(binding.getAggregatOns()),binding.getAggrFunction(),convertToDimLevelAttribute(binding.getArguments(),bindings),binding.getFilter()));
    }
  }
  ICubeAggrDefn[] result=new ICubeAggrDefn[cubeAggrDefns.size()];
  for (int i=0; i < result.length; i++) {
    result[i]=(ICubeAggrDefn)cubeAggrDefns.get(i);
  }
  return result;
}
Program: 73880
Project: 73880
Buggy source:
/** 
 * @param dataEngine
 * @param queryDefn
 * @return
 * @throws DataException
 */
private static IPreparedQuery newIVInstance(DataEngineImpl dataEngine,IQueryDefinition queryDefn) throws DataException {
  if (runQueryOnRS(dataEngine,queryDefn))   return new PreparedIVQuery(dataEngine,queryDefn);
 else   return new PreparedIVDataSourceQuery(dataEngine,queryDefn);
}

Fixed version (ground truth):
/** 
 * @param dataEngine
 * @param queryDefn
 * @return
 * @throws DataException
 */
private static IPreparedQuery newIVInstance(DataEngineImpl dataEngine,IQueryDefinition queryDefn) throws DataException {
switch (runQueryOnRS(dataEngine,queryDefn)) {
case BASED_ON_RESULTSET:
    return new PreparedIVQuery(dataEngine,queryDefn);
case BASED_ON_DATASET:
  return new PreparedIVDataSourceQuery(dataEngine,queryDefn);
default :
return new DummyPreparedQuery(queryDefn,dataEngine.getSession().getTempDir(),dataEngine.getContext());
}
}
Program: 73881
Project: 73881
Buggy source:
public IQueryResults execute(IBaseQueryResults outerResults,Scriptable scope) throws DataException {
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public IQueryResults execute(IBaseQueryResults outerResults,Scriptable scope) throws DataException {
  try {
    if (context == null)     return new CachedQueryResults(tempDir,this.queryDefn.getQueryResultsID());
 else     return new QueryResults(this.tempDir,this.context,this.queryDefn.getQueryResultsID(),outerResults);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 73882
Project: 73882
Buggy source:
/** 
 * @return
 * @throws DataException 
 */
private static boolean isCompatibleRSMap(Map oldMap,Map newMap) throws DataException {
  if (oldMap == null)   return newMap.size() == 0;
 else   if (newMap == null)   return oldMap.size() == 0;
  if (newMap.size() > oldMap.size())   return false;
  Iterator it=newMap.keySet().iterator();
  while (it.hasNext()) {
    Object key=it.next();
    Object oldObj=oldMap.get(key);
    Object newObj=newMap.get(key);
    if (oldObj != null) {
      if (!isTwoBindingEqual((IBinding)newObj,(IBinding)oldObj))       return false;
    }
 else {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @return
 * @throws DataException 
 */
private static boolean isCompatibleRSMap(Map oldMap,Map newMap) throws DataException {
  if (oldMap == null)   return newMap.size() == 0;
 else   if (newMap == null)   return oldMap.size() == 0;
  if (newMap.size() > oldMap.size())   return false;
  Iterator it=newMap.keySet().iterator();
  while (it.hasNext()) {
    Object key=it.next();
    Object oldObj=oldMap.get(key);
    Object newObj=newMap.get(key);
    if (oldObj != null) {
      if (!QueryCompUtil.isTwoBindingEqual((IBinding)newObj,(IBinding)oldObj))       return false;
    }
 else {
      return false;
    }
  }
  return true;
}
Program: 73883
Project: 73883
Buggy source:
/** 
 * @param queryDefn
 * @param context
 */
public DummyPreparedQuery(IQueryDefinition queryDefn,String tempDir){
  this.queryDefn=queryDefn;
  this.tempDir=tempDir;
}

Fixed version (ground truth):
public DummyPreparedQuery(IQueryDefinition queryDefn,String tempDir,DataEngineContext context){
  this(queryDefn,tempDir);
  this.context=context;
}
Program: 73884
Project: 73884
Buggy source:
/** 
 * @param oldSubQuery
 * @param newSubQuery
 * @return
 */
private static boolean isCompatibleSubQuery(IBaseQueryDefinition oldDefn,IBaseQueryDefinition newDefn){
  boolean isComp=QueryDefnUtil.isCompatibleSQs(oldDefn.getSubqueries(),newDefn.getSubqueries());
  if (isComp == false)   return false;
  Iterator oldIt=oldDefn.getGroups().iterator();
  Iterator newIt=newDefn.getGroups().iterator();
  while (newIt.hasNext()) {
    IGroupDefinition oldGroupDefn=(IGroupDefinition)oldIt.next();
    IGroupDefinition newGroupDefn=(IGroupDefinition)newIt.next();
    isComp=QueryDefnUtil.isCompatibleSQs(oldGroupDefn.getSubqueries(),newGroupDefn.getSubqueries());
    if (isComp == false)     return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @param oldSubQuery
 * @param newSubQuery
 * @return
 */
private static boolean isCompatibleSubQuery(IBaseQueryDefinition oldDefn,IBaseQueryDefinition newDefn){
  boolean isComp=QueryCompUtil.isCompatibleSQs(oldDefn.getSubqueries(),newDefn.getSubqueries());
  if (isComp == false)   return false;
  Iterator oldIt=oldDefn.getGroups().iterator();
  Iterator newIt=newDefn.getGroups().iterator();
  while (newIt.hasNext()) {
    IGroupDefinition oldGroupDefn=(IGroupDefinition)oldIt.next();
    IGroupDefinition newGroupDefn=(IGroupDefinition)newIt.next();
    isComp=QueryCompUtil.isCompatibleSQs(oldGroupDefn.getSubqueries(),newGroupDefn.getSubqueries());
    if (isComp == false)     return false;
  }
  return true;
}
Program: 73885
Project: 73885
Buggy source:
public IReportItemExecutor createPageExecutor(long pageNumber,MasterPageDesign pageDesign){
  IPageContent pageContent=(IPageContent)pages.get(pageDesign);
  if (pageContent == null) {
    IReportItemExecutor pageExecutor=new MasterPageExecutor(manager,pageNumber,pageDesign);
    pageContent=(IPageContent)pageExecutor.execute();
    IContentEmitter domEmitter=new DOMBuilderEmitter(pageContent);
    ReportExecutorUtil.executeAll(pageExecutor,domEmitter);
    pageExecutor.close();
    pages.put(pageDesign,pageContent);
  }
  return new DOMReportItemExecutor(pageContent,true);
}

Fixed version (ground truth):
public IReportItemExecutor createPageExecutor(long pageNumber,MasterPageDesign pageDesign){
  IPageContent pageContent=(IPageContent)pages.get(pageDesign);
  if (pageContent == null) {
    IReportItemExecutor pageExecutor=new MasterPageExecutor(manager,pageNumber,pageDesign);
    pageContent=(IPageContent)pageExecutor.execute();
    IContentEmitter domEmitter=new DOMBuilderEmitter(pageContent);
    ReportExecutorUtil.executeAll(pageExecutor,domEmitter);
    pageExecutor.close();
    pages.put(pageDesign,pageContent);
  }
 else {
    pageContent.setPageNumber(pageNumber);
  }
  return new DOMReportItemExecutor(pageContent,true);
}
Program: 73887
Project: 73887
Buggy source:
/** 
 * Handle event before doEndTag
 */
protected void __beforeEndTag(){
  pageContext.setAttribute(ATTR_ID + param.getId(),param.getId());
  pageContext.setAttribute(ATTR_PARAM + param.getName(),param.getName());
}

Fixed version (ground truth):
/** 
 * Handle event before doEndTag
 */
protected void __beforeEndTag(){
  pageContext.setAttribute(ATTR_ID + param.getId(),param.getId());
  if (this.requesterTag == null) {
    pageContext.setAttribute(ATTR_PARAM + param.getName(),param.getName());
  }
}
Program: 73888
Project: 73888
Buggy source:
/** 
 * validate the tag
 * @return
 * @throws Exception
 */
protected boolean __validate() throws Exception {
  if (!param.validate())   return false;
  Pattern p=Pattern.compile("String_Node_Str");
  Matcher m=p.matcher(param.getId());
  if (!m.find()) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_INVALID_ATTR_ID));
  }
  if (pageContext.findAttribute(ATTR_ID + param.getId()) != null) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_ATTR_ID_DUPLICATE));
  }
  if (pageContext.findAttribute(ATTR_PARAM + param.getName()) != null) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_PARAM_NAME_DUPLICATE));
  }
  return true;
}

Fixed version (ground truth):
/** 
 * validate the tag
 * @return
 * @throws Exception
 */
protected boolean __validate() throws Exception {
  if (!param.validate())   return false;
  Pattern p=Pattern.compile("String_Node_Str");
  Matcher m=p.matcher(param.getId());
  if (!m.find()) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_INVALID_ATTR_ID));
  }
  if (pageContext.findAttribute(ATTR_ID + param.getId()) != null) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_ATTR_ID_DUPLICATE));
  }
  if (this.requesterTag == null) {
    if (pageContext.findAttribute(ATTR_PARAM + param.getName()) != null) {
      throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_PARAM_NAME_DUPLICATE));
    }
  }
 else {
    if (this.requesterTag.getParameters().get(param.getName()) != null)     throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_PARAM_NAME_DUPLICATE));
  }
  return true;
}
Program: 73889
Project: 73889
Buggy source:
/** 
 * Compiles a Javascript expression to produce a subclass of CompileExpression, which contains the compiled form of the JS expression, after suitable replacement of aggregate functin occurrences in the expression. Aggregate function calls that appear in the expression are registered with the provided AggregateRegistry instance. <p> Aggregate registry can be null, in which case the provided expression is expected NOT to contain aggregates. If it does, a DteException is thrown.
 * @param expression Text of expression to compile
 * @param registry Registry for aggregate expressions. Can be null if expression is not expected to contain aggregates
 * @param context Rhino context associated with current thread
 * @return
 */
public CompiledExpression compile(String expression,AggregateRegistry registry,Context context){
  try {
    if (expression == null || expression.trim().length() == 0)     throw new DataException(ResourceConstants.EXPRESSION_CANNOT_BE_NULL_OR_BLANK);
    this.registry=registry;
    return super.compileExpression(expression,context);
  }
 catch (  Exception e) {
    DataException dataException=new DataException(ResourceConstants.INVALID_JS_EXPR,e,expression);
    return new InvalidExpression(dataException);
  }
}

Fixed version (ground truth):
/** 
 * Compiles a Javascript expression to produce a subclass of CompileExpression, which contains the compiled form of the JS expression, after suitable replacement of aggregate functin occurrences in the expression. Aggregate function calls that appear in the expression are registered with the provided AggregateRegistry instance. <p> Aggregate registry can be null, in which case the provided expression is expected NOT to contain aggregates. If it does, a DteException is thrown.
 * @param expression Text of expression to compile
 * @param registry Registry for aggregate expressions. Can be null if expression is not expected to contain aggregates
 * @param context Rhino context associated with current thread
 * @return
 */
public CompiledExpression compile(String expression,AggregateRegistry registry,Context context){
  try {
    if (expression == null || expression.trim().length() == 0)     throw new DataException(ResourceConstants.EXPRESSION_CANNOT_BE_NULL_OR_BLANK);
    this.registry=registry;
    return super.compileExpression(expression,context);
  }
 catch (  Exception e) {
    if (e instanceof DataException) {
      return new InvalidExpression((DataException)e);
    }
 else {
      DataException dataException=new DataException(ResourceConstants.INVALID_JS_EXPR,e,expression);
      return new InvalidExpression(dataException);
    }
  }
}
Program: 73890
Project: 73890
Buggy source:
/** 
 * @param expr
 * @return
 */
private static boolean flattenFilterExpression(CompiledExpression expr){
  int type=expr.getType();
switch (type) {
case CompiledExpression.TYPE_COMPLEX_EXPR:
{
      Iterator col=((ComplexExpression)expr).getSubExpressions().iterator();
      while (col.hasNext()) {
        if (!flattenFilterExpression((CompiledExpression)col.next()))         return false;
      }
      break;
    }
case CompiledExpression.TYPE_DIRECT_COL_REF:
{
    break;
  }
case CompiledExpression.TYPE_SINGLE_AGGREGATE:
{
  String aggName=((AggregateExpression)expr).getAggregation().getName();
  if (!isTopBottomN(aggName))   return false;
  break;
}
case CompiledExpression.TYPE_CONSTANT_EXPR:
case CompiledExpression.TYPE_INVALID_EXPR:
{
break;
}
}
return true;
}

Fixed version (ground truth):
/** 
 * @param expr
 * @return
 * @throws DataException 
 */
private static boolean flattenFilterExpression(CompiledExpression expr) throws DataException {
  int type=expr.getType();
switch (type) {
case CompiledExpression.TYPE_COMPLEX_EXPR:
{
      Iterator col=((ComplexExpression)expr).getSubExpressions().iterator();
      while (col.hasNext()) {
        if (!flattenFilterExpression((CompiledExpression)col.next()))         return false;
      }
      break;
    }
case CompiledExpression.TYPE_DIRECT_COL_REF:
{
    break;
  }
case CompiledExpression.TYPE_SINGLE_AGGREGATE:
{
  String aggName=((AggregateExpression)expr).getAggregation().getName();
  if (!isTopBottomN(aggName))   return false;
  break;
}
case CompiledExpression.TYPE_CONSTANT_EXPR:
{
break;
}
case CompiledExpression.TYPE_INVALID_EXPR:
{
throw (DataException)((InvalidExpression)expr).evaluate(null,null);
}
}
return true;
}
Program: 73891
Project: 73891
Buggy source:
/** 
 * Check whether filter in query contains aggregation. If aggregation is TOPN,BOTTOMN,TOPPERCENT,BOTTMEPERCENT return true. else return false;
 * @return
 */
public static boolean isValidExpressionInQueryFilter(IBaseExpression expression){
  if (expression instanceof IScriptExpression) {
    String text=((IScriptExpression)expression).getText();
    Context context=Context.enter();
    AggregateRegistry aggrReg=new AggregateRegistry(){
      public int register(      AggregateExpression aggregationExpr){
        return -1;
      }
    }
;
    try {
      ExpressionCompiler expressionCompiler=new ExpressionCompiler();
      CompiledExpression expr=expressionCompiler.compile(text,aggrReg,context);
      return flattenFilterExpression(expr);
    }
  finally {
      Context.exit();
    }
  }
 else   if (expression instanceof IConditionalExpression) {
    IScriptExpression expr=((IConditionalExpression)expression).getExpression();
    IBaseExpression oprand1=((IConditionalExpression)expression).getOperand1();
    IBaseExpression oprand2=((IConditionalExpression)expression).getOperand2();
    return isValidExpressionInQueryFilter(expr) && isValidExpressionInQueryFilter(oprand1) && isValidExpressionInQueryFilter(oprand2);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Check whether filter in query contains aggregation. If aggregation is TOPN,BOTTOMN,TOPPERCENT,BOTTMEPERCENT return true. else return false;
 * @return
 * @throws DataException 
 */
public static boolean isValidExpressionInQueryFilter(IBaseExpression expression) throws DataException {
  if (expression instanceof IScriptExpression) {
    String text=((IScriptExpression)expression).getText();
    Context context=Context.enter();
    AggregateRegistry aggrReg=new AggregateRegistry(){
      public int register(      AggregateExpression aggregationExpr){
        return -1;
      }
    }
;
    try {
      ExpressionCompiler expressionCompiler=new ExpressionCompiler();
      CompiledExpression expr=expressionCompiler.compile(text,aggrReg,context);
      return flattenFilterExpression(expr);
    }
  finally {
      Context.exit();
    }
  }
 else   if (expression instanceof IConditionalExpression) {
    IScriptExpression expr=((IConditionalExpression)expression).getExpression();
    IBaseExpression oprand1=((IConditionalExpression)expression).getOperand1();
    IBaseExpression oprand2=((IConditionalExpression)expression).getOperand2();
    return isValidExpressionInQueryFilter(expr) && isValidExpressionInQueryFilter(oprand1) && isValidExpressionInQueryFilter(oprand2);
  }
  return true;
}
Program: 73895
Project: 73895
Buggy source:
/** 
 * Log engine error message in problem view
 * @param request
 * @param errors
 */
public static void error(HttpServletRequest request,List errors){
  boolean isDesigner=ParameterAccessor.isDesigner(request);
  if (!isDesigner)   return;
  String systemId=getSystemId(request);
  if (systemId == null)   return;
  String isCleared=(String)request.getAttribute(VIEWER_MARKER_CLEARED);
  if (isCleared == null) {
    clearErrors(systemId);
    request.setAttribute(VIEWER_MARKER_CLEARED,"String_Node_Str");
  }
  if (errors == null || errors.size() <= 0)   return;
  Iterator it=errors.iterator();
  while (it.hasNext()) {
    Exception e=(Exception)it.next();
    if (e != null) {
      error(systemId,getDetailMessage(e),IBirtConstants.UNKNOWN_POSITION);
    }
  }
}

Fixed version (ground truth):
/** 
 * Log engine error message in problem view
 * @param request
 * @param moduleHandle
 * @param errors
 */
public static void error(HttpServletRequest request,List errors){
  String systemId=getSystemId(request);
  if (systemId == null)   return;
  String isCleared=(String)request.getAttribute(VIEWER_MARKER_CLEARED);
  if (isCleared == null) {
    clearErrors(systemId);
    request.setAttribute(VIEWER_MARKER_CLEARED,"String_Node_Str");
  }
  if (errors == null || errors.size() <= 0)   return;
  Iterator it=errors.iterator();
  while (it.hasNext()) {
    Exception e=(Exception)it.next();
    if (e != null) {
      int lineno=IBirtConstants.UNKNOWN_POSITION;
      long elementId=0;
      if (e instanceof EngineException) {
        try {
          Map options=getModuleOptions(request);
          options.put(IModuleOption.MARK_LINE_NUMBER_KEY,Boolean.TRUE);
          IReportRunnable reportRunnable=BirtUtility.getRunnableFromDesignFile(request,systemId,options);
          if (reportRunnable != null) {
            ModuleHandle moduleHandle=reportRunnable.getDesignHandle().getModuleHandle();
            elementId=((EngineException)e).getElementID();
            Object obj=moduleHandle.getElementByID(elementId);
            lineno=moduleHandle.getLineNo(obj);
          }
        }
 catch (        Exception err) {
        }
      }
      error(systemId,getDetailMessage(e),elementId,lineno);
    }
  }
}
Program: 73896
Project: 73896
Buggy source:
/** 
 * Returns if pagebreak pagination only
 * @param request
 * @return
 */
public static boolean isPagebreakOnly(HttpServletRequest request){
  String pagebreakOnly=getParameter(request,PARAM_PAGEBREAK_ONLY);
  if ("String_Node_Str".equalsIgnoreCase(pagebreakOnly))   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * Returns if pagebreak pagination only
 * @param request
 * @return
 */
public static boolean isPagebreakOnly(HttpServletRequest request){
  String pagebreakOnly=getParameter(request,PARAM_PAGEBREAK_ONLY);
  if ("String_Node_Str".equalsIgnoreCase(pagebreakOnly))   return false;
  return true;
}
Program: 73897
Project: 73897
Buggy source:
/** 
 * Returns if fit to page
 * @param request
 * @return
 */
public static boolean isFitToPage(HttpServletRequest request){
  String fitToPage=getParameter(request,PARAM_FIT_TO_PAGE);
  if ("String_Node_Str".equalsIgnoreCase(fitToPage))   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * Returns if fit to page
 * @param request
 * @return
 */
public static boolean isFitToPage(HttpServletRequest request){
  String fitToPage=getParameter(request,PARAM_FIT_TO_PAGE);
  if ("String_Node_Str".equalsIgnoreCase(fitToPage))   return false;
  return true;
}
Program: 73898
Project: 73898
Buggy source:
private void clearTempFile(){
  File tmpDir=new File(session.getTempDir());
  if (!tmpDir.exists() || !tmpDir.isDirectory()) {
    return;
  }
  File[] tmpFiles=tmpDir.listFiles();
  for (int i=0; i < tmpFiles.length; i++) {
    if (!tmpFiles[i].delete()) {
      tmpFiles[i].deleteOnExit();
    }
  }
  if (!tmpDir.delete()) {
    tmpDir.deleteOnExit();
  }
}

Fixed version (ground truth):
private void clearTempFile(){
  File tmpDir=new File(session.getTempDir());
  if (!tmpDir.exists() || !tmpDir.isDirectory()) {
    return;
  }
  File[] tmpFiles=tmpDir.listFiles();
  if (tmpFiles != null) {
    for (int i=0; i < tmpFiles.length; i++) {
      if (!tmpFiles[i].delete()) {
        tmpFiles[i].deleteOnExit();
      }
    }
  }
  if (!tmpDir.delete()) {
    tmpDir.deleteOnExit();
  }
}
Program: 73899
Project: 73899
Buggy source:
public List checkCompatibility(){
  List errorList=new ArrayList(1);
  if (checkVersion(handle.getExtensionVersion()) < 0) {
    try {
      handle.setExtensionVersion(CROSSTAB_CURRENT_VERSION);
    }
 catch (    SemanticException e) {
      errorList.add(e);
    }
    if (getHeader() == null) {
      PropertyHandle headerHandle=handle.getPropertyHandle(HEADER_PROP);
      if (headerHandle != null) {
        try {
          headerHandle.setValue(CrosstabExtendedItemFactory.createCrosstabCell(getModuleHandle()));
        }
 catch (        SemanticException e) {
          errorList.add(e);
        }
      }
    }
  }
  return errorList.size() == 0 ? Collections.EMPTY_LIST : errorList;
}

Fixed version (ground truth):
public CompatibilityStatus checkCompatibility(){
  compStatus=checkVersion(handle.getExtensionVersion());
  if (compStatus < 0) {
    CompatibilityStatus status=new CompatibilityStatus();
    List errorList=new ArrayList(2);
    status.setStatusType(CompatibilityStatus.CONVERT_COMPATIBILITY_TYPE);
    try {
      handle.setExtensionVersion(CROSSTAB_CURRENT_VERSION);
    }
 catch (    SemanticException e) {
      errorList.add(e);
    }
    if (getHeader() == null) {
      PropertyHandle headerHandle=handle.getPropertyHandle(HEADER_PROP);
      if (headerHandle != null) {
        try {
          headerHandle.setValue(CrosstabExtendedItemFactory.createCrosstabCell(getModuleHandle()));
        }
 catch (        SemanticException e) {
          errorList.add(e);
        }
      }
    }
    if (errorList.size() > 0) {
      status.setErrors(errorList);
    }
    return status;
  }
 else   if (compStatus > 0) {
    return new CompatibilityStatus(null,CompatibilityStatus.NOT_SUPPORTED_TYPE);
  }
  return COMP_OK_STATUS;
}
Program: 73900
Project: 73900
Buggy source:
public List checkCompatibility(){
{
    ExtendedItemHandle exhandle=(ExtendedItemHandle)getModelHandle();
    Map illegalContents=exhandle.getIllegalContents();
    if (illegalContents.containsKey(IMeasureViewConstants.DETAIL_PROP)) {
      List detailInfoList=(List)illegalContents.get(IMeasureViewConstants.DETAIL_PROP);
      if (detailInfoList.size() > 0) {
        IllegalContentInfo detailInfo=(IllegalContentInfo)detailInfoList.get(0);
        ExtendedItemHandle oldDetail=(ExtendedItemHandle)detailInfo.getContent();
        if (oldDetail != null) {
          try {
            ExtendedItemHandle newDetail=CrosstabExtendedItemFactory.createAggregationCell(getModuleHandle());
            handle.getPropertyHandle(DETAIL_PROP).setValue(newDetail);
            List contents=oldDetail.getContents(ICrosstabCellConstants.CONTENT_PROP);
            for (int i=0; i < contents.size(); i++) {
              ((DesignElementHandle)contents.get(i)).moveTo(newDetail,IAggregationCellConstants.CONTENT_PROP);
            }
          }
 catch (          SemanticException e) {
            List errorList=new ArrayList(1);
            errorList.add(e);
            return errorList;
          }
        }
      }
    }
  }
  return Collections.EMPTY_LIST;
}

Fixed version (ground truth):
public CompatibilityStatus checkCompatibility(){
  if (getCrosstab().compStatus < 0) {
    ExtendedItemHandle exhandle=(ExtendedItemHandle)getModelHandle();
    Map illegalContents=exhandle.getIllegalContents();
    if (illegalContents.containsKey(IMeasureViewConstants.DETAIL_PROP)) {
      List detailInfoList=(List)illegalContents.get(IMeasureViewConstants.DETAIL_PROP);
      if (detailInfoList.size() > 0) {
        IllegalContentInfo detailInfo=(IllegalContentInfo)detailInfoList.get(0);
        ExtendedItemHandle oldDetail=(ExtendedItemHandle)detailInfo.getContent();
        if (oldDetail != null) {
          CompatibilityStatus status=new CompatibilityStatus();
          try {
            status.setStatusType(CompatibilityStatus.CONVERT_COMPATIBILITY_TYPE);
            ExtendedItemHandle newDetail=CrosstabExtendedItemFactory.createAggregationCell(getModuleHandle());
            handle.getPropertyHandle(DETAIL_PROP).setValue(newDetail);
            List contents=oldDetail.getContents(ICrosstabCellConstants.CONTENT_PROP);
            for (int i=0; i < contents.size(); i++) {
              ((DesignElementHandle)contents.get(i)).moveTo(newDetail,IAggregationCellConstants.CONTENT_PROP);
            }
          }
 catch (          SemanticException e) {
            List errorList=new ArrayList(1);
            errorList.add(e);
            status.setErrors(errorList);
          }
          return status;
        }
      }
    }
  }
  return COMP_OK_STATUS;
}
Program: 73901
Project: 73901
Buggy source:
protected ReportElementHandle getReportElementHandle(ModuleHandle moduleHandle,IMarker marker){
  Integer elementId=new Integer(0);
  try {
    elementId=(Integer)marker.getAttribute(IDEMultiPageReportEditor.ELEMENT_ID);
  }
 catch (  CoreException e) {
    ExceptionHandler.handle(e);
  }
  if (elementId.intValue() > 0) {
    DesignElementHandle elementHandle=moduleHandle.getElementByID(elementId.intValue());
    if (elementHandle == null || !(elementHandle instanceof ReportElementHandle)) {
      return null;
    }
    if (elementHandle instanceof CellHandle || elementHandle instanceof ColumnHandle || elementHandle instanceof MasterPageHandle|| elementHandle instanceof ReportItemHandle|| elementHandle instanceof RowHandle|| elementHandle instanceof TemplateElementHandle) {
      return (ReportElementHandle)elementHandle;
    }
  }
  return null;
}

Fixed version (ground truth):
protected ReportElementHandle getReportElementHandle(ModuleHandle moduleHandle,IMarker marker){
  Integer elementId=new Integer(0);
  try {
    elementId=(Integer)marker.getAttribute(IDEMultiPageReportEditor.ELEMENT_ID);
  }
 catch (  CoreException e) {
    ExceptionHandler.handle(e);
  }
  if (elementId != null && elementId.intValue() > 0) {
    DesignElementHandle elementHandle=moduleHandle.getElementByID(elementId.intValue());
    if (elementHandle == null || !(elementHandle instanceof ReportElementHandle)) {
      return null;
    }
    if (elementHandle instanceof CellHandle || elementHandle instanceof ColumnHandle || elementHandle instanceof MasterPageHandle|| elementHandle instanceof ReportItemHandle|| elementHandle instanceof RowHandle|| elementHandle instanceof TemplateElementHandle) {
      return (ReportElementHandle)elementHandle;
    }
  }
  return null;
}
Program: 73902
Project: 73902
Buggy source:
public void gotoMarker(IMarker marker){
  Assert.isNotNull(editorPart);
  if (!marker.exists()) {
    return;
  }
  ModuleHandle moduleHandle=editorPart.getModel();
  ReportElementHandle reportElementHandle=getReportElementHandle(moduleHandle,marker);
  if (reportElementHandle == null || (reportElementHandle != null && isElementTemplateParameterDefinition(reportElementHandle))) {
    gotoXMLSourcePage(marker);
  }
 else {
    if (moduleHandle instanceof ReportDesignHandle) {
      if (isElementInMasterPage(reportElementHandle)) {
        gotoLayoutPage(ReportMasterPageEditorFormPage.ID,marker,reportElementHandle);
      }
 else {
        gotoLayoutPage(ReportLayoutEditorFormPage.ID,marker,reportElementHandle);
      }
    }
 else     if (moduleHandle instanceof LibraryHandle) {
      if (isElementInMasterPage(reportElementHandle)) {
        gotoLayoutPage(LibraryMasterPageEditorFormPage.ID,marker,reportElementHandle);
      }
 else {
        gotoLibraryLayoutPage(marker,reportElementHandle);
      }
    }
  }
}

Fixed version (ground truth):
public void gotoMarker(IMarker marker){
}
Program: 73903
Project: 73903
Buggy source:
public final int getDpiResolution(){
  if (iDpiResolution == 0) {
switch (getGraphicsContext().getDeviceConfiguration().getDevice().getType()) {
case GraphicsDevice.TYPE_RASTER_SCREEN:
      iDpiResolution=computeScreenDpi();
    break;
case GraphicsDevice.TYPE_PRINTER:
  iDpiResolution=72;
break;
case GraphicsDevice.TYPE_IMAGE_BUFFER:
iDpiResolution=computeScreenDpi();
break;
}
if (iDpiResolution >= 192) {
_g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_ON);
}
 else {
_g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
}
}
return iDpiResolution;
}

Fixed version (ground truth):
public final int getDpiResolution(){
  if (iDpiResolution == 0) {
switch (getGraphicsContext().getDeviceConfiguration().getDevice().getType()) {
case GraphicsDevice.TYPE_RASTER_SCREEN:
      iDpiResolution=computeScreenDpi();
    break;
case GraphicsDevice.TYPE_PRINTER:
  iDpiResolution=72;
break;
case GraphicsDevice.TYPE_IMAGE_BUFFER:
if (userResolution == 0) {
iDpiResolution=computeScreenDpi();
}
 else {
iDpiResolution=userResolution;
}
break;
}
if (iDpiResolution >= 192) {
_g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_ON);
}
 else {
_g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
}
}
return iDpiResolution;
}
Program: 73904
Project: 73904
Buggy source:
/** 
 * Currently, don't support multiple GroupOnRowKeyCount
 * @throws Exception
 */
private void groupOnRowKeyCount(double intervalRange) throws Exception, IOException {
  String[] bindingNameGroup=new String[1];
  bindingNameGroup[0]="String_Node_Str";
  IBaseExpression[] bindingExprGroup=new IBaseExpression[1];
  bindingExprGroup[0]=new ScriptExpression("String_Node_Str");
  GroupDefinition[] groupDefn=new GroupDefinition[]{new GroupDefinition("String_Node_Str")};
  groupDefn[0].setKeyExpression("String_Node_Str");
  groupDefn[0].setInterval(IGroupDefinition.NO_INTERVAL);
  groupDefn[0].setIntervalRange(intervalRange);
  String[] bindingNameRow=new String[3];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  IBaseExpression[] bindingExprRow=new IBaseExpression[3];
  bindingExprRow[0]=new ScriptExpression("String_Node_Str");
  bindingExprRow[1]=new ScriptExpression("String_Node_Str");
  bindingExprRow[2]=new ScriptExpression("String_Node_Str");
  String[] columnStr=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  QueryDefinition qd=this.createQuery(bindingNameGroup,bindingExprGroup,groupDefn,null,null,null,null,null,null,bindingNameRow,bindingExprRow);
  String outputStr=getOutputStrForGroupTest(30,qd,groupDefn.length,bindingNameRow,columnStr);
  testPrint(outputStr);
  this.checkOutputFile();
}

Fixed version (ground truth):
/** 
 * Currently, don't support any other group within a rowKeyCountGroup. It's because data rows in a  rowKeyCountGroup may be not sorted according to the current group model
 * @throws Exception
 */
private void groupOnRowKeyCount(double intervalRange) throws Exception, IOException {
  String[] bindingNameGroup=new String[1];
  bindingNameGroup[0]="String_Node_Str";
  IBaseExpression[] bindingExprGroup=new IBaseExpression[1];
  bindingExprGroup[0]=new ScriptExpression("String_Node_Str");
  GroupDefinition[] groupDefn=new GroupDefinition[]{new GroupDefinition("String_Node_Str")};
  groupDefn[0].setKeyExpression("String_Node_Str");
  groupDefn[0].setInterval(IGroupDefinition.NO_INTERVAL);
  groupDefn[0].setIntervalRange(intervalRange);
  String[] bindingNameRow=new String[3];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  IBaseExpression[] bindingExprRow=new IBaseExpression[3];
  bindingExprRow[0]=new ScriptExpression("String_Node_Str");
  bindingExprRow[1]=new ScriptExpression("String_Node_Str");
  bindingExprRow[2]=new ScriptExpression("String_Node_Str");
  String[] columnStr=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  QueryDefinition qd=this.createQuery(bindingNameGroup,bindingExprGroup,groupDefn,null,null,null,null,null,null,bindingNameRow,bindingExprRow);
  String outputStr=getOutputStrForGroupTest(30,qd,groupDefn.length,bindingNameRow,columnStr);
  testPrint(outputStr);
  this.checkOutputFile();
}