nus-yam/ex-repair huggingface dataset:
Program: 68854
Project: 68854
Buggy source:
protected boolean performEdit(ReportElementHandle handle){
  DataSetHandle dsHandle=(DataSetHandle)handle;
  if (!(dsHandle instanceof JointDataSetHandle || dsHandle instanceof DerivedDataSetHandle) && dsHandle.getDataSource() == null) {
    try {
      List dataSourceList=DEUtil.getDataSources();
      String[] names=new String[dataSourceList.size()];
      for (int i=0; i < names.length; i++) {
        names[i]=((DataSourceHandle)dataSourceList.get(i)).getName();
      }
      DataSourceSelectionDialog dataSorucedialog=new DataSourceSelectionDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"),names);
      if (dataSorucedialog.open() == Dialog.CANCEL)       return false;
      dsHandle.setDataSource(dataSorucedialog.getResult().toString());
    }
 catch (    SemanticException e) {
    }
  }
  DataSetEditor dialog=new DataSetEditor(PlatformUI.getWorkbench().getDisplay().getActiveShell(),(DataSetHandle)handle,false);
  return dialog.open() == Dialog.OK;
}

Fixed version (ground truth):
protected boolean performEdit(ReportElementHandle handle){
  DataSetHandle dsHandle=(DataSetHandle)handle;
  if (!(dsHandle instanceof JointDataSetHandle || dsHandle instanceof DerivedDataSetHandle) && dsHandle.getDataSource() == null) {
    try {
      List dataSourceList=DEUtil.getDataSources();
      String[] names=new String[dataSourceList.size()];
      for (int i=0; i < names.length; i++) {
        names[i]=((DataSourceHandle)dataSourceList.get(i)).getName();
      }
      DataSourceSelectionDialog dataSorucedialog=new DataSourceSelectionDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"),names);
      if (dataSorucedialog.open() == Dialog.CANCEL)       return false;
      dsHandle.setDataSource(dataSorucedialog.getResult().toString());
    }
 catch (    SemanticException e) {
    }
  }
  DataSetEditor dialog=new AdvancedDataSetEditor(PlatformUI.getWorkbench().getDisplay().getActiveShell(),(DataSetHandle)handle,false);
  return dialog.open() == Dialog.OK;
}
Program: 68855
Project: 68855
Buggy source:
private JavascriptContext createJsContext(ScriptContext context){
  ScriptContext parent=context.getParent();
  Scriptable parentJsScope=global;
  if (parent != null) {
    JavascriptContext parentJsContext=(JavascriptContext)parent.getScriptContext(JavascriptEngineFactory.SCRIPT_JAVASCRIPT);
    if (parentJsContext == null) {
      parentJsContext=createJsContext(parent);
    }
    parentJsScope=parentJsContext.getScope();
  }
  Object scope=context.getScopeObject();
  Scriptable jsScope=createJsScope(parentJsScope,scope);
  JavascriptContext jsContext=new JavascriptContext(context,jsScope);
  if (parent == null) {
    this.context.evaluateString(jsScope,"String_Node_Str","String_Node_Str",1,null);
  }
  Map<String,Object> attrs=context.getAttributes();
  for (  Entry<String,Object> entry : attrs.entrySet()) {
    jsContext.setAttribute(entry.getKey(),entry.getValue());
  }
  context.setScriptContext(JavascriptEngineFactory.SCRIPT_JAVASCRIPT,jsContext);
  return jsContext;
}

Fixed version (ground truth):
private JavascriptContext createJsContext(ScriptContext context){
  ScriptContext parent=context.getParent();
  Scriptable parentJsScope=global;
  if (parent != null) {
    JavascriptContext parentJsContext=(JavascriptContext)parent.getScriptContext(JavascriptEngineFactory.SCRIPT_JAVASCRIPT);
    if (parentJsContext == null) {
      parentJsContext=createJsContext(parent);
    }
    parentJsScope=parentJsContext.getScope();
  }
  Object scope=context.getScopeObject();
  Scriptable jsScope=createJsScope(parentJsScope,scope);
  JavascriptContext jsContext=new JavascriptContext(context,jsScope);
  if (parent == null) {
    cachedScript.exec(this.context,jsScope);
  }
  Map<String,Object> attrs=context.getAttributes();
  for (  Entry<String,Object> entry : attrs.entrySet()) {
    jsContext.setAttribute(entry.getKey(),entry.getValue());
  }
  context.setScriptContext(JavascriptEngineFactory.SCRIPT_JAVASCRIPT,jsContext);
  return jsContext;
}
Program: 68856
Project: 68856
Buggy source:
protected boolean checkPageBreak() throws BirtException {
  boolean ret=false;
  if (!isInInlineStacking && context.isAutoPageBreak()) {
    int aHeight=getAllocatedHeight();
    while (aHeight + parent.getAbsoluteBP() > context.getMaxBP() + 3000) {
      parent.autoPageBreak();
      aHeight=getAllocatedHeight();
      ret=true;
    }
  }
  return ret;
}

