nus-yam/ex-repair huggingface dataset:
Program: 66691
Project: 66691
Buggy source:
public IResultObject next() throws DataException {
  if (!this.populator.next())   return null;
  if (this.query.isSummaryQuery()) {
    this.populator.getDocumentIterator().getExprResultSet().getDataSetResultSet().next();
  }
  Object[] field=new Object[this.resultClass.getFieldCount()];
  IResultObject curr=this.populator.getDocumentIterator().getExprResultSet().getDataSetResultSet().getResultObject();
  if (curr == null) {
    return null;
  }
  for (int i=0; i < curr.getResultClass().getFieldCount(); i++) {
    field[i]=curr.getFieldValue(i + 1);
  }
  for (int i=curr.getResultClass().getFieldCount(); i < field.length; i++) {
    try {
      field[i]=this.populator.getDocumentIterator().getValue(this.originalBindingNames.get(i - curr.getResultClass().getFieldCount()));
    }
 catch (    BirtException e) {
      throw new DataException(ResourceConstants.INVALID_AGGREGATION_BINDING_FOR_PLS,this.originalBindingNames.get(i - curr.getResultClass().getFieldCount()));
    }
  }
  return new ResultObject(this.resultClass,field);
}

Fixed version (ground truth):
public IResultObject next() throws DataException {
  if (!this.populator.next())   return null;
  Object[] field=new Object[this.resultClass.getFieldCount()];
  IResultObject curr=this.populator.getDocumentIterator().getExprResultSet().getDataSetResultSet().getResultObject();
  if (curr == null) {
    return null;
  }
  for (int i=0; i < curr.getResultClass().getFieldCount(); i++) {
    field[i]=curr.getFieldValue(i + 1);
  }
  for (int i=curr.getResultClass().getFieldCount(); i < field.length; i++) {
    try {
      field[i]=this.populator.getDocumentIterator().getValue(this.originalBindingNames.get(i - curr.getResultClass().getFieldCount()));
    }
 catch (    BirtException e) {
      throw new DataException(ResourceConstants.INVALID_AGGREGATION_BINDING_FOR_PLS,this.originalBindingNames.get(i - curr.getResultClass().getFieldCount()));
    }
  }
  return new ResultObject(this.resultClass,field);
}
Program: 66692
Project: 66692
Buggy source:
protected Data addDataContent(IDataContent data){
  float height=getContentHeight(data);
  HyperlinkDef url=parseHyperLink(data);
  BookmarkDef bookmark=getBookmark(data);
  Data excelData=null;
  Object generateBy=data.getGenerateBy();
  IStyle style=data.getComputedStyle();
  DataFormatValue dataformat=style.getDataFormat();
  MapDesign map=null;
  if (generateBy instanceof DataItemDesign) {
    DataItemDesign design=(DataItemDesign)generateBy;
    map=design.getMap();
  }
  if (map != null && map.getRuleCount() > 0 && data.getLabelText() != null) {
    excelData=engine.addData(data.getText(),style,url,bookmark,height);
  }
 else {
    String locale=null;
    int type=ExcelUtil.getType(data.getValue());
    if (type == SheetData.STRING) {
      if (dataformat != null) {
        locale=dataformat.getStringLocale();
      }
      excelData=engine.addData(data.getText(),style,url,bookmark,locale,height);
    }
 else     if (type == Data.NUMBER) {
      if (dataformat != null) {
        locale=dataformat.getNumberLocale();
      }
      excelData=engine.addData(data.getValue(),style,url,bookmark,locale,height);
    }
 else {
      if (dataformat != null) {
        locale=dataformat.getDateTimeLocale();
      }
      excelData=engine.addDateTime(data,style,url,bookmark,locale,height);
    }
  }
  return excelData;
}

Fixed version (ground truth):
protected Data addDataContent(IDataContent data){
  float height=getContentHeight(data);
  HyperlinkDef url=parseHyperLink(data);
  BookmarkDef bookmark=getBookmark(data);
  Data excelData=null;
  Object generateBy=data.getGenerateBy();
  IStyle style=data.getComputedStyle();
  DataFormatValue dataformat=style.getDataFormat();
  MapDesign map=null;
  if (generateBy instanceof DataItemDesign) {
    DataItemDesign design=(DataItemDesign)generateBy;
    map=design.getMap();
  }
  if (map != null && map.getRuleCount() > 0 && data.getLabelText() != null) {
    excelData=engine.addData(data.getText(),style,url,bookmark,height);
  }
 else {
    String locale=null;
    int type=ExcelUtil.getType(data.getValue());
    if (type == SheetData.STRING) {
      if (dataformat != null) {
        locale=dataformat.getStringLocale();
      }
      String text=data.getValue() == null ? null : data.getText();
      excelData=engine.addData(text,style,url,bookmark,locale,height);
    }
 else     if (type == Data.NUMBER) {
      if (dataformat != null) {
        locale=dataformat.getNumberLocale();
      }
      excelData=engine.addData(data.getValue(),style,url,bookmark,locale,height);
    }
 else {
      if (dataformat != null) {
        locale=dataformat.getDateTimeLocale();
      }
      excelData=engine.addDateTime(data,style,url,bookmark,locale,height);
    }
  }
  return excelData;
}
Program: 66693
Project: 66693
Buggy source:
public IResultIterator getSecondaryIterator(ScriptContext context,String subQueryName) throws BirtException {
  CachedQueryResults rs=new CachedQueryResults(this.session,QuerySharingUtil.getSubQueryID(this.queryResults.getID(),subQueryName,this.rowIndex),this.queryResults.getPreparedQuery());
  if (!rs.existCachedFile()) {
    throw new DataException(ResourceConstants.NOT_SUPPORT_REPORT_ITEM_SUBQUERY);
  }
  return rs.getResultIterator();
}

