nus-yam/ex-repair huggingface dataset:
Program: 73821
Project: 73821
Buggy source:
/** 
 * Convert group unit type from Chart's to DtE's.
 * @param dataType
 * @param groupUnitType
 * @param intervalRange
 * @since BIRT 2.3
 */
public static int convertToDtEGroupUnit(DataType dataType,GroupingUnitType groupUnitType,double intervalRange){
  if (dataType == DataType.NUMERIC_LITERAL) {
    if (intervalRange == 0) {
      return IGroupDefinition.NO_INTERVAL;
    }
    return IGroupDefinition.NUMERIC_INTERVAL;
  }
 else   if (dataType == DataType.DATE_TIME_LITERAL) {
switch (groupUnitType.getValue()) {
case GroupingUnitType.SECONDS:
      return IGroupDefinition.SECOND_INTERVAL;
case GroupingUnitType.MINUTES:
    return IGroupDefinition.MINUTE_INTERVAL;
case GroupingUnitType.HOURS:
  return IGroupDefinition.HOUR_INTERVAL;
case GroupingUnitType.DAYS:
return IGroupDefinition.DAY_INTERVAL;
case GroupingUnitType.MONTHS:
return IGroupDefinition.MONTH_INTERVAL;
case GroupingUnitType.QUARTERS:
return IGroupDefinition.QUARTER_INTERVAL;
case GroupingUnitType.YEARS:
return IGroupDefinition.YEAR_INTERVAL;
}
}
 else if (dataType == DataType.TEXT_LITERAL) {
switch (groupUnitType.getValue()) {
case GroupingUnitType.STRING_PREFIX:
return IGroupDefinition.STRING_PREFIX_INTERVAL;
}
return IGroupDefinition.NO_INTERVAL;
}
return IGroupDefinition.NO_INTERVAL;
}

Fixed version (ground truth):
/** 
 * Convert group unit type from Chart's to DtE's.
 * @param dataType
 * @param groupUnitType
 * @param intervalRange
 * @since BIRT 2.3
 */
public static int convertToDtEGroupUnit(DataType dataType,GroupingUnitType groupUnitType,double intervalRange){
  if (dataType == DataType.NUMERIC_LITERAL) {
    if (intervalRange == 0) {
      return IGroupDefinition.NO_INTERVAL;
    }
    return IGroupDefinition.NUMERIC_INTERVAL;
  }
 else   if (dataType == DataType.DATE_TIME_LITERAL) {
switch (groupUnitType.getValue()) {
case GroupingUnitType.SECONDS:
      return IGroupDefinition.SECOND_INTERVAL;
case GroupingUnitType.MINUTES:
    return IGroupDefinition.MINUTE_INTERVAL;
case GroupingUnitType.HOURS:
  return IGroupDefinition.HOUR_INTERVAL;
case GroupingUnitType.DAYS:
return IGroupDefinition.DAY_INTERVAL;
case GroupingUnitType.WEEKS:
return IGroupDefinition.WEEK_INTERVAL;
case GroupingUnitType.MONTHS:
return IGroupDefinition.MONTH_INTERVAL;
case GroupingUnitType.QUARTERS:
return IGroupDefinition.QUARTER_INTERVAL;
case GroupingUnitType.YEARS:
return IGroupDefinition.YEAR_INTERVAL;
}
}
 else if (dataType == DataType.TEXT_LITERAL) {
switch (groupUnitType.getValue()) {
case GroupingUnitType.STRING_PREFIX:
return IGroupDefinition.STRING_PREFIX_INTERVAL;
}
return IGroupDefinition.NO_INTERVAL;
}
return IGroupDefinition.NO_INTERVAL;
}
Program: 73822
Project: 73822
Buggy source:
public IPreparedCubeQuery prepare(ICubeQueryDefinition query,Map appContext) throws BirtException {
  return new PreparedCubeQuery(query,this.session,this.context,appContext);
}

Fixed version (ground truth):
public IPreparedCubeQuery prepare(ICubeQueryDefinition query,Map appContext) throws BirtException {
  adaptCubeQueryDefinition(query);
  return new PreparedCubeQuery(query,this.session,this.context,appContext);
}
Program: 73824
Project: 73824
Buggy source:
protected Fragment loadPageHints(List pageSequence) throws IOException {
  if (pageSequence.size() == 1) {
    long[] pages=(long[])pageSequence.get(0);
    if (pages[0] == 1 && pages[1] == hintsReader.getTotalPage()) {
      return null;
    }
  }
  Fragment fragment=new Fragment(new InstanceIDComparator());
  PageRangeIterator iter=new PageRangeIterator(pageSequence);
  while (iter.hasNext()) {
    long pageNumber=iter.next();
    IPageHint pageHint=hintsReader.getPageHint(pageNumber);
    int sectCount=pageHint.getSectionCount();
    for (int i=0; i < sectCount; i++) {
      PageSection section=pageHint.getSection(i);
      InstanceIndex[] leftEdges=section.starts;
      InstanceIndex[] rightEdges=section.ends;
      fragment.addFragment(leftEdges,rightEdges);
    }
  }
  return fragment;
}

Fixed version (ground truth):
protected Fragment loadPageHints(List pageSequence) throws IOException {
  if (pageSequence.size() == 1) {
    if (context.getReportDocument().isComplete()) {
      long[] pages=(long[])pageSequence.get(0);
      if (pages[0] == 1 && pages[1] == hintsReader.getTotalPage()) {
        return null;
      }
    }
  }
  Fragment fragment=new Fragment(new InstanceIDComparator());
  PageRangeIterator iter=new PageRangeIterator(pageSequence);
  while (iter.hasNext()) {
    long pageNumber=iter.next();
    IPageHint pageHint=hintsReader.getPageHint(pageNumber);
    int sectCount=pageHint.getSectionCount();
    for (int i=0; i < sectCount; i++) {
      PageSection section=pageHint.getSection(i);
      InstanceIndex[] leftEdges=section.starts;
      InstanceIndex[] rightEdges=section.ends;
      fragment.addFragment(leftEdges,rightEdges);
    }
  }
  return fragment;
}
Program: 73827
Project: 73827
Buggy source:
/** 
 * @param queryDefn
 * @param paramBindingIt
 * @param filterIt
 * @param bindingIt
 * @throws AdapterException 
 */