Fixed version (ground truth):
protected boolean checkPageBreak() throws BirtException {
  boolean ret=false;
  if (!isInInlineStacking && context.isAutoPageBreak()) {
    int aHeight=getAllocatedHeight();
    while (aHeight + parent.getAbsoluteBP() - 3000 > context.getMaxBP()) {
      parent.autoPageBreak();
      aHeight=getAllocatedHeight();
      ret=true;
    }
  }
  return ret;
}
Program: 68857
Project: 68857
Buggy source:
public Object getObject(String arg0) throws OLAPException {
  if (this.resultSet == null || this.resultSet.getMeasureResult() == null)   return null;
  try {
    int id=this.view.getAggregationRegisterTable().getAggregationResultID(arg0);
    int index=this.view.getAggregationRegisterTable().getAggregationIndex(arg0);
    if (synchronizedWithEdge(id,arg0,getCurrentValueOnEdge(arg0)))     return this.resultSet.getMeasureResult()[id].getQueryResultSet().getAggregationValue(index);
 else {
      return null;
    }
  }
 catch (  IOException e) {
    throw new OLAPException(e.getLocalizedMessage());
  }
catch (  DataException e) {
    throw new OLAPException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public Object getObject(String arg0) throws OLAPException {
  if (this.resultSet == null || this.resultSet.getMeasureResult() == null)   return null;
  try {
    int id=this.view.getAggregationRegisterTable().getAggregationResultID(arg0);
    int index=this.view.getAggregationRegisterTable().getAggregationIndex(id,arg0);
    if (synchronizedWithEdge(id,arg0,getCurrentValueOnEdge(arg0)))     return this.resultSet.getMeasureResult()[id].getQueryResultSet().getAggregationValue(index);
 else {
      return null;
    }
  }
 catch (  IOException e) {
    throw new OLAPException(e.getLocalizedMessage());
  }
catch (  DataException e) {
    throw new OLAPException(e.getLocalizedMessage());
  }
}
Program: 68858
Project: 68858
Buggy source:
private static int compare(Object value1,Object value2){
  if (value1 == value2) {
    return 0;
  }
  if (value1 == null) {
    return -1;
  }
  if (value2 == null) {
    return 1;
  }
  if (value1 instanceof Comparable) {
    return ((Comparable)value1).compareTo(value2);
  }
  return value1.toString().compareTo(value2.toString());
}

Fixed version (ground truth):
static int compare(Object value1,Object value2){
  if (value1 == value2) {
    return 0;
  }
  if (value1 == null) {
    return -1;
  }
  if (value2 == null) {
    return 1;
  }
  if (value1 instanceof Comparable) {
    return ((Comparable)value1).compareTo(value2);
  }
  return value1.toString().compareTo(value2.toString());
}
Program: 68859
Project: 68859
Buggy source:
/** 
 * @param view
 * @param result
 * @param relationMap
 * @param manager
 */
public AggregationAccessor(BirtCubeView view,IResultSet result,Map relationMap){
  this.resultSet=result;
  this.view=view;
  this.relationMap=relationMap;
  if (result == null || result.getMeasureResult() == null)   return;
  this.currentPosition=new int[this.resultSet.getMeasureResult().length];
  for (int i=0; i < this.resultSet.getMeasureResult().length; i++) {
    try {
      if (this.resultSet.getMeasureResult()[i].getQueryResultSet().length() > 0) {
        this.resultSet.getMeasureResult()[i].getQueryResultSet().seek(0);
        currentPosition[i]=0;
      }
 else {
        currentPosition[i]=-1;
      }
    }
 catch (    IOException e) {
    }
  }
}

Fixed version (ground truth):
/** 
 * @param view
 * @param result
 * @param relationMap
 * @param manager
 */
public AggregationAccessor(BirtCubeView view,IResultSet result,Map relationMap){
  this.resultSet=result;
  this.view=view;
  this.relationMap=relationMap;
  if (result == null || result.getMeasureResult() == null)   return;
  this.currentPosition=new int[this.resultSet.getMeasureResult().length];
  for (int i=0; i < this.resultSet.getMeasureResult().length; i++) {
    try {
      if (this.resultSet.getMeasureResult()[i].getQueryResultSet().length() > 0) {
        this.resultSet.getMeasureResult()[i].getQueryResultSet().seek(0);
        currentPosition[i]=0;
      }
 else {
        currentPosition[i]=-1;
      }
    }
 catch (    IOException e) {
    }
  }
  initMeasureNavigator();
}
Program: 68860
Project: 68860
Buggy source:
/** 
 * @param arg0
 * @return
 * @throws OLAPException 
 */
public boolean edge_relative(int arg0) throws OLAPException {
  if (arg0 == 0)   return true;
  int position=this.edgeTraverse.currentPosition + arg0;
  if (position >= this.edgeDimensRelation.traverseLength) {
    this.edge_afterLast();
    return false;
  }
 else   if (position < 0) {
    this.dimTraverse.beforeFirst();
    this.edgeTraverse.currentPosition=-1;
    return false;
  }
 else {
    for (int i=0; i < Math.abs(arg0); i++) {
      if (arg0 > 0)       this.edge_next();
 else       this.edge_previous();
    }
    return true;
  }
}

Fixed version (ground truth):
/** 
 * @param arg0
 * @return
 * @throws OLAPException 
 */
public boolean edge_relative(int arg0) throws OLAPException {
  if (arg0 == 0)   return true;
  int position=this.edgeTraverse.currentPosition + arg0;
  if (position >= this.edgeDimensRelation.traverseLength) {
    this.edge_afterLast();
    return false;
  }
 else   if (position < 0) {
    this.dimTraverse.beforeFirst();
    this.edgeTraverse.currentPosition=-1;
    return false;
  }
 else {
    this.edgeTraverse.currentPosition=position;
    adjustDimensionPosition(position);
    return true;
  }
}
Program: 68862
Project: 68862
Buggy source:
public DefaultDataSetWizard(DataSourceHandle dataSourceHandle,boolean useTransaction){
  super();
  this.useTransaction=useTransaction;
  dataSetPage=new DataSetBasePage(useTransaction);
  dataSetPage.setNewDataSource(dataSourceHandle);
  setForcePreviousAndNextButtons(true);
  addPage(dataSetPage);
  columnDefPage=new ColumnDefPage();
  addPage(columnDefPage);
}

Fixed version (ground truth):
public DefaultDataSetWizard(DataSourceHandle dataSourceHandle,boolean useTransaction){
  super();
  this.useTransaction=useTransaction;
  dataSetPage=new DataSetBasePage(useTransaction);
  dataSetPage.setNewDataSource(dataSourceHandle);
  setForcePreviousAndNextButtons(true);
  addPage(dataSetPage);
  columnDefPage=new AdvancedColumnDefPage();
  addPage(columnDefPage);
}
Program: 68863
Project: 68863
Buggy source:
public void layout() throws BirtException {
  boolean isInline=parent instanceof InlineStackingArea;
  if (isInline) {
    if (parent instanceof LineArea) {
      InlineContainerArea inlineContainer=new InlineContainerArea(parent,context,content);
      inlineContainer.initialize();
      addTemplateArea(inlineContainer,true);
      inlineContainer.close();
    }
 else {
      addTemplateArea(parent,true);
    }
  }
 else {
    assert(parent instanceof BlockContainerArea);
    boolean inlineElement=PropertyUtil.isInlineElement(content);
    if (!inlineElement) {
      BlockTextArea t=new BlockTextArea(parent,context,content);
      t.initialize();
      LineArea line=new TextLineArea(t,context);
      line.initialize();
      addTemplateArea(line,false);
      line.close();
      close();
    }
  }
}

Fixed version (ground truth):
public void layout() throws BirtException {
  boolean isInline=parent instanceof InlineStackingArea;
  if (isInline) {
    if (parent instanceof LineArea) {
      InlineContainerArea inlineContainer=new InlineContainerArea(parent,context,content);
      inlineContainer.initialize();
      addTemplateArea(inlineContainer,true);
      inlineContainer.close();
    }
 else {
      addTemplateArea(parent,true);
    }
  }
 else {
    assert(parent instanceof BlockContainerArea);
    boolean inlineElement=PropertyUtil.isInlineElement(content);
    if (!inlineElement) {
      BlockTextArea t=new BlockTextArea(parent,context,content);
      t.initialize();
      LineArea line=new TextLineArea(t,context);
      line.initialize();
      addTemplateArea(line,false);
      line.close();
      t.close();
    }
  }
}
Program: 68864
Project: 68864
Buggy source:
private void doDelete(){
  int index=fListHyperlinks.getSelectionIndex();
  if (index < 0) {
    return;
  }
  URLValue value=fURLValuesMap.remove(fListHyperlinks.getItem(index));
  fMultiURLValues.getURLValues().remove(value);
  fListHyperlinks.remove(index);
}

Fixed version (ground truth):
private void doDelete(){
  int index=fListHyperlinks.getSelectionIndex();
  if (index < 0) {
    return;
  }
  URLValue value=fURLValuesMap.remove(fListHyperlinks.getItem(index));
  fMultiURLValues.getURLValues().remove(value);
  fListHyperlinks.remove(index);
  int last=fListHyperlinks.getItemCount() - 1;
  fListHyperlinks.select(index < last ? index : last);
}
Program: 68865
Project: 68865
Buggy source:
/** 
 * @param dataAttrs
 */
private void processDataElementAttributes(DataElementAttributes dataAttrs){
  if (dataAttrs == null)   return;
  String nativeName=dataAttrs.getName();
  String name=newParam.getName();
  if (StringUtil.isBlank(name) || !name.equalsIgnoreCase(nativeName)) {
    newParam.setName(nativeName);
  }
  newParam.setNativeName(nativeName);
  newParam.setPosition(new Integer(dataAttrs.getPosition()));
  Integer newPos=new Integer(0);
  Integer pos=newParam.getPosition();
  if (pos == null || pos.intValue() < 0)   newParam.setPosition(newPos);
  newParam.setNativeDataType(new Integer(dataAttrs.getNativeDataTypeCode()));
  String dataType=getROMDataType(dataSourceId,dataSetId,newParam,setDefinedParams.iterator());
  if (dataType == null || !DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equalsIgnoreCase(dataType))   newParam.setParameterDataType(dataType);
  ElementNullability nullability=dataAttrs.getNullability();
  processElementNullability(nullability);
}

Fixed version (ground truth):
/** 
 * @param dataAttrs
 */
private void processDataElementAttributes(DataElementAttributes dataAttrs){
  if (dataAttrs == null)   return;
  String nativeName=dataAttrs.getName();
  String name=newParam.getName();
  if (StringUtil.isBlank(name) || (!StringUtil.isBlank(nativeName) && !name.equalsIgnoreCase(nativeName))) {
    newParam.setName(nativeName);
  }
  newParam.setNativeName(nativeName);
  newParam.setPosition(new Integer(dataAttrs.getPosition()));
  Integer newPos=new Integer(0);
  Integer pos=newParam.getPosition();
  if (pos == null || pos.intValue() < 0)   newParam.setPosition(newPos);
  newParam.setNativeDataType(new Integer(dataAttrs.getNativeDataTypeCode()));
  String dataType=getROMDataType(dataSourceId,dataSetId,newParam,setDefinedParams.iterator());
  if (dataType == null || !DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equalsIgnoreCase(dataType))   newParam.setParameterDataType(dataType);
  ElementNullability nullability=dataAttrs.getNullability();
  processElementNullability(nullability);
}
Program: 68866
Project: 68866
Buggy source:
/** 
 */
List<IAmbiguousParameterNode> process(){
  DataSetParameters params=setDesign.getParameters();
  if (params == null)   return Collections.emptyList();
  List<IAmbiguousParameterNode> ambiguousParameters=new ArrayList<IAmbiguousParameterNode>(4);
  OdaDataSetParameterHandle existingParamHandle=null;
  List<ParameterDefinition> tmpParams=params.getParameterDefinitions();
  for (int i=0; i < tmpParams.size(); i++) {
    ambiguous=false;
    ParameterDefinition paramDefn=tmpParams.get(i);
    DataElementAttributes dataAttrs=paramDefn.getAttributes();
    if (dataAttrs != null) {
      existingParamHandle=findDataSetParameterByName(dataAttrs.getName(),new Integer(dataAttrs.getPosition()),new Integer(dataAttrs.getNativeDataTypeCode()),setDefinedParamIter);
    }
    if (ambiguous == false || existingParamHandle == null)     continue;
    DataSetParameterChecker oneChecker=new DataSetParameterChecker(paramDefn,existingParamHandle);
    IAmbiguousParameterNode node=new AmbiguousParameterNode(existingParamHandle,oneChecker.process());
    ambiguousParameters.add(node);
  }
  return ambiguousParameters;
}

Fixed version (ground truth):
/** 
 */
List<IAmbiguousParameterNode> process(){
  DataSetParameters params=setDesign.getParameters();
  if (params == null)   return Collections.emptyList();
  List<IAmbiguousParameterNode> ambiguousParameters=new ArrayList<IAmbiguousParameterNode>(4);
  OdaDataSetParameterHandle existingParamHandle=null;
  List<ParameterDefinition> tmpParams=params.getParameterDefinitions();
  for (int i=0; i < tmpParams.size(); i++) {
    ambiguous=false;
    ParameterDefinition paramDefn=tmpParams.get(i);
    DataElementAttributes dataAttrs=paramDefn.getAttributes();
    if (dataAttrs != null) {
      existingParamHandle=findDataSetParameterByName(dataAttrs.getName(),new Integer(dataAttrs.getPosition()),new Integer(dataAttrs.getNativeDataTypeCode()),setDefinedParamIter);
    }
    if (ambiguous == false || existingParamHandle == null)     continue;
    DataSetParameterChecker oneChecker=new DataSetParameterChecker(paramDefn,existingParamHandle);
    List<IAmbiguousAttribute> attrs=oneChecker.process();
    if (attrs == null || attrs.isEmpty())     continue;
    IAmbiguousParameterNode node=new AmbiguousParameterNode(existingParamHandle,attrs);
    ambiguousParameters.add(node);
  }
  return ambiguousParameters;
}
Program: 68867
Project: 68867
Buggy source:
public void visitCube(Cube obj){
  super.visitCube(obj);
  property(obj,ICubeModel.DEFAULT_MEASURE_GROUP_PROP);
  writeStructureList(obj,ICubeModel.FILTER_PROP);
  writeContents(obj,ICubeModel.DIMENSIONS_PROP);
  writeContents(obj,ICubeModel.MEASURE_GROUPS_PROP);
  writeContents(obj,ICubeModel.ACCESS_CONTROLS_PROP);
  writeOverridenPropertyValues(obj);
}

Fixed version (ground truth):
public void visitCube(Cube obj){
  super.visitCube(obj);
  property(obj,ICubeModel.DEFAULT_MEASURE_GROUP_PROP);
  writeStructureList(obj,ICubeModel.FILTER_PROP);
  writeContents(obj,ICubeModel.DIMENSIONS_PROP);
  writeContents(obj,ICubeModel.MEASURE_GROUPS_PROP);
  writeOverridenPropertyValues(obj);
}
Program: 68868
Project: 68868
Buggy source:
public void visitHierarchy(Hierarchy obj){
  super.visitHierarchy(obj);
  writeStructureList(obj,ICubeModel.FILTER_PROP);
  writeContents(obj,IHierarchyModel.LEVELS_PROP);
  writeContents(obj,ICubeModel.ACCESS_CONTROLS_PROP);
  writeOverridenPropertyValues(obj);
}

Fixed version (ground truth):
public void visitHierarchy(Hierarchy obj){
  super.visitHierarchy(obj);
  writeStructureList(obj,ICubeModel.FILTER_PROP);
  writeContents(obj,IHierarchyModel.LEVELS_PROP);
  writeOverridenPropertyValues(obj);
}
Program: 68870
Project: 68870
Buggy source:
public void end(IReportContent report){
  engine.cacheBookmarks(sheetIndex);
  engine.complete();
  try {
    writer.start(report,engine.getStyleMap(),engine.getAllBookmarks());
    outputCacheData();
    writer.end();
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
public void end(IReportContent report){
  engine.cacheBookmarks(sheetIndex);
  engine.complete(isAuto);
  try {
    writer.start(report,engine.getStyleMap(),engine.getAllBookmarks());
    outputCacheData();
    writer.end();
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage(),e);
  }
}
Program: 68871
Project: 68871
Buggy source:
public void startTable(ITableContent table){
  ContainerSizeInfo sizeInfo=engine.getCurrentContainer().getSizeInfo();
  int width=sizeInfo.getWidth();
  ColumnsInfo info=null;
  if (isAuto) {
    info=LayoutUtil.createTable(table,width);
  }
 else {
    int[] columns=LayoutUtil.createFixedTable(table,LayoutUtil.getElementWidth(table,width));
    info=new ColumnsInfo(columns);
  }
  if (info == null)   return;
  String caption=table.getCaption();
  if (caption != null) {
    engine.addCaption(caption,table.getComputedStyle());
  }
  engine.addTable(table,info,sizeInfo);
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  ContainerSizeInfo sizeInfo=engine.getCurrentContainer().getSizeInfo();
  int width=sizeInfo.getWidth();
  ColumnsInfo info=null;
  boolean isAutoTable=true;
  if (isAutoTable) {
    info=LayoutUtil.createTable(table,width);
  }
 else {
    int[] columns=LayoutUtil.createFixedTable(table,LayoutUtil.getElementWidth(table,width));
    info=new ColumnsInfo(columns);
  }
  if (info == null)   return;
  String caption=table.getCaption();
  if (caption != null) {
    engine.addCaption(caption,table.getComputedStyle());
  }
  engine.addTable(table,info,sizeInfo);
}
Program: 68872
Project: 68872
Buggy source:
public void start(IReportContent report){
  setupRenderOptions();
  String reportOrientation=report.getDesign().getReportDesign().getBidiOrientation();
  if ("String_Node_Str".equalsIgnoreCase(reportOrientation))   isRTLSheet=true;
  IStyle style=report.getRoot().getComputedStyle();
  SimpleMasterPageDesign master=(SimpleMasterPageDesign)report.getDesign().getPageSetup().getMasterPage(0);
  engine=createLayoutEngine(context,this);
  engine.initalize(new PageDef(master,style));
  String reportTitle=report.getDesign().getReportDesign().getStringProperty(IModuleModel.TITLE_PROP);
  if (reportTitle != null) {
    sheetName=reportTitle;
  }
 else {
    sheetName=DEFAULT_SHEET_NAME;
  }
  sheetName=ExcelUtil.getValidSheetName(sheetName);
  createWriter();
}

Fixed version (ground truth):
public void start(IReportContent report){
  setupRenderOptions();
  ReportDesignHandle designHandle=report.getDesign().getReportDesign();
  String reportOrientation=designHandle.getBidiOrientation();
  if ("String_Node_Str".equalsIgnoreCase(reportOrientation)) {
    isRTLSheet=true;
  }
  String reportLayoutPreference=designHandle.getLayoutPreference();
  if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(reportLayoutPreference)) {
    isAuto=false;
  }
  IStyle style=report.getRoot().getComputedStyle();
  SimpleMasterPageDesign master=(SimpleMasterPageDesign)report.getDesign().getPageSetup().getMasterPage(0);
  engine=createLayoutEngine(context,this);
  engine.initalize(new PageDef(master,style));
  String reportTitle=report.getDesign().getReportDesign().getStringProperty(IModuleModel.TITLE_PROP);
  if (reportTitle != null) {
    sheetName=reportTitle;
  }
 else {
    sheetName=DEFAULT_SHEET_NAME;
  }
  sheetName=ExcelUtil.getValidSheetName(sheetName);
  createWriter();
}
Program: 68873
Project: 68873
Buggy source:
public void outputSheet(){
  engine.cacheBookmarks(sheetIndex);
  engine.complete();
  try {
    outputCacheData();
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage(),e);
  }
  sheetIndex++;
}

Fixed version (ground truth):
public void outputSheet(){
  engine.cacheBookmarks(sheetIndex);
  engine.complete(isAuto);
  try {
    outputCacheData();
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage(),e);
  }
  sheetIndex++;
}
Program: 68874
Project: 68874
Buggy source:
private void calculateRowHeight(SheetData[] rowData){
  double rowHeight=0;
  int rowIndex=getRowIndex(rowData);
  double lastRowHeight=rowIndex > 0 ? cache.getRowHeight(rowIndex - 1) : 0;
  for (int i=0; i < rowData.length; i++) {
    SheetData data=rowData[i];
    if (data != null) {
      if (data.isBlank()) {
        BlankData blankData=(BlankData)data;
        if (blankData.getType() == Type.VERTICAL) {
          data.setHeight(data.getHeight() - lastRowHeight);
        }
      }
      SheetData realData=getRealData(data);
      if (realData != null) {
        int realDataRowEnd=realData.getRowIndex() + realData.getRowSpan();
        if (realDataRowEnd == data.getRowIndex()) {
          rowHeight=data.getHeight() > rowHeight ? data.getHeight() : rowHeight;
        }
      }
    }
  }
  cache.setRowHeight(rowIndex,rowHeight);
}