Fixed version (ground truth):
public IResultIterator getSecondaryIterator(ScriptContext context,String subQueryName) throws BirtException {
  CachedQueryResults rs=new CachedQueryResults(this.session,QuerySharingUtil.getSubQueryID(this.queryResults.getID(),subQueryName,this.rowIndex),this.queryResults.getPreparedQuery(),this.appContext);
  if (!rs.existCachedFile()) {
    if (qsWithSubIterator == null) {
      String queryResultsId=null;
      try {
        queryResultsId=this.queryResults.getPreparedQuery().getReportQueryDefn().getQueryResultsID();
        ((QueryDefinition)(this.queryResults.getPreparedQuery().getReportQueryDefn())).setQueryResultsID(null);
        IPreparedQuery query=PreparedQueryUtil.newInstance((DataEngineImpl)this.session.getEngine(),this.queryResults.getPreparedQuery().getReportQueryDefn(),this.appContext);
        qsWithSubIterator=query.execute(null,this.session.getSharedScope());
        qsWithSubIterator.getResultIterator().moveTo(currRowIndex);
        ((QueryResults)qsWithSubIterator).setID(queryResultsId);
        return qsWithSubIterator.getResultIterator().getSecondaryIterator(context,subQueryName);
      }
  finally {
        ((QueryDefinition)(this.queryResults.getPreparedQuery().getReportQueryDefn())).setQueryResultsID(queryResultsId);
      }
    }
 else {
      qsWithSubIterator.getResultIterator().moveTo(currRowIndex);
      return qsWithSubIterator.getResultIterator().getSecondaryIterator(context,subQueryName);
    }
  }
  return rs.getResultIterator();
}
Program: 66694
Project: 66694
Buggy source:
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CacheResultIterator(DataEngineSession session,String tempDir,IQueryResults queryResults) throws DataException {
  Object[] params={tempDir,queryResults.getID()};
  logger.entering(CacheResultIterator.class.getName(),"String_Node_Str",params);
  this.columnValueMap=new HashMap();
  this.currRowIndex=-1;
  this.lastRowIndex=this.currRowIndex - 1;
  this.queryResults=queryResults;
  this.startingGroupLevel=0;
  this.endingGroupLevel=queryResults.getPreparedQuery().getReportQueryDefn().getGroups().size() + 1;
  this.session=session;
  try {
    createCacheInputStream(tempDir);
    resultClass=new ResultClass(this.metaInputStream,0);
    rowCount=IOUtil.readInt(rowInputStream);
    if (rowCount == -1)     rowCount=Integer.MAX_VALUE;
    int columnSize=IOUtil.readInt(rowInputStream);
    columnList=new ArrayList();
    for (int i=0; i < columnSize; i++) {
      columnList.add(IOUtil.readObject(rowInputStream,DataEngineSession.getCurrentClassLoader()));
    }
    logger.exiting(CacheResultIterator.class.getName(),"String_Node_Str");
  }
 catch (  FileNotFoundException e) {
    existCachedFile=false;
  }
catch (  IOException e) {
    throw new DataException(ResourceConstants.READ_CACHE_TEMPFILE_ERROR);
  }
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CacheResultIterator(DataEngineSession session,String tempDir,IQueryResults queryResults,Map appContext) throws DataException {
  Object[] params={tempDir,queryResults.getID()};
  logger.entering(CacheResultIterator.class.getName(),"String_Node_Str",params);
  this.columnValueMap=new HashMap();
  this.currRowIndex=-1;
  this.lastRowIndex=this.currRowIndex - 1;
  this.queryResults=queryResults;
  this.startingGroupLevel=0;
  this.endingGroupLevel=queryResults.getPreparedQuery().getReportQueryDefn().getGroups().size() + 1;
  this.session=session;
  this.appContext=appContext;
  try {
    createCacheInputStream(tempDir);
    resultClass=new ResultClass(this.metaInputStream,0);
    rowCount=IOUtil.readInt(rowInputStream);
    if (rowCount == -1)     rowCount=Integer.MAX_VALUE;
    int columnSize=IOUtil.readInt(rowInputStream);
    columnList=new ArrayList();
    for (int i=0; i < columnSize; i++) {
      columnList.add(IOUtil.readObject(rowInputStream,DataEngineSession.getCurrentClassLoader()));
    }
    logger.exiting(CacheResultIterator.class.getName(),"String_Node_Str");
  }
 catch (  FileNotFoundException e) {
    existCachedFile=false;
  }
catch (  IOException e) {
    throw new DataException(ResourceConstants.READ_CACHE_TEMPFILE_ERROR);
  }
}
Program: 66695
Project: 66695
Buggy source:
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CachedQueryResults(DataEngineSession session,String queryResultID,IPreparedQuery preparedQuery) throws DataException {
  this.session=session;
  String tempDir=session.getTempDir();
  Object[] params={tempDir,queryResultID};
  logger.entering(CachedQueryResults.class.getName(),"String_Node_Str",params);
  this.queryResultID=queryResultID;
  this.pQuery=preparedQuery;
  this.resultIterator=new CacheResultIterator(session,tempDir,this);
  this.existCachedFile=((CacheResultIterator)this.resultIterator).existCachedFile();
  logger.exiting(CachedQueryResults.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CachedQueryResults(DataEngineSession session,String queryResultID,IPreparedQuery preparedQuery,Map appContext) throws DataException {
  this.session=session;
  String tempDir=session.getTempDir();
  Object[] params={tempDir,queryResultID};
  logger.entering(CachedQueryResults.class.getName(),"String_Node_Str",params);
  this.queryResultID=queryResultID;
  this.pQuery=preparedQuery;
  this.resultIterator=new CacheResultIterator(session,tempDir,this,appContext);
  this.existCachedFile=((CacheResultIterator)this.resultIterator).existCachedFile();
  logger.exiting(CachedQueryResults.class.getName(),"String_Node_Str");
}
Program: 66696
Project: 66696
Buggy source:
public IQueryResults getQueryResults(String queryResultID) throws DataException {
  if (context.getMode() == DataEngineContext.MODE_PRESENTATION || (context.getMode() == DataEngineContext.MODE_UPDATE && context.getDocWriter() == null)) {
    return new QueryResults(this.session.getTempDir(),this.context,queryResultID);
  }
  if (context.getMode() == DataEngineContext.MODE_GENERATION || context.getMode() == DataEngineContext.DIRECT_PRESENTATION) {
    return new CachedQueryResults(session,queryResultID,null);
  }
  return null;
}

Fixed version (ground truth):
public IQueryResults getQueryResults(String queryResultID) throws DataException {
  if (context.getMode() == DataEngineContext.MODE_PRESENTATION || (context.getMode() == DataEngineContext.MODE_UPDATE && context.getDocWriter() == null)) {
    return new QueryResults(this.session.getTempDir(),this.context,queryResultID);
  }
  if (context.getMode() == DataEngineContext.MODE_GENERATION || context.getMode() == DataEngineContext.DIRECT_PRESENTATION) {
    return new CachedQueryResults(session,queryResultID,null,null);
  }
  return null;
}
Program: 66697
Project: 66697
Buggy source:
/** 
 * @param queryDefn
 * @param session
 * @param context
 * @param targetGroups
 */
public DummyPreparedQuery(IQueryDefinition queryDefn,DataEngineSession session,DataEngineContext context,List<IGroupInstanceInfo> targetGroups){
  this(queryDefn,session);
  this.context=context;
  this.targetGroups=targetGroups;
}

Fixed version (ground truth):
/** 
 * @param queryDefn
 * @param session
 * @param context
 * @param targetGroups
 */
public DummyPreparedQuery(IQueryDefinition queryDefn,DataEngineSession session,DataEngineContext context,List<IGroupInstanceInfo> targetGroups){
  this(queryDefn,session,new HashMap());
  this.context=context;
  this.targetGroups=targetGroups;
}
Program: 66698
Project: 66698
Buggy source:
public IQueryResults execute(IBaseQueryResults outerResults,Scriptable scope) throws DataException {
  try {
    if (context == null)     return new CachedQueryResults(session,this.queryDefn.getQueryResultsID(),this);
 else     return new QueryResults(this.tempDir,this.context,this.queryDefn.getQueryResultsID(),outerResults,this.targetGroups);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
public IQueryResults execute(IBaseQueryResults outerResults,Scriptable scope) throws DataException {
  try {
    if (context == null)     return new CachedQueryResults(session,this.queryDefn.getQueryResultsID(),this,this.appContext);
 else     return new QueryResults(this.tempDir,this.context,this.queryDefn.getQueryResultsID(),outerResults,this.targetGroups);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 66699
Project: 66699
Buggy source:
private void writeLetterSpacing(IStyle style){
  int letterSpacing=PropertyUtil.getDimensionValue(style.getProperty(StyleConstants.STYLE_LETTER_SPACING));
  writeAttrTag("String_Node_Str",WordUtil.parseSpacing(letterSpacing));
}

Fixed version (ground truth):
private void writeLetterSpacing(IStyle style){
  int letterSpacing=PropertyUtil.getDimensionValue(style.getProperty(StyleConstants.STYLE_LETTER_SPACING));
  writeAttrTag("String_Node_Str",WordUtil.milliPt2Twips(letterSpacing));
}
Program: 66700
Project: 66700
Buggy source:
/** 
 * If the cell properties is not set, then check the row properties and write those properties.
 * @param style this cell style
 */
private void writeCellProperties(IStyle style){
  if (style == null) {
    return;
  }
  writeBackgroundColor(style.getBackgroundColor());
  writeCellBorders(style);
  String verticalAlign=style.getVerticalAlign();
  if (verticalAlign != null) {
    writeAttrTag("String_Node_Str",WordUtil.parseVerticalAlign(verticalAlign));
  }
  String noWrap=CSSConstants.CSS_NOWRAP_VALUE.equalsIgnoreCase(style.getWhiteSpace()) ? "String_Node_Str" : "String_Node_Str";
  writeAttrTag("String_Node_Str",noWrap);
}

Fixed version (ground truth):
/** 
 * If the cell properties is not set, then check the row properties and write those properties.
 * @param style this cell style
 */
private void writeCellProperties(IStyle style){
  if (style == null) {
    return;
  }
  writeBackgroundColor(style.getBackgroundColor());
  writeCellBorders(style);
  writeCellPadding(style);
  String verticalAlign=style.getVerticalAlign();
  if (verticalAlign != null) {
    writeAttrTag("String_Node_Str",WordUtil.parseVerticalAlign(verticalAlign));
  }
  String noWrap=CSSConstants.CSS_NOWRAP_VALUE.equalsIgnoreCase(style.getWhiteSpace()) ? "String_Node_Str" : "String_Node_Str";
  writeAttrTag("String_Node_Str",noWrap);
}
Program: 66703
Project: 66703
Buggy source:
public IResultObject next() throws DataException {
  if (!this.populator.next())   return null;
  Object[] field=new Object[this.resultClass.getFieldCount()];
  IResultObject curr=this.populator.getDocumentIterator().getExprResultSet().getDataSetResultSet().getResultObject();
  if (curr == null) {
    return null;
  }
  for (int i=0; i < curr.getResultClass().getFieldCount(); i++) {
    field[i]=curr.getFieldValue(i + 1);
  }
  for (int i=curr.getResultClass().getFieldCount(); i < field.length; i++) {
    try {
      field[i]=this.populator.getDocumentIterator().getValue(this.originalBindingNames.get(i - curr.getResultClass().getFieldCount()));
    }
 catch (    BirtException e) {
      throw new DataException(ResourceConstants.INVALID_AGGREGATION_BINDING_FOR_PLS,this.originalBindingNames.get(i - curr.getResultClass().getFieldCount()));
    }
  }
  return new ResultObject(this.resultClass,field);
}

Fixed version (ground truth):
public IResultObject next() throws DataException {
  if (!this.populator.next())   return null;
  if (this.query.isSummaryQuery()) {
    this.populator.getDocumentIterator().getExprResultSet().getDataSetResultSet().next();
  }
  Object[] field=new Object[this.resultClass.getFieldCount()];
  IResultObject curr=this.populator.getDocumentIterator().getExprResultSet().getDataSetResultSet().getResultObject();
  if (curr == null) {
    return null;
  }
  for (int i=0; i < curr.getResultClass().getFieldCount(); i++) {
    field[i]=curr.getFieldValue(i + 1);
  }
  for (int i=curr.getResultClass().getFieldCount(); i < field.length; i++) {
    try {
      field[i]=this.populator.getDocumentIterator().getValue(this.originalBindingNames.get(i - curr.getResultClass().getFieldCount()));
    }
 catch (    BirtException e) {
      throw new DataException(ResourceConstants.INVALID_AGGREGATION_BINDING_FOR_PLS,this.originalBindingNames.get(i - curr.getResultClass().getFieldCount()));
    }
  }
  return new ResultObject(this.resultClass,field);
}
Program: 66706
Project: 66706
Buggy source:
public void compute(Bounds bo,Plot p,ISeriesRenderingHints isrh) throws ChartException {
  final SeriesRenderingHints srh=(SeriesRenderingHints)isrh;
  try {
    validateDataSetCount(isrh);
  }
 catch (  ChartException vex) {
    throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.GENERATION,vex);
  }
  try {
    dpha=srh.getDataPoints();
    double[] da=srh.asPrimitiveDoubleValues();
    if (dpha == null || da == null || dpha.length < 1 || da.length < 1) {
      throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.RENDERING,"String_Node_Str",org.eclipse.birt.chart.engine.extension.i18n.Messages.getResourceBundle(getRunTimeContext().getULocale()));
    }
    RadarSeries rsd=getFirstSeries();
    int psc=rsd.getPlotSteps().intValue();
    if (psc > 20) {
      psc=20;
    }
    if (psc < 1) {
      psc=1;
    }
    scaleCount=psc;
    double cvr=((ChartWithoutAxes)getModel()).getCoverage();
    if (cvr <= 0) {
      cvr=0.8;
    }
    percentReduce=1 - cvr;
    dSafeSpacing*=getDeviceScale();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.GENERATION,ex);
  }
}

Fixed version (ground truth):
public void compute(Bounds bo,Plot p,ISeriesRenderingHints isrh) throws ChartException {
  final SeriesRenderingHints srh=(SeriesRenderingHints)isrh;
  validateDataSetCount(isrh);
  dpha=srh.getDataPoints();
  double[] da=srh.asPrimitiveDoubleValues();
  if (dpha == null || da == null || dpha.length < 1 || da.length < 1) {
    throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.RENDERING,"String_Node_Str",org.eclipse.birt.chart.engine.extension.i18n.Messages.getResourceBundle(getRunTimeContext().getULocale()));
  }
  RadarSeries rsd=getFirstSeries();
  int psc=rsd.getPlotSteps().intValue();
  if (psc > 20) {
    psc=20;
  }
  if (psc < 1) {
    psc=1;
  }
  scaleCount=psc;
  double cvr=((ChartWithoutAxes)getModel()).getCoverage();
  if (cvr <= 0) {
    cvr=0.8;
  }
  percentReduce=1 - cvr;
  dSafeSpacing*=getDeviceScale();
}
Program: 66710
Project: 66710
Buggy source:
private void renderOvalBackgrounds(IDeviceRenderer idr,Location center,Series se,double magnitude){
  final OvalRenderEvent ore=((EventObjectCache)idr).getEventObject(StructureSource.createSeries(se),OvalRenderEvent.class);
  LineAttributes lia=null;
  LineAttributes wlia=((RadarSeries)se).getWebLineAttributes();
  if (wlia == null) {
    lia=LineAttributesImpl.create(ColorDefinitionImpl.GREY(),LineStyle.SOLID_LITERAL,1);
  }
 else {
    lia=wlia;
  }
  ore.setBackground(lia.getColor());
  ore.setOutline(lia);
  for (int sc=scaleCount; sc >= 1; sc--) {
    double spiderMag=magnitude * sc / scaleCount;
    ore.setBounds(goFactory.createBounds(center.getX() - spiderMag,center.getY() - spiderMag,spiderMag * 2,spiderMag * 2));
    Fill wPaletteEntry=null;
    Palette pa=sd.getSeriesPalette();
    int ps=pa.getEntries().size();
    int tscnt=getSeriesCount();
    int palcnt=ps + tscnt + sc;
    if (palcnt > ps)     palcnt=1;
    wPaletteEntry=FillUtil.getPaletteFill(pa.getEntries(),sc + 1);
    if (wPaletteEntry instanceof ColorDefinition) {
      RadarSeries rsd=getFirstSeries();
      if (rsd.isBackgroundOvalTransparent()) {
        wPaletteEntry=goFactory.translucent((ColorDefinition)wPaletteEntry);
      }
    }
    ore.setBackground(wPaletteEntry);
    try {
      idr.fillOval(ore);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private void renderOvalBackgrounds(IDeviceRenderer idr,Location center,Series se,double magnitude) throws ChartException {
  final OvalRenderEvent ore=((EventObjectCache)idr).getEventObject(StructureSource.createSeries(se),OvalRenderEvent.class);
  LineAttributes lia=null;
  LineAttributes wlia=((RadarSeries)se).getWebLineAttributes();
  if (wlia == null) {
    lia=LineAttributesImpl.create(ColorDefinitionImpl.GREY(),LineStyle.SOLID_LITERAL,1);
  }
 else {
    lia=wlia;
  }
  ore.setBackground(lia.getColor());
  ore.setOutline(lia);
  for (int sc=scaleCount; sc >= 1; sc--) {
    double spiderMag=magnitude * sc / scaleCount;
    ore.setBounds(goFactory.createBounds(center.getX() - spiderMag,center.getY() - spiderMag,spiderMag * 2,spiderMag * 2));
    Fill wPaletteEntry=null;
    Palette pa=sd.getSeriesPalette();
    int ps=pa.getEntries().size();
    int tscnt=getSeriesCount();
    int palcnt=ps + tscnt + sc;
    if (palcnt > ps)     palcnt=1;
    wPaletteEntry=FillUtil.getPaletteFill(pa.getEntries(),sc + 1);
    if (wPaletteEntry instanceof ColorDefinition) {
      RadarSeries rsd=getFirstSeries();
      if (rsd.isBackgroundOvalTransparent()) {
        wPaletteEntry=goFactory.translucent((ColorDefinition)wPaletteEntry);
      }
    }
    ore.setBackground(wPaletteEntry);
    idr.fillOval(ore);
  }
}
Program: 66712
Project: 66712
Buggy source:
/** 
 * @param appContext
 * @throws DataException
 */
private void configureDataSetCache(Scriptable outerScope,IQueryDefinition querySpec,Map appContext,Scriptable scope) throws DataException {
  if (querySpec == null)   return;
  String queryResultID=querySpec.getQueryResultsID();
  if (queryResultID != null)   return;
  if (dataSetDesign == null)   return;
  Collection parameterHints=null;
  IBaseDataSourceDesign dataSourceDesign=this.dataEngine.getDataSourceDesign(dataSetDesign.getDataSourceName());
  DataSourceRuntime dsRuntime=this.dataEngine.getDataSourceRuntime(dataSetDesign.getDataSourceName());
  if (dsRuntime != null) {
    DataSetRuntime dataSet=DataSetRuntime.newInstance(dataSetDesign,null,this.dataEngine.getSession());
    parameterHints=new ParameterUtil(outerScope,dataSet,this.queryDefn,scope,this.dataEngine.getSession().getEngineContext().getScriptContext()).resolveDataSetParameters(true);
  }
  getDataSetCacheManager().setDataSourceAndDataSet(dataSourceDesign,dataSetDesign,parameterHints,this.appContext);
}

Fixed version (ground truth):
/** 
 * @param appContext
 * @throws DataException
 */
private void configureDataSetCache(Scriptable outerScope,IQueryDefinition querySpec,Map appContext,Scriptable scope) throws DataException {
  if (querySpec == null)   return;
  String queryResultID=querySpec.getQueryResultsID();
  if (queryResultID != null)   return;
  if (dataSetDesign == null)   return;
  Collection parameterHints=null;
  IBaseDataSourceDesign dataSourceDesign=this.dataEngine.getDataSourceDesign(dataSetDesign.getDataSourceName());
  DataSourceRuntime dsRuntime=this.dataEngine.getDataSourceRuntime(dataSetDesign.getDataSourceName());
  if (dsRuntime != null) {
    DataSetRuntime dataSet=DataSetRuntime.newInstance(dataSetDesign,null,this.dataEngine.getSession());
    parameterHints=new ParameterUtil(outerScope,dataSet,this.queryDefn,scope,this.dataEngine.getSession().getEngineContext().getScriptContext()).resolveDataSetParameters(true);
  }
  getDataSetCacheManager().setDataSourceAndDataSet(dataSourceDesign,this.dataEngine.getDataSetDesign(dataSetDesign.getName()),parameterHints,this.appContext);
}
Program: 66713
Project: 66713
Buggy source:
private ICubeCursor createCursor(IBindingValueFetcher fetcher) throws DataException, IOException, OLAPException {
  ICubeCursor cursor;
  CubeQueryExecutor executor=new CubeQueryExecutor(this.outResults,cubeQueryDefinition,this.session,this.scope,this.context);
  executor.getFacttableBasedFilterHelpers().addAll(this.preparedQuery.getInternalFilters());
  IDocumentManager documentManager=getDocumentManager(executor);
  ICube cube=null;
  try {
    cube=loadCube(documentManager,executor);
  }
 catch (  Exception ex) {
    throw new DataException(ResourceConstants.FAIL_LOAD_CUBE,ex);
  }
  BirtCubeView bcv=new BirtCubeView(executor,cube,appContext,fetcher);
  CubeCursor cubeCursor=bcv.getCubeCursor(stopSign,cube);
  cube.close();
  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.cubeQueryDefinition,bcv));
  cursor=new CubeCursorImpl(outResults,cubeCursor,this.scope,session.getEngineContext().getScriptContext(),cubeQueryDefinition,bcv);
  return cursor;
}

Fixed version (ground truth):
private ICubeCursor createCursor(IBindingValueFetcher fetcher) throws DataException, IOException, OLAPException {
  ICubeCursor cursor;
  CubeQueryExecutor executor=new CubeQueryExecutor(this.outResults,cubeQueryDefinition,this.session,this.scope,this.context);
  executor.getFacttableBasedFilterHelpers().addAll(this.preparedQuery.getInternalFilters());
  IDocumentManager documentManager=getDocumentManager(executor);
  ICube cube=null;
  try {
    if (!isStandAloneQuery(cubeQueryDefinition,session.getEngineContext()))     cube=loadCube(documentManager,executor);
  }
 catch (  Exception ex) {
    throw new DataException(ResourceConstants.FAIL_LOAD_CUBE,ex);
  }
  BirtCubeView bcv=new BirtCubeView(executor,cube,appContext,fetcher);
  CubeCursor cubeCursor=bcv.getCubeCursor(stopSign,cube);
  if (cube != null)   cube.close();
  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.cubeQueryDefinition,bcv));
  cursor=new CubeCursorImpl(outResults,cubeCursor,this.scope,session.getEngineContext().getScriptContext(),cubeQueryDefinition,bcv);
  return cursor;
}
Program: 66714
Project: 66714
Buggy source:
/** 
 * @param view
 * @param cube
 * @param calculatedMember
 * @throws DataException
 */
static void validateCubeQueryDefinition(BirtCubeView view,ICube cube) throws DataException {
  if (view.getColumnEdgeView() == null && view.getRowEdgeView() == null) {
  }
  if (view.getColumnEdgeView() != null) {
    validateOnEdgeDefinition(cube,view.getColumnEdgeView());
  }
  if (view.getRowEdgeView() != null) {
    validateOnEdgeDefinition(cube,view.getRowEdgeView());
  }
}

Fixed version (ground truth):
/** 
 * @param view
 * @param cube
 * @param calculatedMember
 * @throws DataException
 */
static void validateCubeQueryDefinition(BirtCubeView view,ICube cube) throws DataException {
  if (cube == null)   return;
  if (view.getColumnEdgeView() == null && view.getRowEdgeView() == null) {
  }
  if (view.getColumnEdgeView() != null) {
    validateOnEdgeDefinition(cube,view.getColumnEdgeView());
  }
  if (view.getRowEdgeView() != null) {
    validateOnEdgeDefinition(cube,view.getRowEdgeView());
  }
}
Program: 66715
Project: 66715
Buggy source:
/** 
 * Expand the cell of the passed sheet data. Creates empty data entries to cover the given rowspan and updates the border accordingly.
 * @param sheetData sheet data
 * @param currentColumnIndex current column index
 * @param rowspan number of cells to which to expand the cell 
 */
private void spanWithEmptyData(SheetData sheetData,int currentColumnIndex,int rowspan){
  SheetData ref=sheetData;
  while (ref.isBlank()) {
    ref=((BlankData)ref).getData();
    if (ref == null) {
      return;
    }
  }
  int rowIndex=sheetData.getRowIndex();
  for (int p=1; p <= rowspan; p++) {
    Data blank=new Data();
    blank.setRowIndex(rowIndex + p);
    blank.setValue("String_Node_Str");
    blank.setStartX(ref.getStartX());
    blank.setEndX(ref.getEndX());
    int styleId=sheetData.getStyleId();
    if (styleId != -1) {
      StyleEntry refStyle=styleEngine.getStyle(styleId);
      StyleEntry blankCellStyle=new StyleEntry(refStyle);
      removeTopBorder(blankCellStyle);
      blank.setStyleId(styleEngine.getStyleId(blankCellStyle));
      if (refStyle.getProperty(StyleConstant.BORDER_BOTTOM_STYLE_PROP) != null) {
        StyleEntry refNewStyle=new StyleEntry(refStyle);
        removeBottomBorder(refNewStyle);
        sheetData.setStyleId(styleEngine.getStyleId(refNewStyle));
      }
    }
    currentCache.addData(currentColumnIndex,blank);
  }
}

Fixed version (ground truth):
/** 
 * Expand the cell of the passed sheet data. Creates empty data entries to cover the given rowspan and updates the border accordingly.
 * @param sheetData sheet data
 * @param currentColumnIndex current column index
 * @param rowspan number of cells to which to expand the cell 
 */
private void spanWithEmptyData(SheetData sheetData,int currentColumnIndex,int rowspan){
  SheetData ref=sheetData;
  while (ref.isBlank()) {
    ref=((BlankData)ref).getData();
    if (ref == null) {
      return;
    }
  }
  int rowIndex=sheetData.getRowIndex();
  for (int p=1; p <= rowspan; p++) {
    Data blank=createData();
    blank.setRowIndex(rowIndex + p);
    blank.setValue("String_Node_Str");
    blank.setStartX(ref.getStartX());
    blank.setEndX(ref.getEndX());
    int styleId=sheetData.getStyleId();
    if (styleId != -1) {
      StyleEntry refStyle=styleEngine.getStyle(styleId);
      StyleEntry blankCellStyle=new StyleEntry(refStyle);
      removeTopBorder(blankCellStyle);
      blank.setStyleId(styleEngine.getStyleId(blankCellStyle));
      if (refStyle.getProperty(StyleConstant.BORDER_BOTTOM_STYLE_PROP) != null) {
        StyleEntry refNewStyle=new StyleEntry(refStyle);
        removeBottomBorder(refNewStyle);
        sheetData.setStyleId(styleEngine.getStyleId(refNewStyle));
      }
    }
    currentCache.addData(currentColumnIndex,blank);
  }
}
Program: 66716
Project: 66716
Buggy source:
/** 
 * Get result set column name collection from column binding map
 * @param cacheRequestMap
 * @return
 * @throws DataException
 */
public static Set getRsColumnRequestMap(List<IBinding> cacheRequestMap) throws DataException {
  Set resultSetNameSet=new HashSet();
  if (cacheRequestMap != null) {
    Iterator<IBinding> iter=cacheRequestMap.iterator();
    List<String> dataSetColumnList=null;
    while (iter.hasNext()) {
      IBinding binding=iter.next();
      dataSetColumnList=binding == null ? null : ExpressionCompilerUtil.extractDataSetColumnExpression(binding.getExpression());
      if (dataSetColumnList != null) {
        resultSetNameSet.addAll(dataSetColumnList);
      }
    }
  }
  return resultSetNameSet;
}

Fixed version (ground truth):
/** 
 * Get result set column name collection from column binding map
 * @param cacheRequestMap
 * @return
 * @throws DataException
 */
public static Set getRsColumnRequestMap(List<IBinding> cacheRequestMap) throws DataException {
  Set resultSetNameSet=new HashSet();
  if (cacheRequestMap != null) {
    Iterator<IBinding> iter=cacheRequestMap.iterator();
    List<String> dataSetColumnList=null;
    while (iter.hasNext()) {
      IBinding binding=iter.next();
      dataSetColumnList=null;
      if (binding != null) {
        if (binding.getExpression() != null)         dataSetColumnList=ExpressionCompilerUtil.extractDataSetColumnExpression(binding.getExpression());
 else         dataSetColumnList=ExpressionCompilerUtil.extractDataSetColumnExpression(getArgumentExpression(binding));
      }
      if (dataSetColumnList != null) {
        resultSetNameSet.addAll(dataSetColumnList);
      }
    }
  }
  return resultSetNameSet;
}
Program: 66717
Project: 66717
Buggy source:
protected void createPage(){
  page=new Page(context.getContentWidth(),engine,maxCol,context.getSheetName());
  page.initalize();
  context.setPage(page);
}

Fixed version (ground truth):
protected void createPage(XlsContainer pageContainer){
  page=new Page(context.getContentWidth(),engine,maxCol,context.getSheetName(),pageContainer);
  page.initalize();
  context.setPage(page);
}
Program: 66718
Project: 66718
Buggy source:
private void newPage(){
  createPage();
  for (  XlsTable table : tables) {
    splitColumns(table.getColumnsInfo(),table.getParent().getSizeInfo());
  }
  resetContainers();
}

Fixed version (ground truth):
private void newPage(){
  createPage(containers.get(0));
  for (  XlsTable table : tables) {
    splitColumns(table.getColumnsInfo(),table.getParent().getSizeInfo());
  }
  resetContainers();
}
Program: 66719
Project: 66719
Buggy source:
public void complete(Page page){
  engine.applyContainerBottomStyle(containers.get(0),page);
  Iterator<SheetData[]> iterator=page.getRowIterator();
  while (iterator.hasNext()) {
    SheetData[] rowData=iterator.next();
    for (int j=0; j < rowData.length; j++) {
      SheetData data=rowData[j];
      if (data == null || data.isBlank()) {
        continue;
      }
      HyperlinkDef hyperLink=data.getHyperlinkDef();
      if (hyperLink != null) {
        if (hyperLink.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
          setLinkedBookmark(data,hyperLink);
        }
      }
    }
    page.calculateRowHeight(rowData,context.isRTL());
  }
}

Fixed version (ground truth):
public void complete(Page page){
  engine.applyContainerBottomStyle(page.getPageContainer(),page);
  Iterator<SheetData[]> iterator=page.getRowIterator();
  while (iterator.hasNext()) {
    SheetData[] rowData=iterator.next();
    for (int j=0; j < rowData.length; j++) {
      SheetData data=rowData[j];
      if (data == null || data.isBlank()) {
        continue;
      }
      HyperlinkDef hyperLink=data.getHyperlinkDef();
      if (hyperLink != null) {
        if (hyperLink.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
          setLinkedBookmark(data,hyperLink);
        }
      }
    }
    page.calculateRowHeight(rowData,context.isRTL());
  }
}
Program: 66722
Project: 66722
Buggy source:
public void cancel() throws OdaException {
  try {
    if (this.preStat != null)     this.preStat.cancel();
  }
 catch (  SQLException e) {
    throw new OdaException(e);
  }
}

Fixed version (ground truth):
public void cancel() throws OdaException {
  try {
    if (this.preStat != null) {
      System.out.println("String_Node_Str");
      this.preStat.cancel();
    }
  }
 catch (  SQLException e) {
    throw new OdaException(e);
  }
}
Program: 66723
Project: 66723
Buggy source:
public void close() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  try {
    if (preStat != null) {
      this.preStat.close();
    }
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPAREDSTATEMENT_CANNOT_CLOSE,e);
  }
  this.cachedResultMetaData=null;
  this.cachedResultSet=null;
}