private void populateQueryDefn(IQueryDefinition queryDefn,Iterator paramBindingIt,Iterator filterIt,Iterator bindingIt) throws AdapterException {
  try {
    while (bindingIt != null && bindingIt.hasNext()) {
      IComputedColumn column=this.modelAdaptor.adaptComputedColumn((ComputedColumnHandle)bindingIt.next());
      IBinding binding=new Binding(column.getName(),(ScriptExpression)column.getExpression());
      binding.setDataType(column.getDataType());
      queryDefn.addBinding(binding);
    }
    List parameterBindings=convertParamterBindings(paramBindingIt);
    if (parameterBindings != null)     queryDefn.getInputParamBindings().addAll(parameterBindings);
    List filters=convertFilters(filterIt);
    if (filters != null)     queryDefn.getFilters().addAll(filters);
  }
 catch (  DataException e) {
    throw new AdapterException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * @param queryDefn
 * @param paramBindingIt
 * @param filterIt
 * @param bindingIt
 * @throws AdapterException 
 */
private void populateQueryDefn(IQueryDefinition queryDefn,Iterator paramBindingIt,Iterator filterIt,Iterator bindingIt) throws AdapterException {
  try {
    while (bindingIt != null && bindingIt.hasNext()) {
      queryDefn.addBinding(this.modelAdaptor.adaptBinding((ComputedColumnHandle)bindingIt.next()));
    }
    List parameterBindings=convertParamterBindings(paramBindingIt);
    if (parameterBindings != null)     queryDefn.getInputParamBindings().addAll(parameterBindings);
    List filters=convertFilters(filterIt);
    if (filters != null)     queryDefn.getFilters().addAll(filters);
  }
 catch (  DataException e) {
    throw new AdapterException(e.getLocalizedMessage());
  }
}
Program: 73828
Project: 73828
Buggy source:
protected void linkReportElement(ReportElementDesign element){
  long id=element.getID();
  DesignElementHandle elementHandle=handle.getElementByID(id);
  element.setHandle(elementHandle);
  getScriptIDBack(element);
  report.setReportItemInstanceID(id,element);
}

Fixed version (ground truth):
protected void linkReportElement(ReportElementDesign element){
  long id=element.getID();
  DesignElementHandle elementHandle=handle.getElementByID(id);
  if (elementHandle instanceof ReportItemHandle) {
    DesignElementHandle currentView=((ReportItemHandle)elementHandle).getCurrentView();
    if (currentView != null) {
      elementHandle=currentView;
    }
  }
  element.setHandle(elementHandle);
  getScriptIDBack(element);
  report.setReportItemInstanceID(id,element);
}
Program: 73829
Project: 73829
Buggy source:
public ReportItemDesign findDesign(ReportElementHandle handle){
  ReportElementDesign elementDesign=getReportItemByID(handle.getID());
  if (elementDesign != null) {
    return (ReportItemDesign)elementDesign;
  }
 else {
    return new EngineIRVisitor(reportDesign).translate(handle,this);
  }
}

Fixed version (ground truth):
public ReportItemDesign findDesign(ReportElementHandle handle){
  ReportElementDesign elementDesign=getReportItemByID(handle.getID());
  if (elementDesign != null) {
    return (ReportItemDesign)elementDesign;
  }
 else {
    return new MultiViewEngineIRVisitor(reportDesign).translate(handle,this);
  }
}
Program: 73831
Project: 73831
Buggy source:
public void visitList(ListHandle handle){
  ListItemDesign listItem=new ListItemDesign();
  setupListingItem(listItem,handle);
  SlotHandle headerSlot=handle.getHeader();
  if (headerSlot.getCount() > 0) {
    ListBandDesign header=createListBand(headerSlot);
    header.setBandType(ListBandDesign.BAND_HEADER);
    listItem.setHeader(header);
    listItem.setRepeatHeader(handle.repeatHeader());
  }
  SlotHandle groupsSlot=handle.getGroups();
  for (int i=0; i < groupsSlot.getCount(); i++) {
    apply(groupsSlot.get(i));
    if (currentElement != null) {
      GroupDesign group=(GroupDesign)currentElement;
      group.setGroupLevel(i);
      listItem.addGroup(group);
    }
  }
  SlotHandle detailSlot=handle.getDetail();
  if (detailSlot.getCount() > 0) {
    ListBandDesign detail=createListBand(detailSlot);
    detail.setBandType(ListBandDesign.BAND_DETAIL);
    listItem.setDetail(detail);
  }
  SlotHandle footerSlot=handle.getFooter();
  if (footerSlot.getCount() > 0) {
    ListBandDesign footer=createListBand(footerSlot);
    footer.setBandType(ListBandDesign.BAND_FOOTER);
    listItem.setFooter(footer);
  }
  currentElement=listItem;
}

Fixed version (ground truth):
public void visitList(ListHandle handle){
  ListItemDesign listItem=new ListItemDesign();
  setupListingItem(listItem,handle);
  SlotHandle headerSlot=handle.getHeader();
  if (headerSlot.getCount() > 0) {
    ListBandDesign header=createListBand(headerSlot);
    header.setBandType(ListBandDesign.BAND_HEADER);
    listItem.setHeader(header);
    listItem.setRepeatHeader(handle.repeatHeader());
  }
  SlotHandle groupsSlot=handle.getGroups();
  for (int i=0; i < groupsSlot.getCount(); i++) {
    apply(groupsSlot.get(i));
    if (currentElement != null) {
      GroupDesign group=(GroupDesign)currentElement;
      group.setGroupLevel(i);
      listItem.addGroup(group);
    }
  }
  SlotHandle detailSlot=handle.getDetail();
  if (detailSlot.getCount() > 0) {
    ListBandDesign detail=createListBand(detailSlot);
    detail.setBandType(ListBandDesign.BAND_DETAIL);
    listItem.setDetail(detail);
  }
  SlotHandle footerSlot=handle.getFooter();
  if (footerSlot.getCount() > 0) {
    ListBandDesign footer=createListBand(footerSlot);
    footer.setBandType(ListBandDesign.BAND_FOOTER);
    listItem.setFooter(footer);
  }
  setCurrentElement(listItem);
}
Program: 73832
Project: 73832
Buggy source:
public void visitGraphicMasterPage(GraphicMasterPageHandle handle){
  GraphicMasterPageDesign page=new GraphicMasterPageDesign();
  setupMasterPage(page,handle);
  page.setColumns(handle.getColumnCount());
  DimensionType spacing=createDimension(handle.getColumnSpacing(),true);
  page.setColumnSpacing(spacing);
  SlotHandle contentSlot=handle.getContent();
  for (int i=0; i < contentSlot.getCount(); i++) {
    apply(contentSlot.get(i));
    if (currentElement != null) {
      page.addContent((ReportItemDesign)currentElement);
    }
  }
  currentElement=page;
  Assert.isTrue(false,"String_Node_Str");
}

Fixed version (ground truth):
public void visitGraphicMasterPage(GraphicMasterPageHandle handle){
  GraphicMasterPageDesign page=new GraphicMasterPageDesign();
  setupMasterPage(page,handle);
  page.setColumns(handle.getColumnCount());
  DimensionType spacing=createDimension(handle.getColumnSpacing(),true);
  page.setColumnSpacing(spacing);
  SlotHandle contentSlot=handle.getContent();
  for (int i=0; i < contentSlot.getCount(); i++) {
    apply(contentSlot.get(i));
    if (currentElement != null) {
      page.addContent((ReportItemDesign)currentElement);
    }
  }
  setCurrentElement(page);
  Assert.isTrue(false,"String_Node_Str");
}
Program: 73833
Project: 73833
Buggy source:
public void visitColumn(ColumnHandle handle){
  ColumnDesign col=new ColumnDesign();
  setupReportElement(col,handle);
  col.setColumnHeaderState(false);
  DimensionType width=createDimension(handle.getWidth(),false);
  col.setWidth(width);
  boolean supress=handle.suppressDuplicates();
  col.setSuppressDuplicate(supress);
  VisibilityDesign visibility=createVisibility(handle.visibilityRulesIterator());
  col.setVisibility(visibility);
  currentElement=col;
}

Fixed version (ground truth):
public void visitColumn(ColumnHandle handle){
  ColumnDesign col=new ColumnDesign();
  setupReportElement(col,handle);
  col.setColumnHeaderState(false);
  DimensionType width=createDimension(handle.getWidth(),false);
  col.setWidth(width);
  boolean supress=handle.suppressDuplicates();
  col.setSuppressDuplicate(supress);
  VisibilityDesign visibility=createVisibility(handle.visibilityRulesIterator());
  col.setVisibility(visibility);
  setCurrentElement(col);
}
Program: 73834
Project: 73834
Buggy source:
public void visitLabel(LabelHandle handle){
  LabelItemDesign labelItem=new LabelItemDesign();
  setupReportItem(labelItem,handle);
  String text=handle.getText();
  String textKey=handle.getTextKey();
  labelItem.setText(textKey,text);
  ActionHandle action=handle.getActionHandle();
  if (action != null) {
    labelItem.setAction(createAction(action));
  }
  labelItem.setHelpText(handle.getHelpTextKey(),handle.getHelpText());
  currentElement=labelItem;
}

Fixed version (ground truth):
public void visitLabel(LabelHandle handle){
  LabelItemDesign labelItem=new LabelItemDesign();
  setupReportItem(labelItem,handle);
  String text=handle.getText();
  String textKey=handle.getTextKey();
  labelItem.setText(textKey,text);
  ActionHandle action=handle.getActionHandle();
  if (action != null) {
    labelItem.setAction(createAction(action));
  }
  labelItem.setHelpText(handle.getHelpTextKey(),handle.getHelpText());
  setCurrentElement(labelItem);
}
Program: 73835
Project: 73835
Buggy source:
/** 
 * setup report element attribute
 * @param elem engine's report element
 * @param handle DE's report element
 */
private void setupReportElement(ReportElementDesign element,DesignElementHandle handle){
  element.setHandle(handle);
  element.setName(handle.getName());
  element.setID(handle.getID());
  List list=handle.getUserProperties();
  if (list != null) {
    Iterator iter=list.iterator();
    while (iter.hasNext()) {
      UserPropertyDefn propDefn=(UserPropertyDefn)iter.next();
      String propName=propDefn.getName();
      PropertyHandle propHandle=handle.getPropertyHandle(propName);
      String propValue=propHandle.getStringValue();
      element.getCustomProperties().put(propName,propValue);
    }
  }
  setupNamedExpressions(handle,element.getNamedExpressions());
  setupElementIDMap(element);
  element.setJavaClass(handle.getEventHandlerClass());
}

Fixed version (ground truth):
/** 
 * setup report element attribute
 * @param elem engine's report element
 * @param handle DE's report element
 */
private void setupReportElement(ReportElementDesign element,DesignElementHandle handle){
  element.setHandle(handle);
  element.setName(handle.getName());
  long id=currentElementId == -1 ? handle.getID() : currentElementId;
  element.setID(id);
  List list=handle.getUserProperties();
  if (list != null) {
    Iterator iter=list.iterator();
    while (iter.hasNext()) {
      UserPropertyDefn propDefn=(UserPropertyDefn)iter.next();
      String propName=propDefn.getName();
      PropertyHandle propHandle=handle.getPropertyHandle(propName);
      String propValue=propHandle.getStringValue();
      element.getCustomProperties().put(propName,propValue);
    }
  }
  setupNamedExpressions(handle,element.getNamedExpressions());
  setupElementIDMap(element);
  element.setJavaClass(handle.getEventHandlerClass());
}
Program: 73836
Project: 73836
Buggy source:
public void visitGrid(GridHandle handle){
  GridItemDesign grid=new GridItemDesign();
  setupReportItem(grid,handle);
  SlotHandle columnSlot=handle.getColumns();
  for (int i=0; i < columnSlot.getCount(); i++) {
    ColumnHandle columnHandle=(ColumnHandle)columnSlot.get(i);
    apply(columnHandle);
    if (currentElement != null) {
      ColumnDesign columnDesign=(ColumnDesign)currentElement;
      for (int j=0; j < columnHandle.getRepeatCount(); j++) {
        grid.addColumn(columnDesign);
      }
    }
  }
  SlotHandle rowSlot=handle.getRows();
  for (int i=0; i < rowSlot.getCount(); i++) {
    apply(rowSlot.get(i));
    if (currentElement != null) {
      grid.addRow((RowDesign)currentElement);
    }
  }
  newCellId=new TableItemDesignLayout().layout(grid,newCellId);
  applyColumnHighlight(grid);
  currentElement=grid;
}

Fixed version (ground truth):
public void visitGrid(GridHandle handle){
  GridItemDesign grid=new GridItemDesign();
  setupReportItem(grid,handle);
  SlotHandle columnSlot=handle.getColumns();
  for (int i=0; i < columnSlot.getCount(); i++) {
    ColumnHandle columnHandle=(ColumnHandle)columnSlot.get(i);
    apply(columnHandle);
    if (currentElement != null) {
      ColumnDesign columnDesign=(ColumnDesign)currentElement;
      for (int j=0; j < columnHandle.getRepeatCount(); j++) {
        grid.addColumn(columnDesign);
      }
    }
  }
  SlotHandle rowSlot=handle.getRows();
  for (int i=0; i < rowSlot.getCount(); i++) {
    apply(rowSlot.get(i));
    if (currentElement != null) {
      grid.addRow((RowDesign)currentElement);
    }
  }
  newCellId=new TableItemDesignLayout().layout(grid,newCellId);
  applyColumnHighlight(grid);
  setCurrentElement(grid);
}
Program: 73837
Project: 73837
Buggy source:
/** 
 * create a table group using the DE's TableGroup.
 * @param handle De's table group
 * @return engine's table group
 */
public void visitTableGroup(TableGroupHandle handle){
  TableGroupDesign tableGroup=new TableGroupDesign();
  setupGroup(tableGroup,handle);
  SlotHandle headerSlot=handle.getHeader();
  if (headerSlot.getCount() > 0) {
    TableBandDesign header=createTableBand(handle.getHeader());
    header.setBandType(TableBandDesign.GROUP_HEADER);
    header.setGroup(tableGroup);
    tableGroup.setHeader(header);
    tableGroup.setHeaderRepeat(handle.repeatHeader());
    String toc=handle.getTocExpression();
    if (null != toc && !"String_Node_Str".equals(toc.trim())) {
      tableGroup.setTOC(createExpression(toc));
    }
  }
  SlotHandle footerSlot=handle.getFooter();
  if (footerSlot.getCount() > 0) {
    TableBandDesign footer=createTableBand(handle.getFooter());
    footer.setBandType(TableBandDesign.GROUP_FOOTER);
    footer.setGroup(tableGroup);
    tableGroup.setFooter(footer);
  }
  boolean hideDetail=handle.hideDetail();
  tableGroup.setHideDetail(hideDetail);
  currentElement=tableGroup;
}

Fixed version (ground truth):
/** 
 * create a table group using the DE's TableGroup.
 * @param handle De's table group
 * @return engine's table group
 */
public void visitTableGroup(TableGroupHandle handle){
  TableGroupDesign tableGroup=new TableGroupDesign();
  setupGroup(tableGroup,handle);
  SlotHandle headerSlot=handle.getHeader();
  if (headerSlot.getCount() > 0) {
    TableBandDesign header=createTableBand(handle.getHeader());
    header.setBandType(TableBandDesign.GROUP_HEADER);
    header.setGroup(tableGroup);
    tableGroup.setHeader(header);
    tableGroup.setHeaderRepeat(handle.repeatHeader());
    String toc=handle.getTocExpression();
    if (null != toc && !"String_Node_Str".equals(toc.trim())) {
      tableGroup.setTOC(createExpression(toc));
    }
  }
  SlotHandle footerSlot=handle.getFooter();
  if (footerSlot.getCount() > 0) {
    TableBandDesign footer=createTableBand(handle.getFooter());
    footer.setBandType(TableBandDesign.GROUP_FOOTER);
    footer.setGroup(tableGroup);
    tableGroup.setFooter(footer);
  }
  boolean hideDetail=handle.hideDetail();
  tableGroup.setHideDetail(hideDetail);
  setCurrentElement(tableGroup);
}
Program: 73838
Project: 73838
Buggy source:
protected void visitExtendedItem(ExtendedItemHandle obj){
  ExtendedItemDesign extendedItem=new ExtendedItemDesign();
  setupReportItem(extendedItem,obj);
  extendedItem.setAltText(obj.getAltTextKey(),obj.getAltText());
  extendedItemNestingCount++;
  handleExtendedItemChildren(extendedItem,obj);
  extendedItemNestingCount--;
  currentElement=extendedItem;
}

Fixed version (ground truth):
protected void visitExtendedItem(ExtendedItemHandle obj){
  ExtendedItemDesign extendedItem=new ExtendedItemDesign();
  setupReportItem(extendedItem,obj);
  extendedItem.setAltText(obj.getAltTextKey(),obj.getAltText());
  extendedItemNestingCount++;
  handleExtendedItemChildren(extendedItem,obj);
  extendedItemNestingCount--;
  setCurrentElement(extendedItem);
}
Program: 73839
Project: 73839
Buggy source:
public void visitCell(CellHandle handle){
  CellDesign cell=new CellDesign();
  setupStyledElement(cell,handle);
  SlotHandle contentSlot=handle.getContent();
  for (int i=0; i < contentSlot.getCount(); i++) {
    apply(contentSlot.get(i));
    if (currentElement != null) {
      cell.addContent((ReportItemDesign)currentElement);
    }
  }
  cell.setColSpan(handle.getColumnSpan());
  int columnId=handle.getColumn() - 1;
  if (columnId < 0) {
    columnId=-1;
  }
  cell.setColumn(columnId);
  cell.setRowSpan(handle.getRowSpan());
  if (isCellInGroupHeader(handle)) {
    cell.setDrop(handle.getDrop());
  }
  String onCreate=handle.getOnCreate();
  String onCreateScriptText=createExpression(onCreate);
  if (null != onCreateScriptText) {
    String id=ModuleUtil.getScriptUID(handle.getPropertyHandle(ICellModel.ON_CREATE_METHOD));
    ScriptExpression scriptExpr=new ScriptExpression(onCreateScriptText,id);
    cell.setOnCreate(scriptExpr);
  }
  String OnRenderScriptText=handle.getOnRender();
  if (null != OnRenderScriptText) {
    String id=ModuleUtil.getScriptUID(handle.getPropertyHandle(ICellModel.ON_RENDER_METHOD));
    ScriptExpression scriptExpr=new ScriptExpression(OnRenderScriptText,id);
    cell.setOnRender(scriptExpr);
  }
  setupHighlight(cell,null);
  currentElement=cell;
}

Fixed version (ground truth):
public void visitCell(CellHandle handle){
  CellDesign cell=new CellDesign();
  setupStyledElement(cell,handle);
  SlotHandle contentSlot=handle.getContent();
  for (int i=0; i < contentSlot.getCount(); i++) {
    apply(contentSlot.get(i));
    if (currentElement != null) {
      cell.addContent((ReportItemDesign)currentElement);
    }
  }
  cell.setColSpan(handle.getColumnSpan());
  int columnId=handle.getColumn() - 1;
  if (columnId < 0) {
    columnId=-1;
  }
  cell.setColumn(columnId);
  cell.setRowSpan(handle.getRowSpan());
  if (isCellInGroupHeader(handle)) {
    cell.setDrop(handle.getDrop());
  }
  String onCreate=handle.getOnCreate();
  String onCreateScriptText=createExpression(onCreate);
  if (null != onCreateScriptText) {
    String id=ModuleUtil.getScriptUID(handle.getPropertyHandle(ICellModel.ON_CREATE_METHOD));
    ScriptExpression scriptExpr=new ScriptExpression(onCreateScriptText,id);
    cell.setOnCreate(scriptExpr);
  }
  String OnRenderScriptText=handle.getOnRender();
  if (null != OnRenderScriptText) {
    String id=ModuleUtil.getScriptUID(handle.getPropertyHandle(ICellModel.ON_RENDER_METHOD));
    ScriptExpression scriptExpr=new ScriptExpression(OnRenderScriptText,id);
    cell.setOnRender(scriptExpr);
  }
  setupHighlight(cell,null);
  setCurrentElement(cell);
}
Program: 73840
Project: 73840
Buggy source:
public void visitDataItem(DataItemHandle handle){
  DataItemDesign data=new DataItemDesign();
  setupReportItem(data,handle);
  String expr=handle.getResultSetColumn();
  if (expr != null && expr.trim().length() > 0) {
    data.setBindingColumn(expr);
  }
  ActionHandle action=handle.getActionHandle();
  if (action != null) {
    data.setAction(createAction(action));
  }
  data.setHelpText(handle.getHelpTextKey(),handle.getHelpText());
  setupHighlight(data,expr);
  setMap(data,expr);
  if (extendedItemNestingCount > 0) {
    data.setNeedRefreshMapping(true);
  }
  currentElement=data;
}

Fixed version (ground truth):
public void visitDataItem(DataItemHandle handle){
  DataItemDesign data=new DataItemDesign();
  setupReportItem(data,handle);
  String expr=handle.getResultSetColumn();
  if (expr != null && expr.trim().length() > 0) {
    data.setBindingColumn(expr);
  }
  ActionHandle action=handle.getActionHandle();
  if (action != null) {
    data.setAction(createAction(action));
  }
  data.setHelpText(handle.getHelpTextKey(),handle.getHelpText());
  setupHighlight(data,expr);
  setMap(data,expr);
  if (extendedItemNestingCount > 0) {
    data.setNeedRefreshMapping(true);
  }
  setCurrentElement(data);
}
Program: 73841
Project: 73841
Buggy source:
public void visitAutoText(AutoTextHandle handle){
  AutoTextItemDesign autoTextItem=new AutoTextItemDesign();
  setupReportItem(autoTextItem,handle);
  autoTextItem.setType(handle.getAutoTextType());
  currentElement=autoTextItem;
}

Fixed version (ground truth):
public void visitAutoText(AutoTextHandle handle){
  AutoTextItemDesign autoTextItem=new AutoTextItemDesign();
  setupReportItem(autoTextItem,handle);
  autoTextItem.setType(handle.getAutoTextType());
  setCurrentElement(autoTextItem);
}
Program: 73842
Project: 73842
Buggy source:
public void visitTextDataItem(TextDataHandle handle){
  DynamicTextItemDesign dynamicTextItem=new DynamicTextItemDesign();
  setupReportItem(dynamicTextItem,handle);
  String valueExpr=handle.getValueExpr();
  String contentType=handle.getContentType();
  dynamicTextItem.setContent(createExpression(valueExpr));
  dynamicTextItem.setContentType(contentType);
  setupHighlight(dynamicTextItem,valueExpr);
  setMap(dynamicTextItem,valueExpr);
  currentElement=dynamicTextItem;
}

Fixed version (ground truth):
public void visitTextDataItem(TextDataHandle handle){
  DynamicTextItemDesign dynamicTextItem=new DynamicTextItemDesign();
  setupReportItem(dynamicTextItem,handle);
  String valueExpr=handle.getValueExpr();
  String contentType=handle.getContentType();
  dynamicTextItem.setContent(createExpression(valueExpr));
  dynamicTextItem.setContentType(contentType);
  setupHighlight(dynamicTextItem,valueExpr);
  setMap(dynamicTextItem,valueExpr);
  setCurrentElement(dynamicTextItem);
}
Program: 73843
Project: 73843
Buggy source:
/** 
 * create a list group using the DE's ListGroup.
 * @param handle De's list group
 * @return engine's list group
 */
public void visitListGroup(ListGroupHandle handle){
  ListGroupDesign listGroup=new ListGroupDesign();
  setupGroup(listGroup,handle);
  SlotHandle headerSlot=handle.getHeader();
  if (headerSlot.getCount() > 0) {
    ListBandDesign header=createListBand(headerSlot);
    header.setBandType(ListBandDesign.GROUP_HEADER);
    header.setGroup(listGroup);
    listGroup.setHeader(header);
    listGroup.setHeaderRepeat(handle.repeatHeader());
    String toc=handle.getTocExpression();
    if (null != toc && !"String_Node_Str".equals(toc.trim())) {
      listGroup.setTOC(createExpression(toc));
    }
  }
  SlotHandle footerSlot=handle.getFooter();
  if (footerSlot.getCount() > 0) {
    ListBandDesign footer=createListBand(footerSlot);
    footer.setBandType(ListBandDesign.GROUP_FOOTER);
    footer.setGroup(listGroup);
    listGroup.setFooter(footer);
  }
  boolean hideDetail=handle.hideDetail();
  listGroup.setHideDetail(hideDetail);
  currentElement=listGroup;
}

Fixed version (ground truth):
/** 
 * create a list group using the DE's ListGroup.
 * @param handle De's list group
 * @return engine's list group
 */
public void visitListGroup(ListGroupHandle handle){
  ListGroupDesign listGroup=new ListGroupDesign();
  setupGroup(listGroup,handle);
  SlotHandle headerSlot=handle.getHeader();
  if (headerSlot.getCount() > 0) {
    ListBandDesign header=createListBand(headerSlot);
    header.setBandType(ListBandDesign.GROUP_HEADER);
    header.setGroup(listGroup);
    listGroup.setHeader(header);
    listGroup.setHeaderRepeat(handle.repeatHeader());
    String toc=handle.getTocExpression();
    if (null != toc && !"String_Node_Str".equals(toc.trim())) {
      listGroup.setTOC(createExpression(toc));
    }
  }
  SlotHandle footerSlot=handle.getFooter();
  if (footerSlot.getCount() > 0) {
    ListBandDesign footer=createListBand(footerSlot);
    footer.setBandType(ListBandDesign.GROUP_FOOTER);
    footer.setGroup(listGroup);
    listGroup.setFooter(footer);
  }
  boolean hideDetail=handle.hideDetail();
  listGroup.setHideDetail(hideDetail);
  setCurrentElement(listGroup);
}
Program: 73844
Project: 73844
Buggy source:
public void visitTemplateReportItem(TemplateReportItemHandle obj){
  TemplateDesign template=new TemplateDesign();
  setupTemplateReportElement(template,obj);
  template.setPromptText(obj.getDescription());
  template.setPromptTextKey(obj.getDescriptionKey());
  template.setAllowedType(obj.getAllowedType());
  currentElement=template;
}

Fixed version (ground truth):
public void visitTemplateReportItem(TemplateReportItemHandle obj){
  TemplateDesign template=new TemplateDesign();
  setupTemplateReportElement(template,obj);
  template.setPromptText(obj.getDescription());
  template.setPromptTextKey(obj.getDescriptionKey());
  template.setAllowedType(obj.getAllowedType());
  setCurrentElement(template);
}
Program: 73845
Project: 73845
Buggy source:
public void visitSimpleMasterPage(SimpleMasterPageHandle handle){
  SimpleMasterPageDesign page=new SimpleMasterPageDesign();
  setupMasterPage(page,handle);
  page.setHeaderHeight(createDimension(handle.getHeaderHeight(),true));
  page.setFooterHeight(createDimension(handle.getFooterHeight(),true));
  page.setShowFooterOnLast(handle.showFooterOnLast());
  page.setShowHeaderOnFirst(handle.showHeaderOnFirst());
  page.setFloatingFooter(handle.isFloatingFooter());
  SlotHandle headerSlot=handle.getPageHeader();
  for (int i=0; i < headerSlot.getCount(); i++) {
    apply(headerSlot.get(i));
    if (currentElement != null) {
      page.addHeader((ReportItemDesign)currentElement);
    }
  }
  SlotHandle footerSlot=handle.getPageFooter();
  for (int i=0; i < footerSlot.getCount(); i++) {
    apply(footerSlot.get(i));
    if (currentElement != null) {
      page.addFooter((ReportItemDesign)currentElement);
    }
  }
  currentElement=page;
}

Fixed version (ground truth):
public void visitSimpleMasterPage(SimpleMasterPageHandle handle){
  SimpleMasterPageDesign page=new SimpleMasterPageDesign();
  setupMasterPage(page,handle);
  page.setHeaderHeight(createDimension(handle.getHeaderHeight(),true));
  page.setFooterHeight(createDimension(handle.getFooterHeight(),true));
  page.setShowFooterOnLast(handle.showFooterOnLast());
  page.setShowHeaderOnFirst(handle.showHeaderOnFirst());
  page.setFloatingFooter(handle.isFloatingFooter());
  SlotHandle headerSlot=handle.getPageHeader();
  for (int i=0; i < headerSlot.getCount(); i++) {
    apply(headerSlot.get(i));
    if (currentElement != null) {
      page.addHeader((ReportItemDesign)currentElement);
    }
  }
  SlotHandle footerSlot=handle.getPageFooter();
  for (int i=0; i < footerSlot.getCount(); i++) {
    apply(footerSlot.get(i));
    if (currentElement != null) {
      page.addFooter((ReportItemDesign)currentElement);
    }
  }
  setCurrentElement(page);
}
Program: 73846
Project: 73846
Buggy source:
public void visitFreeForm(FreeFormHandle handle){
  FreeFormItemDesign container=new FreeFormItemDesign();
  setupReportItem(container,handle);
  SlotHandle slot=handle.getReportItems();
  for (int i=0; i < slot.getCount(); i++) {
    apply(slot.get(i));
    if (currentElement != null) {
      container.addItem((ReportItemDesign)currentElement);
    }
  }
  currentElement=container;
}

Fixed version (ground truth):
public void visitFreeForm(FreeFormHandle handle){
  FreeFormItemDesign container=new FreeFormItemDesign();
  setupReportItem(container,handle);
  SlotHandle slot=handle.getReportItems();
  for (int i=0; i < slot.getCount(); i++) {
    apply(slot.get(i));
    if (currentElement != null) {
      container.addItem((ReportItemDesign)currentElement);
    }
  }
  setCurrentElement(container);
}
Program: 73847
Project: 73847
Buggy source:
public void visitRow(RowHandle handle){
  RowDesign row=new RowDesign();
  setupStyledElement(row,handle);
  DimensionType height=createDimension(handle.getHeight(),false);
  row.setHeight(height);
  String bookmark=handle.getBookmark();
  row.setBookmark(createExpression(bookmark));
  VisibilityDesign visibility=createVisibility(handle.visibilityRulesIterator());
  row.setVisibility(visibility);
  SlotHandle cellSlot=handle.getCells();
  for (int i=0; i < cellSlot.getCount(); i++) {
    apply(cellSlot.get(i));
    if (currentElement != null) {
      row.addCell((CellDesign)currentElement);
    }
  }
  String onCreate=handle.getOnCreate();
  String OnCreateScriptText=createExpression(onCreate);
  if (null != OnCreateScriptText) {
    String id=ModuleUtil.getScriptUID(handle.getPropertyHandle(ITableRowModel.ON_CREATE_METHOD));
    ScriptExpression scriptExpr=new ScriptExpression(OnCreateScriptText,id);
    row.setOnCreate(scriptExpr);
  }
  String OnRenderScriptText=((RowHandle)handle).getOnRender();
  if (null != OnRenderScriptText) {
    String id=ModuleUtil.getScriptUID(handle.getPropertyHandle(ITableRowModel.ON_RENDER_METHOD));
    ScriptExpression scriptExpr=new ScriptExpression(OnRenderScriptText,id);
    row.setOnRender(scriptExpr);
  }
  setupHighlight(row,null);
  currentElement=row;
}

Fixed version (ground truth):
public void visitRow(RowHandle handle){
  RowDesign row=new RowDesign();
  setupStyledElement(row,handle);
  DimensionType height=createDimension(handle.getHeight(),false);
  row.setHeight(height);
  String bookmark=handle.getBookmark();
  row.setBookmark(createExpression(bookmark));
  VisibilityDesign visibility=createVisibility(handle.visibilityRulesIterator());
  row.setVisibility(visibility);
  SlotHandle cellSlot=handle.getCells();
  for (int i=0; i < cellSlot.getCount(); i++) {
    apply(cellSlot.get(i));
    if (currentElement != null) {
      row.addCell((CellDesign)currentElement);
    }
  }
  String onCreate=handle.getOnCreate();
  String OnCreateScriptText=createExpression(onCreate);
  if (null != OnCreateScriptText) {
    String id=ModuleUtil.getScriptUID(handle.getPropertyHandle(ITableRowModel.ON_CREATE_METHOD));
    ScriptExpression scriptExpr=new ScriptExpression(OnCreateScriptText,id);
    row.setOnCreate(scriptExpr);
  }
  String OnRenderScriptText=((RowHandle)handle).getOnRender();
  if (null != OnRenderScriptText) {
    String id=ModuleUtil.getScriptUID(handle.getPropertyHandle(ITableRowModel.ON_RENDER_METHOD));
    ScriptExpression scriptExpr=new ScriptExpression(OnRenderScriptText,id);
    row.setOnRender(scriptExpr);
  }
  setupHighlight(row,null);
  setCurrentElement(row);
}
Program: 73848
Project: 73848
Buggy source:
/** 
 * parse the XML input stream.
 * @param design DE's IR
 * @return FPE's IR, null if there is any error.
 */
public Report parse(ReportDesignHandle design){
  assert(design != null);
  EngineIRVisitor visitor=new EngineIRVisitor(design);
  Report report=visitor.translate();
  report.setVersion(ReportDocumentConstants.BIRT_ENGINE_VERSION);
  return report;
}

Fixed version (ground truth):
/** 
 * parse the XML input stream.
 * @param design DE's IR
 * @return FPE's IR, null if there is any error.
 */
public Report parse(ReportDesignHandle design){
  assert(design != null);
  EngineIRVisitor visitor=new MultiViewEngineIRVisitor(design);
  Report report=visitor.translate();
  report.setVersion(ReportDocumentConstants.BIRT_ENGINE_VERSION);
  return report;
}
Program: 73849
Project: 73849
Buggy source:
public Object visitImage(IImageContent image,Object value){
  if (image.getImageSource() == IImageContent.IMAGE_FILE || image.getImageSource() == IImageContent.IMAGE_URL) {
    String strUri=image.getURI();
    ReportDesignHandle reportDesign=context.getDesign();
    URL uri=reportDesign.findResource(strUri,IResourceLocator.IMAGE);
    if (uri != null) {
      image.setURI(uri.toExternalForm());
    }
  }
  handleOnRender(image);
  processImage(image);
  return image;
}

Fixed version (ground truth):
public Object visitImage(IImageContent image,Object value){
  handleOnRender(image);
  if (image.getImageSource() == IImageContent.IMAGE_FILE || image.getImageSource() == IImageContent.IMAGE_URL) {
    String strUri=image.getURI();
    ReportDesignHandle reportDesign=context.getDesign();
    URL uri=reportDesign.findResource(strUri,IResourceLocator.IMAGE);
    if (uri != null) {
      image.setURI(uri.toExternalForm());
    }
  }
  processImage(image);
  return image;
}
Program: 73850
Project: 73850
Buggy source:
public Collection getPageEdge() throws OLAPException {
  return this.cursor.getPageEdge();
}

Fixed version (ground truth):
public Collection getPageEdge() throws OLAPException {
  return new ArrayList();
}
Program: 73851
Project: 73851
Buggy source:
protected void executeQueries() throws BirtException {
  ExtendedItemDesign extItem=(ExtendedItemDesign)design;
  IDataEngine dataEngine=context.getDataEngine();
  boolean useCache=extItem.useCachedResult();
  IDataQueryDefinition[] queries=extItem.getQueries();
  if (queries != null) {
    IBaseResultSet parent=getParentResultSet();
    rsets=new IBaseResultSet[queries.length];
    for (int i=0; i < rsets.length; i++) {
      rsets[i]=dataEngine.execute(parent,queries[i],useCache);
    }
    context.setResultSets(rsets);
  }
}

Fixed version (ground truth):
protected void executeQueries() throws BirtException {
  ExtendedItemDesign extItem=(ExtendedItemDesign)design;
  IDataEngine dataEngine=context.getDataEngine();
  boolean useCache=extItem.useCachedResult();
  IDataQueryDefinition[] queries=extItem.getQueries();
  if (queries != null) {
    IBaseResultSet parent=getParentResultSet();
    rsets=new IBaseResultSet[queries.length];
    for (int i=0; i < rsets.length; i++) {
      if (queries[i] == null) {
        rsets[i]=null;
      }
 else {
        rsets[i]=dataEngine.execute(parent,queries[i],useCache);
      }
    }
    context.setResultSets(rsets);
  }
}
Program: 73852
Project: 73852
Buggy source:
protected void executeQuery(){
  getParentResultSet();
  if (design != null) {
    boolean useCache=design.useCachedResult();
    IDataQueryDefinition[] queries=design.getQueries();
    if (queries != null) {
      rsets=new IBaseResultSet[queries.length];
      try {
        IBaseResultSet prset=restoreParentResultSet();
        for (int i=0; i < queries.length; i++) {
          rsets[i]=context.executeQuery(prset,queries[i],useCache);
        }
        context.setResultSets(rsets);
      }
 catch (      BirtException ex) {
        context.addException(this.getDesign(),ex);
      }
    }
  }
}

Fixed version (ground truth):
protected void executeQuery(){
  getParentResultSet();
  if (design != null) {
    boolean useCache=design.useCachedResult();
    IDataQueryDefinition[] queries=design.getQueries();
    if (queries != null) {
      rsets=new IBaseResultSet[queries.length];
      try {
        IBaseResultSet prset=restoreParentResultSet();
        for (int i=0; i < queries.length; i++) {
          if (queries[i] == null) {
            rsets[i]=null;
          }
 else {
            rsets[i]=context.executeQuery(prset,queries[i],useCache);
          }
        }
        context.setResultSets(rsets);
      }
 catch (      BirtException ex) {
        context.addException(this.getDesign(),ex);
      }
    }
  }
}
Program: 73853
Project: 73853
Buggy source:
/** 
 * Calculate the bookmark value which is set to <code>ReportItemContent</code> if the bookmark is not null
 * @param item the ReportItemContent object
 */
protected void processBookmark(ReportItemDesign item,IContent itemContent){
  String bookmark=item.getBookmark();
  if (bookmark != null) {
    Object tmp=evaluate(bookmark);
    if (tmp != null && !tmp.equals("String_Node_Str")) {
      itemContent.setBookmark(tmp.toString());
    }
  }
  String toc=item.getTOC();
  if (toc != null) {
    Object tmp=evaluate(toc);
    if (tmp != null) {
      itemContent.setTOC(tmp);
    }
  }
}

Fixed version (ground truth):
/** 
 * Calculate the bookmark value which is set to <code>ReportItemContent</code> if the bookmark is not null
 * @param item the ReportItemContent object
 */
protected void processBookmark(ReportItemDesign item,IContent itemContent){
  String bookmark=item.getBookmark();
  if (bookmark != null) {
    Object tmp=evaluate(bookmark);
    if (tmp != null && !tmp.equals("String_Node_Str")) {
      itemContent.setBookmark(tmp.toString());
    }
  }
  String toc=item.getTOC();
  if (toc != null) {
    Object tmp=evaluate(toc);
    if (tmp == null) {
      tmp="String_Node_Str";
    }
    itemContent.setTOC(tmp);
  }
}
Program: 73854
Project: 73854
Buggy source:
/** 
 * @return if font is embeded
 */
public boolean isEmbededFont();

Fixed version (ground truth):
/** 
 * @return if font is embedded
 */
public boolean isEmbededFont();
Program: 73855
Project: 73855
Buggy source:
static String getElementProperty(ReportElementHandle handle,String name,boolean isColorProperty){
  FactoryPropertyHandle prop=handle.getFactoryPropertyHandle(name);
  if (prop != null && prop.isSet()) {
    if (isColorProperty) {
      return prop.getColorValue();
    }
    return prop.getStringValue();
  }
  return null;
}

Fixed version (ground truth):
static String getElementProperty(ReportElementHandle handle,String name,boolean isColorProperty){
  if (handle instanceof ExtendedItemHandle) {
    Object localValue=((ExtendedItemHandle)handle).getMetaModelProperty(name);
    if (localValue == null) {
      return null;
    }
  }
  FactoryPropertyHandle prop=handle.getFactoryPropertyHandle(name);
  if (prop != null && prop.isSet()) {
    if (isColorProperty) {
      return prop.getColorValue();
    }
    return prop.getStringValue();
  }
  return null;
}
Program: 73856
Project: 73856
Buggy source:
/** 
 * need overwrite this mothod to change default behavour. For inline leaf elements, page-break is handled by this layout manager. For block leaf elements. page-break is handled by it's block container
 */
protected boolean handlePageBreakBefore(){
  if (content != null) {
    if (PropertyUtil.isInlineElement(content)) {
      return super.handlePageBreakBefore();
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * need overwrite this mothod to change default behavour. For inline leaf elements, page-break is handled by this layout manager. For block leaf elements. page-break is handled by it's block container
 */
protected boolean handlePageBreakBefore(){
  if (content != null) {
    return super.handlePageBreakBefore();
  }
  return false;
}
Program: 73857
Project: 73857
Buggy source:
/** 
 * @param cubeHandle
 * @return
 */
private Set needCachedDataSetToEnhancePerformance(TabularCubeHandle cubeHandle){
  Set set=new HashSet();
  set.add(cubeHandle.getDataSet());
  List dimHandles=cubeHandle.getContents(CubeHandle.DIMENSIONS_PROP);
  for (int i=0; i < dimHandles.size(); i++) {
    DimensionHandle dimHandle=(DimensionHandle)dimHandles.get(i);
    List hiers=dimHandle.getContents(DimensionHandle.HIERARCHIES_PROP);
    TabularHierarchyHandle hierHandle=(TabularHierarchyHandle)hiers.get(0);
    if (hierHandle.getDataSet() != null)     set.add(hierHandle.getDataSet());
  }
  return set;
}

Fixed version (ground truth):
/** 
 * @param cubeHandle
 * @return
 */
private List needCachedDataSetToEnhancePerformance(TabularCubeHandle cubeHandle){
  List list=new ArrayList();
  list.add(cubeHandle.getDataSet());
  List dimHandles=cubeHandle.getContents(CubeHandle.DIMENSIONS_PROP);
  for (int i=0; i < dimHandles.size(); i++) {
    DimensionHandle dimHandle=(DimensionHandle)dimHandles.get(i);
    List hiers=dimHandle.getContents(DimensionHandle.HIERARCHIES_PROP);
    TabularHierarchyHandle hierHandle=(TabularHierarchyHandle)hiers.get(0);
    if (hierHandle.getDataSet() != null)     list.add(hierHandle.getDataSet());
 else     list.add(cubeHandle.getDataSet());
  }
  return list;
}
Program: 73859
Project: 73859
Buggy source:
protected void setupPageBreak(PolicyNode node){
  ReportItemDesign item=node.design;
  String styleClass=item.getStyleName();
  if (styleClass != null) {
    IStyle style=report.findStyle(styleClass);
    CSSValue masterPage=style.getProperty(IStyle.STYLE_MASTER_PAGE);
    CSSValue pageBreakBefore=style.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
    CSSValue pageBreakAfter=style.getProperty(IStyle.STYLE_PAGE_BREAK_AFTER);
    if (masterPage != null || pageBreakBefore != null) {
      node.breakBefore=true;
      node.execute=true;
    }
 else     if (pageBreakAfter != null) {
      node.breakAfter=true;
      node.execute=true;
    }
  }
  if (item.getJavaClass() != null || item.getOnCreate() != null || item.getOnPageBreak() != null) {
    node.breakBefore=true;
    node.breakAfter=true;
    node.execute=true;
  }
  if (node.breakBefore || node.breakAfter) {
    Iterator iter=rows.iterator();
    while (iter.hasNext()) {
      PolicyNode row=(PolicyNode)iter.next();
      row.executeAll=true;
    }
    return;
  }
  if (item.getHighlight() != null || item.getMap() != null) {
    node.execute=true;
  }
  if (item.getTOC() != null || item.getBookmark() != null || item.getAction() != null) {
    node.execute=true;
  }
  if (item.getQueries() != null) {
    node.execute=true;
  }
  if (item.getVisibility() != null) {
    node.execute=true;
  }
}

Fixed version (ground truth):
protected void setupPageBreak(PolicyNode node){
  ReportItemDesign item=node.design;
  String styleClass=item.getStyleName();
  if (styleClass != null) {
    IStyle style=report.findStyle(styleClass);
    CSSValue masterPage=style.getProperty(IStyle.STYLE_MASTER_PAGE);
    CSSValue pageBreakBefore=style.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
    CSSValue pageBreakAfter=style.getProperty(IStyle.STYLE_PAGE_BREAK_AFTER);
    if (masterPage != null || pageBreakBefore != null) {
      node.breakBefore=true;
      node.execute=true;
    }
    if (pageBreakAfter != null) {
      node.breakAfter=true;
      node.execute=true;
    }
  }
  if (item.getJavaClass() != null || item.getOnCreate() != null || item.getOnPageBreak() != null) {
    node.breakBefore=true;
    node.breakAfter=true;
    node.execute=true;
  }
  if (node.breakBefore || node.breakAfter) {
    Iterator iter=rows.iterator();
    while (iter.hasNext()) {
      PolicyNode row=(PolicyNode)iter.next();
      row.executeAll=true;
    }
    return;
  }
  if (item.getHighlight() != null || item.getMap() != null) {
    node.execute=true;
  }
  if (item.getTOC() != null || item.getBookmark() != null || item.getAction() != null) {
    node.execute=true;
  }
  if (item.getQueries() != null) {
    node.execute=true;
  }
  if (item.getVisibility() != null) {
    node.execute=true;
  }
}
Program: 73860
Project: 73860
Buggy source:
private String getProjectOutClassPath(IProject project){
  if (!hasJavaNature(project)) {
    return null;
  }
  IJavaProject fCurrJProject=JavaCore.create(project);
  IPath path=null;
  boolean projectExists=(project.exists() && project.getFile("String_Node_Str").exists());
  if (projectExists) {
    if (path == null) {
      path=fCurrJProject.readOutputLocation();
      String curPath=path.toOSString();
      String directPath=project.getLocation().toOSString();
      int index=directPath.lastIndexOf(File.separator);
      String absPath=directPath.substring(0,index) + curPath;
      return absPath;
    }
  }
  return null;
}

Fixed version (ground truth):
private String getProjectOutClassPath(IProject project){
  if (!hasJavaNature(project)) {
    return null;
  }
  IJavaProject fCurrJProject=JavaCore.create(project);
  IPath path=null;
  boolean projectExists=(project.exists() && project.getFile("String_Node_Str").exists());
  if (projectExists) {
    if (path == null) {
      path=fCurrJProject.readOutputLocation();
      String curPath=path.toOSString();
      int index=curPath.indexOf(project.getName());
      curPath=curPath.substring(index + project.getName().length());
      String directPath=project.getLocation().toOSString();
      String absPath=directPath + curPath;
      return absPath;
    }
  }
  return null;
}