Fixed version (ground truth):
private void calculateRowHeight(SheetData[] rowData,boolean isAuto){
  double rowHeight=0;
  int rowIndex=getRowIndex(rowData);
  double lastRowHeight=rowIndex > 0 ? cache.getRowHeight(rowIndex - 1) : 0;
  boolean hasCurrentRowHeight=cache.hasRowHeight(rowIndex);
  if (!hasCurrentRowHeight || isAuto) {
    for (int i=0; i < rowData.length; i++) {
      SheetData data=rowData[i];
      if (data != null) {
        if (data.isBlank()) {
          BlankData blankData=(BlankData)data;
          if (blankData.getType() == Type.VERTICAL) {
            data.setHeight(data.getHeight() - lastRowHeight);
          }
        }
        SheetData realData=getRealData(data);
        if (realData != null) {
          int realDataRowEnd=realData.getRowIndex() + realData.getRowSpan();
          if (realDataRowEnd == data.getRowIndex()) {
            rowHeight=data.getHeight() > rowHeight ? data.getHeight() : rowHeight;
          }
        }
      }
    }
    cache.setRowHeight(rowIndex,rowHeight);
  }
}
Program: 68875
Project: 68875
Buggy source:
public void complete(){
  engine.applyContainerBottomStyle(containers.get(0));
  Iterator<SheetData[]> iterator=cache.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;
      }
      ContainerSizeInfo rule=data.getSizeInfo();
      int start=axis.getColumnIndexByCoordinate(rule.getStartCoordinate()) + 1;
      int end=axis.getColumnIndexByCoordinate(rule.getEndCoordinate()) + 1;
      end=Math.min(end,maxCol);
      int scount=Math.max(0,end - start - 1);
      Span span=new Span(start,scount);
      data.setSpan(span);
      HyperlinkDef hyperLink=data.getHyperlinkDef();
      if (hyperLink != null) {
        if (hyperLink.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
          setLinkedBookmark(data,hyperLink);
        }
      }
      int styleid=engine.getStyleID(data);
      data.setStyleId(styleid);
    }
    calculateRowHeight(rowData);
  }
}