Fixed version (ground truth):
public void close() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  try {
    if (preStat != null) {
      System.out.println("String_Node_Str");
      this.preStat.close();
    }
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPAREDSTATEMENT_CANNOT_CLOSE,e);
  }
  this.cachedResultMetaData=null;
  this.cachedResultSet=null;
}
Program: 66724
Project: 66724
Buggy source:
public boolean execute() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(preStat);
  try {
    if (maxrows >= 0 && !maxRowsUpToDate) {
      preStat.setMaxRows(maxrows);
      maxRowsUpToDate=true;
    }
    return preStat.execute();
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.QUERY_EXECUTE_FAIL,e);
  }
}

Fixed version (ground truth):
public boolean execute() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(preStat);
  try {
    if (maxrows >= 0 && !maxRowsUpToDate) {
      preStat.setMaxRows(maxrows);
      maxRowsUpToDate=true;
    }
    System.out.println("String_Node_Str");
    return preStat.execute();
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.QUERY_EXECUTE_FAIL,e);
  }
}
Program: 66725
Project: 66725
Buggy source:
public IResultSet executeQuery() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(preStat);
  if (this.cachedResultSet != null) {
    IResultSet ret=this.cachedResultSet;
    this.cachedResultSet=null;
    return ret;
  }
  try {
    if (maxrows >= 0 && !maxRowsUpToDate) {
      try {
        preStat.setMaxRows(maxrows);
      }
 catch (      SQLException e1) {
      }
      maxRowsUpToDate=true;
    }
    return new ResultSet(this.preStat.executeQuery());
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.RESULTSET_CANNOT_RETURN,e);
  }
}