Fixed version (ground truth):
public void complete(boolean isAuto){
  engine.applyContainerBottomStyle(containers.get(0));
  Iterator<SheetData[]> iterator=cache.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;
      }
      ContainerSizeInfo rule=data.getSizeInfo();
      int start=axis.getColumnIndexByCoordinate(rule.getStartCoordinate()) + 1;
      int end=axis.getColumnIndexByCoordinate(rule.getEndCoordinate()) + 1;
      end=Math.min(end,maxCol);
      int scount=Math.max(0,end - start - 1);
      Span span=new Span(start,scount);
      data.setSpan(span);
      HyperlinkDef hyperLink=data.getHyperlinkDef();
      if (hyperLink != null) {
        if (hyperLink.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
          setLinkedBookmark(data,hyperLink);
        }
      }
      int styleid=engine.getStyleID(data);
      data.setStyleId(styleid);
    }
    calculateRowHeight(rowData,isAuto);
  }
}
Program: 68876
Project: 68876
Buggy source:
public boolean isPageBreakInsideAvoid(){
  if (getTableArea().isGridDesign()) {
    return super.isPageBreakInsideAvoid();
  }
 else {
    if (content != null) {
      IStyle style=content.getStyle();
      String pb=style.getPageBreakInside();
      if (IStyle.CSS_AUTO_VALUE.equals(pb)) {
        return false;
      }
    }
    return true;
  }
}

Fixed version (ground truth):
public boolean isPageBreakInsideAvoid(){
  if (getTableArea().isGridDesign()) {
    return super.isPageBreakInsideAvoid();
  }
 else {
    if (IStyle.AVOID_VALUE == pageBreakInside) {
      return true;
    }
    if (content != null) {
      IStyle style=content.getStyle();
      String pb=style.getPageBreakInside();
      if (IStyle.CSS_AUTO_VALUE.equals(pb)) {
        return false;
      }
    }
    return true;
  }
}
Program: 68878
Project: 68878
Buggy source:
public Data(final Object value,final StyleEntry s,final int datatype,XlsContainer container,int rowSpanOfDesign){
  this.value=value;
  this.style=s;
  this.dataType=datatype;
  this.container=container;
  this.rowSpanInDesign=rowSpanOfDesign;
}

Fixed version (ground truth):
public Data(final Object value,final StyleEntry s,final int datatype,int rowSpanOfDesign){
  this.value=value;
  this.style=s;
  this.dataType=datatype;
  this.rowSpanInDesign=rowSpanOfDesign;
}
Program: 68879
Project: 68879
Buggy source:
public ImageData(IImageContent image,StyleEntry style,int datatype,Image imageInfo,XlsContainer currentContainer){
  super();
  this.style=style;
  this.dataType=datatype;
  height=ExcelUtil.convertImageSize(image.getHeight(),(int)(imageInfo.getHeight() * ExcelUtil.PX_PT));
  double imageWidth=ExcelUtil.convertImageSize(image.getWidth(),(int)(imageInfo.getWidth() * ExcelUtil.PX_PT));
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  container=currentContainer;
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}

Fixed version (ground truth):
public ImageData(IImageContent image,StyleEntry style,int datatype,Image imageInfo,XlsContainer currentContainer){
  super();
  this.style=style;
  this.dataType=datatype;
  height=ExcelUtil.convertImageSize(image.getHeight(),(int)(imageInfo.getHeight() * ExcelUtil.PX_PT));
  double imageWidth=ExcelUtil.convertImageSize(image.getWidth(),(int)(imageInfo.getWidth() * ExcelUtil.PX_PT));
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}
Program: 68880
Project: 68880
Buggy source:
private boolean isInContainer(SheetData data,XlsContainer rowContainer){
  XlsContainer container=data.getContainer();
  while (container != null) {
    if (container == rowContainer) {
      return true;
    }
    container=container.getParent();
  }
  return false;
}