Fixed version (ground truth):
public IResultSet executeQuery() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(preStat);
  if (this.cachedResultSet != null) {
    IResultSet ret=this.cachedResultSet;
    this.cachedResultSet=null;
    return ret;
  }
  try {
    if (maxrows >= 0 && !maxRowsUpToDate) {
      try {
        preStat.setMaxRows(maxrows);
      }
 catch (      SQLException e1) {
      }
      maxRowsUpToDate=true;
    }
    System.out.println("String_Node_Str");
    return new ResultSet(this.preStat.executeQuery());
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.RESULTSET_CANNOT_RETURN,e);
  }
}
Program: 66726
Project: 66726
Buggy source:
/** 
 * @param bindingName
 * @param bindings
 * @return
 * @throws DataException
 */
private static boolean isAggregationBinding(String bindingName,List bindings) throws DataException {
  for (int i=0; i < bindings.size(); i++) {
    IBinding binding=(IBinding)bindings.get(i);
    if (bindingName.equals(binding.getBindingName())) {
      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;
      }
    }
  }
  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;
      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: 66727
Project: 66727
Buggy source:
private void writeDataFormat(StyleEntry style){
  Integer type=(Integer)style.getProperty(StyleConstant.DATA_TYPE_PROP);
  if (type == null)   return;
  if (type == SheetData.DATE && style.getProperty(StyleConstant.DATE_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",style.getProperty(StyleConstant.DATE_FORMAT_PROP));
    writer.closeTag("String_Node_Str");
  }
 else   if (type == Data.NUMBER && style.getProperty(StyleConstant.NUMBER_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    NumberFormatValue numberFormat=(NumberFormatValue)style.getProperty(StyleConstant.NUMBER_FORMAT_PROP);
    String format=numberFormat.getFormat();
    writer.attribute("String_Node_Str",format);
    writer.closeTag("String_Node_Str");
  }
}

Fixed version (ground truth):
private void writeDataFormat(StyleEntry style){
  Integer type=(Integer)style.getProperty(StyleConstant.DATA_TYPE_PROP);
  if (type == null)   return;
  if (type == SheetData.DATE && style.getProperty(StyleConstant.DATE_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",style.getProperty(StyleConstant.DATE_FORMAT_PROP));
    writer.closeTag("String_Node_Str");
  }
 else   if (type == Data.NUMBER && style.getProperty(StyleConstant.NUMBER_FORMAT_PROP) != null) {
    NumberFormatValue numberFormat=(NumberFormatValue)style.getProperty(StyleConstant.NUMBER_FORMAT_PROP);
    String format=numberFormat.getFormat();
    if (format != null) {
      writer.openTag("String_Node_Str");
      writer.attribute("String_Node_Str",format);
      writer.closeTag("String_Node_Str");
    }
  }
}
Program: 66728
Project: 66728
Buggy source:
private IResultObject getConvertedResultObject(IResultObject resultObject) throws DataException {
  if (resultObject == null)   return null;
  if (columnIndexListForTypeConvert == null)   return resultObject;
  Object[] obj=new Object[resultClass.getFieldCount()];
  for (int i=1; i <= resultClass.getFieldCount(); i++) {
    if (columnIndexListForTypeConvert.contains(i)) {
      try {
        obj[i - 1]=DataTypeUtil.convert(resultObject.getFieldValue(i),DataTypeUtil.toApiDataType(resultClass.getFieldMetaData(i).getDataType()));
      }
 catch (      BirtException e) {
        throw DataException.wrap(e);
      }
    }
 else {
      obj[i - 1]=resultObject.getFieldValue(i);
    }
  }
  IResultObject result=new ResultObject(resultObject.getResultClass(),obj);
  return result;
}

Fixed version (ground truth):
private IResultObject getConvertedResultObject(IResultObject resultObject) throws DataException {
  if (resultObject == null)   return null;
  if (columnIndexListForTypeConvert == null)   return resultObject;
  Object[] obj=new Object[resultClass.getFieldCount()];
  for (int i=1; i <= resultClass.getFieldCount(); i++) {
    if (columnIndexListForTypeConvert.contains(i)) {
      try {
        obj[i - 1]=DataTypeUtil.convert(resultObject.getFieldValue(i),DataTypeUtil.toApiDataType(resultClass.getFieldMetaData(i).getDataType()));
      }
 catch (      BirtException e) {
        throw DataException.wrap(e);
      }
    }
 else {
      obj[i - 1]=resultObject.getFieldValue(i);
    }
  }
  IResultObject result=new ResultObject(resultClass,obj);
  return result;
}
Program: 66729
Project: 66729
Buggy source:
public static float convertTextIndentToEM(String indent,float fontSize){
  DimensionType size=DimensionType.parserUnit(indent);
  float indentInPt=convertDimensionType(size,0,96) / 1000f;
  if (indentInPt != 0f) {
    return indentInPt / fontSize;
  }
  return 0f;
}

Fixed version (ground truth):
public static float convertTextIndentToEM(String indent,float fontSize){
  DimensionType size=DimensionType.parserUnit(indent);
  try {
    float indentInPt=convertDimensionType(size,0,96) / 1000f;
    if (indentInPt != 0f) {
      return indentInPt / fontSize;
    }
  }
 catch (  Exception ignored) {
  }
  return 0f;
}
Program: 66730
Project: 66730
Buggy source:
public void endPage(IPageContent pageContent) throws BirtException {
  IContent footer=pageContent.getPageFooter();
  if (!page.isOutputInMasterPage() && footer != null) {
    contentVisitor.visitChildren(footer,null);
  }
  Object pageLabelObj=context.getReportContext().getPageVariable(IReportContext.PAGE_VAR_PAGE_LABEL);
  if (pageLabelObj instanceof String) {
    String pageLabel=(String)pageLabelObj;
    pageLabel=ExcelUtil.getValidSheetName(pageLabel);
    page.setSheetName(pageLabel);
  }
  outputSheet(page);
  page=null;
}

Fixed version (ground truth):
public void endPage(IPageContent pageContent) throws BirtException {
  IContent footer=pageContent.getPageFooter();
  if (!page.isOutputInMasterPage() && footer != null) {
    contentVisitor.visitChildren(footer,null);
  }
  Object pageLabelObj=context.getReportContext().getPageVariable(IReportContext.PAGE_VAR_PAGE_LABEL);
  if (pageLabelObj instanceof String) {
    String pageLabel=(String)pageLabelObj;
    pageLabel=ExcelUtil.getValidSheetName(pageLabel);
    page.setSheetName(pageLabel);
  }
  outputSheet(page);
  containers.clear();
  page=null;
}
Program: 66731
Project: 66731
Buggy source:
private Set<Integer> getBetween(Object key1,Object key2) throws DataException {
  try {
    key1=DataTypeUtil.convert(key1,this.keyDataType);
    key2=DataTypeUtil.convert(key2,this.keyDataType);
  }
 catch (  BirtException e1) {
    throw DataException.wrap(e1);
  }
  BTreeCursor bCursor=btree.createCursor();
  Set<Integer> result=new HashSet<Integer>();
  try {
    if (!bCursor.first())     return result;
    if (((Comparable)bCursor.getKey()).compareTo(key1) <= 0) {
      bCursor.moveTo(key1);
      if (((Comparable)bCursor.getKey()).compareTo(key2) > 0)       return result;
      if (((Comparable)bCursor.getKey()).compareTo(key1) >= 0)       result.addAll(bCursor.getValues());
    }
 else {
      bCursor.beforeFirst();
    }
    while (bCursor.next()) {
      if (((Comparable)bCursor.getKey()).compareTo(key2) > 0)       return result;
      result.addAll(bCursor.getValues());
    }
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
  return result;
}

Fixed version (ground truth):
private Set<Integer> getBetween(Object key1,Object key2) throws DataException {
  Object min, max;
  if (ScriptEvalUtil.compare(key1,key2) <= 0) {
    min=key1;
    max=key2;
  }
 else {
    min=key2;
    max=key1;
  }
  try {
    min=DataTypeUtil.convert(min,this.keyDataType);
    max=DataTypeUtil.convert(max,this.keyDataType);
  }
 catch (  BirtException e1) {
    throw DataException.wrap(e1);
  }
  BTreeCursor bCursor=btree.createCursor();
  Set<Integer> result=new HashSet<Integer>();
  try {
    if (!bCursor.first())     return result;
    if (ScriptEvalUtil.compare(bCursor.getKey(),min) <= 0) {
      bCursor.moveTo(min);
      if (((Comparable)bCursor.getKey()).compareTo(max) > 0)       return result;
      if (((Comparable)bCursor.getKey()).compareTo(min) >= 0)       result.addAll(bCursor.getValues());
    }
 else {
      bCursor.beforeFirst();
    }
    while (bCursor.next()) {
      if (((Comparable)bCursor.getKey()).compareTo(max) > 0)       return result;
      result.addAll(bCursor.getValues());
    }
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
  return result;
}