Fixed version (ground truth):
private boolean isInContainer(SheetData data,XlsContainer rowContainer){
  return data.getRowIndex() >= rowContainer.getStartRowId();
}
Program: 68881
Project: 68881
Buggy source:
private Data createDateData(Object txt,StyleEntry entry,String timeFormat,String dlocale){
  ULocale dateLocale=getLocale(dlocale);
  timeFormat=ExcelUtil.parse(txt,timeFormat,dateLocale);
  timeFormat=DateTimeUtil.formatDateTime(timeFormat,dateLocale);
  entry.setProperty(StyleConstant.DATE_FORMAT_PROP,timeFormat);
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,SheetData.DATE);
  return createData(txt,entry,SheetData.DATE,getCurrentContainer());
}

Fixed version (ground truth):
private Data createDateData(Object txt,StyleEntry entry,String timeFormat,String dlocale){
  ULocale dateLocale=getLocale(dlocale);
  timeFormat=ExcelUtil.parse(txt,timeFormat,dateLocale);
  timeFormat=DateTimeUtil.formatDateTime(timeFormat,dateLocale);
  entry.setProperty(StyleConstant.DATE_FORMAT_PROP,timeFormat);
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,SheetData.DATE);
  return createData(txt,entry,SheetData.DATE);
}
Program: 68882
Project: 68882
Buggy source:
protected Data createData(Object text,StyleEntry s,int dataType,XlsContainer container,int rowSpanOfDesign){
  Data data=createData();
  data.setValue(text);
  data.setStyle(s);
  data.setDataType(dataType);
  data.setContainer(container);
  data.setRowSpanInDesign(rowSpanOfDesign);
  return data;
}

Fixed version (ground truth):
protected Data createData(Object text,StyleEntry s,int dataType,int rowSpanOfDesign){
  Data data=createData();
  data.setValue(text);
  data.setStyle(s);
  data.setDataType(dataType);
  data.setRowSpanInDesign(rowSpanOfDesign);
  return data;
}
Program: 68883
Project: 68883
Buggy source:
public void endNormalContainer(){
  XlsContainer container=getCurrentContainer();
  if (container.isEmpty()) {
    Data data=createData(EMPTY,container.getStyle(),Data.STRING,container);
    data.setSizeInfo(container.getSizeInfo());
    addData(data);
  }
  engine.applyContainerBottomStyle();
  containers.pop();
}

Fixed version (ground truth):
public void endNormalContainer(){
  XlsContainer container=getCurrentContainer();
  if (container.isEmpty()) {
    Data data=createData(EMPTY,container.getStyle(),Data.STRING);
    data.setSizeInfo(container.getSizeInfo());
    addData(data);
  }
  engine.applyContainerBottomStyle();
  containers.pop();
}
Program: 68884
Project: 68884
Buggy source:
protected void addEmptyData(SheetData data,XlsContainer container){
  int parentStartCoordinate=container.getSizeInfo().getStartCoordinate();
  int parentEndCoordinate=container.getSizeInfo().getEndCoordinate();
  int childStartCoordinate=data.getSizeInfo().getStartCoordinate();
  int childEndCoordinate=data.getSizeInfo().getEndCoordinate();
  if (childEndCoordinate < parentEndCoordinate) {
    StyleEntry style=container.getStyle();
    removeLeftBorder(style);
    int column=axis.getColumnIndexByCoordinate(childEndCoordinate);
    Data empty=createEmptyData(container,style);
    empty.setSizeInfo(new ContainerSizeInfo(childEndCoordinate,parentEndCoordinate - childEndCoordinate));
    empty.setRowIndex(data.getRowIndex());
    addDatatoCache(column,empty);
  }
  if (childStartCoordinate > parentStartCoordinate) {
    StyleEntry style=container.getStyle();
    removeRightBorder(style);
    int column=axis.getColumnIndexByCoordinate(childStartCoordinate);
    Data empty=createEmptyData(container,style);
    empty.setSizeInfo(new ContainerSizeInfo(childStartCoordinate,parentStartCoordinate - childStartCoordinate));
    empty.setRowIndex(data.getRowIndex());
    addDatatoCache(column,empty);
  }
}

Fixed version (ground truth):
protected void addEmptyData(SheetData data,XlsContainer container){
  int parentStartCoordinate=container.getSizeInfo().getStartCoordinate();
  int parentEndCoordinate=container.getSizeInfo().getEndCoordinate();
  int childStartCoordinate=data.getSizeInfo().getStartCoordinate();
  int childEndCoordinate=data.getSizeInfo().getEndCoordinate();
  if (childEndCoordinate < parentEndCoordinate) {
    StyleEntry style=container.getStyle();
    removeLeftBorder(style);
    int column=axis.getColumnIndexByCoordinate(childEndCoordinate);
    Data empty=createEmptyData(style);
    empty.setSizeInfo(new ContainerSizeInfo(childEndCoordinate,parentEndCoordinate - childEndCoordinate));
    empty.setRowIndex(data.getRowIndex());
    addDatatoCache(column,empty);
  }
  if (childStartCoordinate > parentStartCoordinate) {
    StyleEntry style=container.getStyle();
    removeRightBorder(style);
    int column=axis.getColumnIndexByCoordinate(childStartCoordinate);
    Data empty=createEmptyData(style);
    empty.setSizeInfo(new ContainerSizeInfo(childStartCoordinate,parentStartCoordinate - childStartCoordinate));
    empty.setRowIndex(data.getRowIndex());
    addDatatoCache(column,empty);
  }
}
Program: 68885
Project: 68885
Buggy source:
private void addEmptyDataToContainer(StyleEntry style,XlsContainer parent,int startCoordinate,int width){
  Data data=createEmptyData(parent,style);
  data.setSizeInfo(new ContainerSizeInfo(startCoordinate,width));
  addData(data);
}

Fixed version (ground truth):
private void addEmptyDataToContainer(StyleEntry style,XlsContainer parent,int startCoordinate,int width){
  Data data=createEmptyData(style);
  data.setSizeInfo(new ContainerSizeInfo(startCoordinate,width));
  addData(data);
}
Program: 68886
Project: 68886
Buggy source:
protected Data createEmptyData(XlsContainer container,StyleEntry style){
  return createData(EMPTY,style,Data.STRING,container);
}

Fixed version (ground truth):
protected Data createEmptyData(StyleEntry style){
  return createData(EMPTY,style,Data.STRING);
}
Program: 68889
Project: 68889
Buggy source:
/** 
 * Initializes the PPTEmitter.
 * @param services the emitter services object.
 * @throws EngineException 
 */
public void initialize(IEmitterServices services) throws EngineException {
  this.services=services;
  IReportRunnable reportRunnable=services.getReportRunnable();
  if (reportRunnable != null) {
    reportDesign=(ReportDesignHandle)reportRunnable.getDesignHandle();
  }
  this.context=services.getReportContext();
  this.pptOutput=EmitterUtil.getOuputStream(services,REPORT_FILE);
}

Fixed version (ground truth):
/** 
 * Initializes the PPTEmitter.
 * @param services the emitter services object.
 * @throws EngineException 
 */
public void initialize(IEmitterServices services) throws EngineException {
  this.services=services;
  reportRunnable=services.getReportRunnable();
  if (reportRunnable != null) {
    reportDesign=(ReportDesignHandle)reportRunnable.getDesignHandle();
  }
  this.context=services.getReportContext();
  this.pptOutput=EmitterUtil.getOuputStream(services,REPORT_FILE);
}
Program: 68890
Project: 68890
Buggy source:
public static int getImageWidth(IImageContent image,int width){
  DimensionType value=image.getWidth();
  if (value != null) {
    width=getElementWidth(value,width);
  }
 else {
    try {
      Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),image.getURI(),image.getMIMEType(),image.getExtension());
      width=(int)(imageInfo.getWidth() * ExcelUtil.PX_PT);
    }
 catch (    IOException e1) {
      log.log(Level.WARNING,e1.getLocalizedMessage());
    }
  }
  return width;
}

Fixed version (ground truth):
public static int getImageWidth(IImageContent image,int width){
  DimensionType value=image.getWidth();
  if (value != null) {
    width=getElementWidth(value,width);
  }
 else {
    try {
      Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),image.getURI(),image.getMIMEType(),image.getExtension());
      width=(int)(imageInfo.getWidth() * ExcelUtil.PX_PT * 1000);
    }
 catch (    IOException e1) {
      log.log(Level.WARNING,e1.getLocalizedMessage());
    }
  }
  return width;
}
Program: 68891
Project: 68891
Buggy source:
/** 
 * Find next available row position. If it has grouped-enabled, should ignore non-grouped/non-aggregation row.
 * @return
 * @throws BirtException
 */
protected boolean findNext() throws BirtException {
  while (fResultIterator.next()) {
    int startIndex=fResultIterator.getStartingGroupLevel();
    if (startIndex > 0 && startIndex <= fGroupCount) {
      if (faEnabledGroups[startIndex - 1]) {
        fCountOfAvaiableRows++;
        getGroupBreaksList(startIndex - 1).add(Integer.valueOf(fCountOfAvaiableRows));
        for (int i=startIndex; i < fGroupCount; i++) {
          getGroupBreaksList(i).add(Integer.valueOf(fCountOfAvaiableRows));
        }
        return true;
      }
    }
    if (!fHasSummaryAggregation) {
      fCountOfAvaiableRows++;
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Find next available row position. If it has grouped-enabled, should ignore non-grouped/non-aggregation row.
 * @return
 * @throws BirtException
 */
protected boolean findNext() throws BirtException {
  while (fResultIterator.next()) {
    int startIndex=fResultIterator.getStartingGroupLevel();
    if (startIndex > 0 && startIndex <= fGroupCount) {
      if (usedByChart(startIndex - 1,fGroupCount - 1)) {
        fCountOfAvaiableRows++;
        getGroupBreaksList(startIndex - 1).add(Integer.valueOf(fCountOfAvaiableRows));
        for (int i=startIndex; i < fGroupCount; i++) {
          getGroupBreaksList(i).add(Integer.valueOf(fCountOfAvaiableRows));
        }
        return true;
      }
    }
    if (!fHasSummaryAggregation) {
      fCountOfAvaiableRows++;
      return true;
    }
  }
  return false;
}
Program: 68893
Project: 68893
Buggy source:
public static boolean isHeritable(int id){
  if (id >= StyleConstant.BORDER_BOTTOM_COLOR_PROP && id <= StyleConstant.BORDER_RIGHT_WIDTH_PROP)   return false;
  return true;
}

Fixed version (ground truth):
public static boolean isHeritable(int id){
  if ((id >= StyleConstant.BORDER_BOTTOM_COLOR_PROP && id <= StyleConstant.BORDER_RIGHT_WIDTH_PROP) || (id >= StyleConstant.BORDER_DIAGONAL_COLOR_PROP && id <= StyleConstant.BORDER_ANTIDIAGONAL_WIDTH_PROP))   return false;
  return true;
}
Program: 68894
Project: 68894
Buggy source:
void setupStyle(StyledElementDesign design,StructureHandle highlight,IStyle style){
  Set<String> propertyNames=StyleUtil.ruleStyleName2Index.keySet();
  for (  String propertyName : propertyNames) {
    populateHighlightStyle(design,highlight,style,propertyName);
  }
}

Fixed version (ground truth):
void setupStyle(StyledElementDesign design,StructureHandle highlight,IStyle style){
  Set<String> propertyNames=StyleUtil.ruleStyleName2Index.keySet();
  for (  String propertyName : propertyNames) {
    populateHighlightStyle(design,highlight,style,propertyName);
  }
  createDataFormat(highlight,style);
}
Program: 68897
Project: 68897
Buggy source:
public void generatePageRowHints(Collection<String> keys){
  pageRangeUnresolvedRowHints.clear();
  Iterator<String> iter=keys.iterator();
  while (iter.hasNext()) {
    String key=iter.next();
    UnresolvedRowHint hint=docRangeUnresolvedRowHints.get(key);
    if (hint != null) {
      pageRangeUnresolvedRowHints.add(hint);
    }
  }
}

Fixed version (ground truth):
public void generatePageRowHints(Collection<String> keys){
  lastPageUnresolvedRowHints.clear();
  Iterator<String> iter=keys.iterator();
  while (iter.hasNext()) {
    String key=iter.next();
    UnresolvedRowHint hint=parallelPagesUnresolvedRowHints.get(key);
    if (hint != null) {
      lastPageUnresolvedRowHints.put(key,hint);
    }
  }
}
Program: 68898
Project: 68898
Buggy source:
public List<UnresolvedRowHint> getUnresolvedRowHints(){
  return pageRangeUnresolvedRowHints;
}

Fixed version (ground truth):
public HashMap<String,UnresolvedRowHint> getUnresolvedRowHints(){
  return lastPageUnresolvedRowHints;
}
Program: 68899
Project: 68899
Buggy source:
public UnresolvedRowHint getUnresolvedRowHint(String key){
  if (docRangeUnresolvedRowHints.size() > 0) {
    return docRangeUnresolvedRowHints.get(key);
  }
  return null;
}

Fixed version (ground truth):
public UnresolvedRowHint getUnresolvedRowHint(String key){
  if (parallelPagesUnresolvedRowHints.size() > 0) {
    return parallelPagesUnresolvedRowHints.get(key);
  }
  return null;
}
Program: 68900
Project: 68900
Buggy source:
public void setLayoutPageHint(IPageHint pageHint){
  if (pageHint != null) {
    context.pageNumber=pageHint.getPageNumber();
    context.masterPage=pageHint.getMasterPage();
    int count=pageHint.getTableColumnHintCount();
    for (int i=0; i < count; i++) {
      columnHints.add(pageHint.getTableColumnHint(i));
    }
    count=pageHint.getUnresolvedRowCount();
    if (count > 0) {
      for (int i=0; i < count; i++) {
        UnresolvedRowHint hint=pageHint.getUnresolvedRowHint(i);
        String key=getHintMapKey(hint.getTableId());
        docRangeUnresolvedRowHints.put(key,hint);
      }
    }
    for (int i=0; i < pageHint.getSectionCount(); i++) {
      PageSection section=pageHint.getSection(i);
      if (section instanceof SizeBasedPageSection) {
        SizeBasedPageSection sizeBasedSection=(SizeBasedPageSection)section;
        if (sizeBasedSection.start.dimension != -1) {
          InstanceID startID=sizeBasedSection.starts[sizeBasedSection.starts.length - 1].getInstanceID();
          if (startID != null) {
            sizeBasedContentMapping.put(startID.toUniqueString(),sizeBasedSection.start);
          }
        }
        if (sizeBasedSection.end.dimension != -1) {
          InstanceID endID=sizeBasedSection.ends[sizeBasedSection.ends.length - 1].getInstanceID();
          if (endID != null) {
            sizeBasedContentMapping.put(endID.toUniqueString(),sizeBasedSection.end);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void setLayoutPageHint(IPageHint pageHint){
  if (pageHint != null) {
    context.pageNumber=pageHint.getPageNumber();
    context.masterPage=pageHint.getMasterPage();
    int count=pageHint.getTableColumnHintCount();
    for (int i=0; i < count; i++) {
      columnHints.add(pageHint.getTableColumnHint(i));
    }
    count=pageHint.getUnresolvedRowCount();
    if (count > 0) {
      for (int i=0; i < count; i++) {
        UnresolvedRowHint hint=pageHint.getUnresolvedRowHint(i);
        String key=getHintMapKey(hint.getTableId());
        parallelPagesUnresolvedRowHints.put(key,hint);
      }
    }
    for (int i=0; i < pageHint.getSectionCount(); i++) {
      PageSection section=pageHint.getSection(i);
      if (section instanceof SizeBasedPageSection) {
        SizeBasedPageSection sizeBasedSection=(SizeBasedPageSection)section;
        if (sizeBasedSection.start.dimension != -1) {
          InstanceID startID=sizeBasedSection.starts[sizeBasedSection.starts.length - 1].getInstanceID();
          if (startID != null) {
            sizeBasedContentMapping.put(startID.toUniqueString(),sizeBasedSection.start);
          }
        }
        if (sizeBasedSection.end.dimension != -1) {
          InstanceID endID=sizeBasedSection.ends[sizeBasedSection.ends.length - 1].getInstanceID();
          if (endID != null) {
            sizeBasedContentMapping.put(endID.toUniqueString(),sizeBasedSection.end);
          }
        }
      }
    }
  }
}
Program: 68901
Project: 68901
Buggy source:
public void resetRowHint(){
  if (!context.emptyPage) {
    docRangeUnresolvedRowHints.clear();
    docRangeUnresolvedRowHints.putAll(currentPageUnresolvedRowHints);
    currentPageUnresolvedRowHints.clear();
  }
}

Fixed version (ground truth):
public void resetRowHint(){
  if (!context.emptyPage) {
    parallelPagesUnresolvedRowHints.clear();
    parallelPagesUnresolvedRowHints.putAll(currentPageUnresolvedRowHints);
    currentPageUnresolvedRowHints.clear();
  }
}
Program: 68902
Project: 68902
Buggy source:
protected void end(boolean finished) throws BirtException {
  if (emitter != null) {
    context.getPageBufferManager().endContainer(pageContent,finished,emitter,true);
    context.getBufferFactory().close();
  }
  context.getPageHintManager().resetRowHint();
  context.setEmptyPage(false);
}

Fixed version (ground truth):
protected void end(boolean finished) throws BirtException {
  if (!finished) {
    context.getPageHintManager().resetRowHint();
  }
  if (emitter != null) {
    context.getPageBufferManager().endContainer(pageContent,finished,emitter,true);
    context.getBufferFactory().close();
  }
  context.setEmptyPage(false);
}
Program: 68903
Project: 68903
Buggy source:
public void outputColumns(int[] width){
  writer.openTag("String_Node_Str");
  if (width == null) {
    return;
  }
  for (int i=0; i < width.length; i++) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",width[i] / 1000);
    writer.closeTag("String_Node_Str");
  }
}

Fixed version (ground truth):
public void outputColumns(int[] width){
  writer.openTag("String_Node_Str");
  if (width == null) {
    return;
  }
  for (int i=0; i < width.length; i++) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",width[i] / 1000);
    writer.attribute("String_Node_Str",0);
    writer.closeTag("String_Node_Str");
  }
}
Program: 68904
Project: 68904
Buggy source:
public void pageActivated(){
  getContainer().setMessage(Messages.getString("String_Node_Str"),IMessageProvider.NONE);
  initColumnNames();
  setPageProperties();
  viewer.getViewer().getTable().select(0);
}

Fixed version (ground truth):
public void pageActivated(){
  getContainer().setMessage(Messages.getString("String_Node_Str"),IMessageProvider.NONE);
  if (viewer != null && this.modelChanged) {
    initializeFilters();
    initColumnNames();
    setPageProperties();
    viewer.getViewer().setInput(filters);
    viewer.getViewer().getTable().select(0);
    modelChanged=false;
  }
}
Program: 68905
Project: 68905
Buggy source:
public void pageActivated(){
  getContainer().setMessage(Messages.getString("String_Node_Str"),IMessageProvider.NONE);
  if (viewer != null && this.modelChanged) {
    initializeFilters();
    initColumnNames();
    setPageProperties();
    viewer.getViewer().setInput(filters);
    viewer.getViewer().getTable().select(0);
    modelChanged=false;
  }
}

Fixed version (ground truth):
public void pageActivated(){
  getContainer().setMessage(Messages.getString("String_Node_Str"),IMessageProvider.NONE);
  initializeFilters();
  initColumnNames();
  setPageProperties();
  viewer.getViewer().setInput(filters);
  viewer.getViewer().getTable().select(0);
}