nus-yam/ex-repair huggingface dataset:
Program: 70891
Project: 70891
Buggy source:
public synchronized int hashCode(){
  if (__hashCodeCalc) {
    return 0;
  }
  __hashCodeCalc=true;
  int _hashCode=1;
  _hashCode+=new Long(getId()).hashCode();
  if (getName() != null) {
    _hashCode+=getName().hashCode();
  }
  if (getDisplayName() != null) {
    _hashCode+=getDisplayName().hashCode();
  }
  __hashCodeCalc=false;
  return _hashCode;
}

Fixed version (ground truth):
public synchronized int hashCode(){
  if (__hashCodeCalc) {
    return 0;
  }
  __hashCodeCalc=true;
  int _hashCode=1;
  _hashCode+=Long.valueOf(getId()).hashCode();
  if (getName() != null) {
    _hashCode+=getName().hashCode();
  }
  if (getDisplayName() != null) {
    _hashCode+=getDisplayName().hashCode();
  }
  __hashCodeCalc=false;
  return _hashCode;
}
Program: 70895
Project: 70895
Buggy source:
/** 
 * @see org.eclipse.birt.report.engine.dataextraction.csv.ICSVDataExtractionOption#setExportDataType(boolean)
 */
public void setExportDataType(boolean isExportDataType){
  setOption(OUTPUT_EXPORT_DATA_TYPE,new Boolean(isExportDataType));
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.birt.report.engine.dataextraction.csv.ICSVDataExtractionOption#setExportDataType(boolean)
 */
public void setExportDataType(boolean isExportDataType){
  setOption(OUTPUT_EXPORT_DATA_TYPE,Boolean.valueOf(isExportDataType));
}
Program: 70896
Project: 70896
Buggy source:
/** 
 * @see org.eclipse.birt.report.engine.dataextraction.csv.ICSVDataExtractionOption#setLocaleNeutralFormat(boolean)
 */
public void setLocaleNeutralFormat(boolean isLocaleNeutralFormat){
  setOption(OUTPUT_LOCALE_NEUTRAL_FORMAT,new Boolean(isLocaleNeutralFormat));
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.birt.report.engine.dataextraction.csv.ICSVDataExtractionOption#setLocaleNeutralFormat(boolean)
 */
public void setLocaleNeutralFormat(boolean isLocaleNeutralFormat){
  setOption(OUTPUT_LOCALE_NEUTRAL_FORMAT,Boolean.valueOf(isLocaleNeutralFormat));
}
Program: 70897
Project: 70897
Buggy source:
public void widgetSelected(SelectionEvent e){
  if (webapp != null && webapp.useCustomParamHandling()) {
    refresh();
  }
 else {
    parameterDialog.open();
    if (parameterDialog.getReturnCode() == InputParameterHtmlDialog.RETURN_CODE_BROWSER_CLOSED) {
      refresh();
    }
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  if (webapp != null && webapp.useCustomParamHandling()) {
    suggestShowParameterPage=true;
    refresh();
    suggestShowParameterPage=false;
  }
 else {
    parameterDialog.open();
    if (parameterDialog.getReturnCode() == InputParameterHtmlDialog.RETURN_CODE_BROWSER_CLOSED) {
      refresh();
    }
  }
}
Program: 70900
Project: 70900
Buggy source:
private void populateConnectionProp() throws SQLException {
  if (jdbcConn != null) {
    jdbcConn.setAutoCommit(this.autoCommit);
    if (this.isolationMode != Constants.TRANSCATION_ISOLATION_DEFAULT)     jdbcConn.setTransactionIsolation(this.isolationMode);
  }
}

Fixed version (ground truth):
private void populateConnectionProp() throws SQLException {
  if (jdbcConn != null) {
    if (this.autoCommit != null)     jdbcConn.setAutoCommit(this.autoCommit);
    if (this.isolationMode != Constants.TRANSCATION_ISOLATION_DEFAULT)     jdbcConn.setTransactionIsolation(this.isolationMode);
  }
}
Program: 70901
Project: 70901
Buggy source:
/** 
 * perform edit directly when the request is the corresponding type.
 */
public void performRequest(Request request){
  if (RequestConstants.REQ_OPEN.equals(request.getType()) || ReportRequest.CREATE_ELEMENT.equals(request.getType())) {
    if (isEdited()) {
      return;
    }
    setEdited(true);
    try {
      performDirectEdit();
    }
 catch (    RuntimeException e) {
      logger.log(Level.SEVERE,e.getMessage(),e);
    }
    setEdited(false);
  }
}

Fixed version (ground truth):
/** 
 * perform edit directly when the request is the corresponding type.
 */
public void performRequest(Request request){
  if (request.getExtendedData().get(DesignerConstants.NEWOBJECT_FROM_LIBRARY) != null) {
    return;
  }
  if (RequestConstants.REQ_OPEN.equals(request.getType()) || ReportRequest.CREATE_ELEMENT.equals(request.getType())) {
    if (isEdited()) {
      return;
    }
    setEdited(true);
    try {
      performDirectEdit();
    }
 catch (    RuntimeException e) {
      logger.log(Level.SEVERE,e.getMessage(),e);
    }
    setEdited(false);
  }
}
Program: 70902
Project: 70902
Buggy source:
public boolean preHandleMouseUp(){
  ModuleHandle moduleHandle=SessionHandleAdapter.getInstance().getReportDesignHandle();
  LibraryHandle library=(LibraryHandle)elementHandle.getRoot();
  try {
    if (UIUtil.includeLibrary(moduleHandle,library)) {
      if (elementHandle instanceof ThemeHandle) {
        ThemeHandle model=UIUtil.applyTheme((ThemeHandle)elementHandle,moduleHandle,library);
        if (model != null) {
          setModel(elementHandle);
        }
      }
 else {
        DesignElementHandle newHandle=moduleHandle.getElementFactory().newElementFrom(elementHandle,elementHandle.getName());
        setModel(newHandle);
      }
    }
  }
 catch (  Exception e) {
    if (e instanceof InvalidParentException || e instanceof WrongTypeException) {
      GUIException exception=GUIException.createGUIException(ReportPlugin.REPORT_UI,e,"String_Node_Str");
      ExceptionHandler.handle(exception);
    }
 else {
      ExceptionHandler.handle(e);
    }
  }
  return super.preHandleMouseUp();
}

Fixed version (ground truth):
public boolean preHandleMouseUp(){
  ModuleHandle moduleHandle=SessionHandleAdapter.getInstance().getReportDesignHandle();
  LibraryHandle library=(LibraryHandle)elementHandle.getRoot();
  try {
    if (UIUtil.includeLibrary(moduleHandle,library)) {
      if (elementHandle instanceof ThemeHandle) {
        ThemeHandle model=UIUtil.applyTheme((ThemeHandle)elementHandle,moduleHandle,library);
        if (model != null) {
          setModel(elementHandle);
        }
      }
 else {
        DesignElementHandle newHandle=moduleHandle.getElementFactory().newElementFrom(elementHandle,elementHandle.getName());
        setModel(newHandle);
      }
    }
  }
 catch (  Exception e) {
    if (e instanceof InvalidParentException || e instanceof WrongTypeException) {
      GUIException exception=GUIException.createGUIException(ReportPlugin.REPORT_UI,e,"String_Node_Str");
      ExceptionHandler.handle(exception);
    }
 else {
      ExceptionHandler.handle(e);
    }
  }
  getRequest().getExtendedData().put(DesignerConstants.NEWOBJECT_FROM_LIBRARY,Boolean.TRUE);
  return super.preHandleMouseUp();
}
Program: 70904
Project: 70904
Buggy source:
/** 
 * Build the style of the page
 */
public void buildPageStyle(IPageContent page,StringBuffer styleBuffer){
  IStyle style=page.getStyle();
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
}

Fixed version (ground truth):
/** 
 * Build the style of the page
 */
public void buildPageStyle(IPageContent page,StringBuffer styleBuffer){
  IStyle style=page.getStyle();
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildBorders(styleBuffer,style);
}
Program: 70905
Project: 70905
Buggy source:
public void startPage(IPageContent page) throws BirtException {
  if (orientation == null) {
    orientation=capitalize(page.getOrientation());
  }
  if (needOutputInMasterPage(page.getPageHeader()) && needOutputInMasterPage(page.getPageFooter())) {
    outputInMasterPage=true;
    pageHeader=formatHeaderFooter(page.getPageHeader(),true);
    pageFooter=formatHeaderFooter(page.getPageFooter(),false);
  }
  if (!outputInMasterPage && page.getPageHeader() != null) {
    contentVisitor.visitChildren(page.getPageHeader(),null);
  }
}

Fixed version (ground truth):
public void startPage(IPageContent page) throws BirtException {
  if (orientation == null) {
    orientation=capitalize(page.getOrientation());
  }
  if (needOutputInMasterPage(page.getPageHeader()) && needOutputInMasterPage(page.getPageFooter())) {
    outputInMasterPage=true;
    pageHeader=formatHeaderFooter(page.getPageHeader(),true);
    pageFooter=formatHeaderFooter(page.getPageFooter(),false);
  }
  if (!outputInMasterPage && page.getPageHeader() != null) {
    contentVisitor.visitChildren(page.getPageHeader(),null);
  }
  engine.setPageStyle(page.getComputedStyle());
}
Program: 70906
Project: 70906
Buggy source:
private void endNormalContainer(){
  XlsContainer container=getCurrentContainer();
  if (container.isEmpty()) {
    Data data=new Data(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=new Data(EMPTY,container.getStyle(),Data.STRING,container);
    data.setSizeInfo(container.getSizeInfo());
    addData(data);
  }
  engine.applyContainerBottomStyle();
  containers.pop();
}
Program: 70907
Project: 70907
Buggy source:
public void complete(){
  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;
      }
      int styleid=engine.getStyleID(data.getStyle());
      data.setStyleId(styleid);
      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);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void complete(){
  endNormalContainer();
  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;
      }
      int styleid=engine.getStyleID(data.getStyle());
      data.setStyleId(styleid);
      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);
        }
      }
    }
  }
}
Program: 70908
Project: 70908
Buggy source:
/** 
 * This method will be invoked while a containerArea ends.
 * @param container the ContainerArea specified from layout
 */
protected void endContainer(IContainerArea container){
  currentX-=getX(container);
  currentY-=getY(container);
  if (container instanceof PageArea) {
    pageGraphic.dispose();
  }
 else {
    if (container instanceof RowArea) {
      rowStyleStack.pop();
    }
    if (container instanceof TableArea) {
      drawTableBorder((TableArea)container);
    }
 else     if (!(container instanceof CellArea)) {
      BorderInfo[] borders=cacheBorderInfo(container);
      drawBorder(borders);
    }
    if (container.needClip()) {
      endClip();
    }
  }
}

Fixed version (ground truth):
/** 
 * This method will be invoked while a containerArea ends.
 * @param container the ContainerArea specified from layout
 */
protected void endContainer(IContainerArea container){
  currentX-=getX(container);
  currentY-=getY(container);
  if (container instanceof PageArea) {
    BorderInfo[] borders=cacheBorderInfo(container);
    drawBorder(borders);
    pageGraphic.dispose();
  }
 else {
    if (container instanceof RowArea) {
      rowStyleStack.pop();
    }
    if (container instanceof TableArea) {
      drawTableBorder((TableArea)container);
    }
 else     if (!(container instanceof CellArea)) {
      BorderInfo[] borders=cacheBorderInfo(container);
      drawBorder(borders);
    }
    if (container.needClip()) {
      endClip();
    }
  }
}
Program: 70909
Project: 70909
Buggy source:
private void resizeColumn(int value,int start,int end){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  if (start != end) {
    value=getTrueValue(value,start,end);
    part.resizeColumn(start,end,value);
  }
 else {
    Dimension dimension=getDragWidth(start,end);
    if (value < dimension.width) {
      value=dimension.width;
    }
    TableHandleAdapter adp=HandleAdapterFactory.getInstance().getTableHandleAdapter(part.getModel());
    Dimension dm=adp.calculateSize();
    dm.width+=value;
    try {
      adp.ajustSize(dm);
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
}

Fixed version (ground truth):
private void resizeColumn(int value,int start,int end){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  if (start != end) {
    value=getTrueValue(value,start,end);
    part.resizeColumn(start,end,value);
  }
 else {
    Dimension dimension=getDragWidth(start,end);
    if (value < dimension.width) {
      value=dimension.width;
    }
    TableHandleAdapter adp=HandleAdapterFactory.getInstance().getTableHandleAdapter(part.getModel());
    Dimension dm=adp.calculateSize();
    dm.width+=value;
    dm.height=-1;
    try {
      adp.ajustSize(dm);
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
}
Program: 70910
Project: 70910
Buggy source:
protected void resize(){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  int value=getLocation().x - getStartLocation().x;
  part.getTableAdapter().transStar(RESIZE_COLUMN_TRANS_LABEL);
  if (isresizeMultipleColumn()) {
    List list=filterEditPart(part.getViewer().getSelectedEditParts());
    boolean resizeTable=false;
    int width=0;
    for (int i=0; i < list.size(); i++) {
      int tempValue=value;
      Object model=((EditPart)list.get(i)).getModel();
      ColumnHandleAdapter adapter=HandleAdapterFactory.getInstance().getColumnHandleAdapter(model);
      int start=adapter.getColumnNumber();
      int end=start + 1;
      int ori=TableUtil.caleVisualWidth(part,model);
      int adjustWidth=TableUtil.caleVisualWidth(part,part.getColumn(getStart())) + value;
      if (getStart() != start) {
        tempValue=adjustWidth - ori;
      }
      if (start == part.getColumnCount()) {
        end=start;
        resizeTable=true;
      }
 else {
        width=width + getTrueValue(tempValue,start,end);
      }
      resizeColumn(tempValue,start,end);
    }
    if (resizeTable) {
      Dimension size=part.getTableAdapter().getSize();
      try {
        part.getTableAdapter().setSize(new Dimension(size.width + width,size.height));
      }
 catch (      SemanticException e) {
        part.getTableAdapter().rollBack();
        ExceptionHandler.handle(e);
      }
    }
  }
 else {
    resizeColumn(value,getStart(),getEnd());
  }
  part.getTableAdapter().transEnd();
}

Fixed version (ground truth):
protected void resize(){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  int value=getLocation().x - getStartLocation().x;
  part.getTableAdapter().transStar(RESIZE_COLUMN_TRANS_LABEL);
  if (isresizeMultipleColumn()) {
    List list=filterEditPart(part.getViewer().getSelectedEditParts());
    boolean resizeTable=false;
    int width=0;
    for (int i=0; i < list.size(); i++) {
      int tempValue=value;
      Object model=((EditPart)list.get(i)).getModel();
      ColumnHandleAdapter adapter=HandleAdapterFactory.getInstance().getColumnHandleAdapter(model);
      int start=adapter.getColumnNumber();
      int end=start + 1;
      int ori=TableUtil.caleVisualWidth(part,model);
      int adjustWidth=TableUtil.caleVisualWidth(part,part.getColumn(getStart())) + value;
      if (getStart() != start) {
        tempValue=adjustWidth - ori;
      }
      if (start == part.getColumnCount()) {
        end=start;
        resizeTable=true;
      }
 else {
        width=width + getTrueValue(tempValue,start,end);
      }
      resizeColumn(tempValue,start,end);
    }
    if (resizeTable) {
      Dimension size=part.getTableAdapter().getSize();
      try {
        part.getTableAdapter().setSize(new Dimension(size.width + width,-1));
      }
 catch (      SemanticException e) {
        part.getTableAdapter().rollBack();
        ExceptionHandler.handle(e);
      }
    }
  }
 else {
    resizeColumn(value,getStart(),getEnd());
  }
  part.getTableAdapter().transEnd();
}
Program: 70911
Project: 70911
Buggy source:
protected void resize(){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  int value=getLocation().y - getStartLocation().y;
  part.getTableAdapter().transStar(RESIZE_COLUMN_TRANS_LABEL);
  if (isresizeMultipleRow()) {
    List list=filterEditPart(part.getViewer().getSelectedEditParts());
    boolean resizeTable=false;
    int height=0;
    for (int i=0; i < list.size(); i++) {
      int tempValue=value;
      Object model=((EditPart)list.get(i)).getModel();
      RowHandleAdapter adapter=HandleAdapterFactory.getInstance().getRowHandleAdapter(model);
      int start=adapter.getRowNumber();
      int end=start + 1;
      int ori=TableUtil.caleVisualHeight(part,model);
      int adjustHeight=TableUtil.caleVisualHeight(part,part.getRow(getStart())) + value;
      if (getStart() != start) {
        tempValue=adjustHeight - ori;
      }
      if (start == part.getRowCount()) {
        end=start;
        resizeTable=true;
      }
 else {
        height=height + getTrueValue(tempValue,start,end);
      }
      resizeRow(tempValue,start,end);
    }
    if (resizeTable) {
      Dimension size=part.getTableAdapter().getSize();
      try {
        part.getTableAdapter().setSize(new Dimension(size.width,size.height + height));
      }
 catch (      SemanticException e) {
        part.getTableAdapter().rollBack();
        ExceptionHandler.handle(e);
      }
    }
  }
 else {
    resizeRow(value,getStart(),getEnd());
  }
  part.getTableAdapter().transEnd();
}

Fixed version (ground truth):
protected void resize(){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  int value=getLocation().y - getStartLocation().y;
  part.getTableAdapter().transStar(RESIZE_COLUMN_TRANS_LABEL);
  if (isresizeMultipleRow()) {
    List list=filterEditPart(part.getViewer().getSelectedEditParts());
    boolean resizeTable=false;
    int height=0;
    for (int i=0; i < list.size(); i++) {
      int tempValue=value;
      Object model=((EditPart)list.get(i)).getModel();
      RowHandleAdapter adapter=HandleAdapterFactory.getInstance().getRowHandleAdapter(model);
      int start=adapter.getRowNumber();
      int end=start + 1;
      int ori=TableUtil.caleVisualHeight(part,model);
      int adjustHeight=TableUtil.caleVisualHeight(part,part.getRow(getStart())) + value;
      if (getStart() != start) {
        tempValue=adjustHeight - ori;
      }
      if (start == part.getRowCount()) {
        end=start;
        resizeTable=true;
      }
 else {
        height=height + getTrueValue(tempValue,start,end);
      }
      resizeRow(tempValue,start,end);
    }
    if (resizeTable) {
      Dimension size=part.getTableAdapter().getSize();
      try {
        part.getTableAdapter().setSize(new Dimension(-1,size.height + height));
      }
 catch (      SemanticException e) {
        part.getTableAdapter().rollBack();
        ExceptionHandler.handle(e);
      }
    }
  }
 else {
    resizeRow(value,getStart(),getEnd());
  }
  part.getTableAdapter().transEnd();
}
Program: 70912
Project: 70912
Buggy source:
private void resizeRow(int value,int start,int end){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  if (start != end) {
    value=getTrueValue(value,start,end);
    part.resizeRow(start,end,value);
  }
 else {
    Dimension dimension=getDragWidth(start,end);
    if (value < dimension.width) {
      value=dimension.width;
    }
    TableHandleAdapter adp=HandleAdapterFactory.getInstance().getTableHandleAdapter(part.getModel());
    Dimension dm=adp.calculateSize();
    dm.height+=value;
    try {
      adp.ajustSize(dm);
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
}

Fixed version (ground truth):
private void resizeRow(int value,int start,int end){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  if (start != end) {
    value=getTrueValue(value,start,end);
    part.resizeRow(start,end,value);
  }
 else {
    Dimension dimension=getDragWidth(start,end);
    if (value < dimension.width) {
      value=dimension.width;
    }
    TableHandleAdapter adp=HandleAdapterFactory.getInstance().getTableHandleAdapter(part.getModel());
    Dimension dm=adp.calculateSize();
    dm.height+=value;
    dm.width=-1;
    try {
      adp.ajustSize(dm);
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
}
Program: 70913
Project: 70913
Buggy source:
public Object getProperty(String name){
  if (BORDER_BOTTOM_STYLE_PROP.equals(name) || BORDER_TOP_STYLE_PROP.equals(name) || BORDER_LEFT_STYLE_PROP.equals(name)|| BORDER_RIGHT_STYLE_PROP.equals(name)) {
    return DesignChoiceConstants.LINE_STYLE_SOLID;
  }
  if (BORDER_BOTTOM_WIDTH_PROP.equals(name) || BORDER_TOP_WIDTH_PROP.equals(name) || BORDER_LEFT_WIDTH_PROP.equals(name)|| BORDER_RIGHT_WIDTH_PROP.equals(name)) {
    return "String_Node_Str";
  }
  if (BORDER_BOTTOM_COLOR_PROP.equals(name) || BORDER_TOP_COLOR_PROP.equals(name) || BORDER_LEFT_COLOR_PROP.equals(name)|| BORDER_RIGHT_COLOR_PROP.equals(name)) {
    return new Integer(ColorUtil.formRGB(0xcc,0xcc,0xcc));
  }
  return null;
}

Fixed version (ground truth):
public Object getProperty(String name){
  if (BORDER_BOTTOM_STYLE_PROP.equals(name) || BORDER_TOP_STYLE_PROP.equals(name) || BORDER_LEFT_STYLE_PROP.equals(name)|| BORDER_RIGHT_STYLE_PROP.equals(name)) {
    return DesignChoiceConstants.LINE_STYLE_SOLID;
  }
  if (BORDER_BOTTOM_WIDTH_PROP.equals(name) || BORDER_TOP_WIDTH_PROP.equals(name) || BORDER_LEFT_WIDTH_PROP.equals(name)|| BORDER_RIGHT_WIDTH_PROP.equals(name)) {
    return "String_Node_Str";
  }
  if (BORDER_BOTTOM_COLOR_PROP.equals(name) || BORDER_TOP_COLOR_PROP.equals(name) || BORDER_LEFT_COLOR_PROP.equals(name)|| BORDER_RIGHT_COLOR_PROP.equals(name)) {
    return Integer.valueOf(ColorUtil.formRGB(0xcc,0xcc,0xcc));
  }
  return null;
}
Program: 70914
Project: 70914
Buggy source:
public CrosstabCellImpl(CrosstabCellHandle cch){
  super((ExtendedItemHandle)cch.getModelHandle());
  if (cch != null && cch.getModelHandle() != null) {
    id=cch.getModelHandle().getID();
  }
  if (cch instanceof AggregationCellHandle) {
    type=TYPE_AGGREGATION;
  }
}

Fixed version (ground truth):
public CrosstabCellImpl(CrosstabCellHandle cch){
  super((ExtendedItemHandle)cch.getModelHandle());
  if (cch.getModelHandle() != null) {
    id=cch.getModelHandle().getID();
  }
  if (cch instanceof AggregationCellHandle) {
    type=TYPE_AGGREGATION;
  }
}
Program: 70915
Project: 70915
Buggy source:
public CrosstabCellInstanceImpl(ICellContent content,ExtendedItemHandle modelHandle,IReportContext context){
  this.content=content;
  this.modelHandle=modelHandle;
  this.context=context;
  if (modelHandle != null) {
    id=modelHandle.getID();
  }
  try {
    IReportItem item=modelHandle.getReportItem();
    if (item instanceof AggregationCellHandle) {
      type=TYPE_AGGREGATION;
    }
  }
 catch (  ExtendedElementException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public CrosstabCellInstanceImpl(ICellContent content,ExtendedItemHandle modelHandle,IReportContext context){
  this.content=content;
  this.modelHandle=modelHandle;
  this.context=context;
  if (modelHandle != null) {
    id=modelHandle.getID();
    try {
      IReportItem item=modelHandle.getReportItem();
      if (item instanceof AggregationCellHandle) {
        type=TYPE_AGGREGATION;
      }
    }
 catch (    ExtendedElementException e) {
      e.printStackTrace();
    }
  }
}
Program: 70917
Project: 70917
Buggy source:
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (getStaleType() == IPageStaleType.MODEL_RELOAD) {
    reloadEditorInput();
    doSave(null);
  }
 else   if (prePage != this && (prePage.isDirty() || prePage.getStaleType() != IPageStaleType.NONE)) {
    ModuleHandle model=getProvider().getReportModuleHandle(getEditorInput(),false);
    if (ModuleUtil.compareReportVersion(ModuleUtil.getReportVersion(),model.getVersion()) > 0) {
      if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
        return false;
      }
    }
    prePage.doSave(null);
    UIUtil.doFinishSava(getModel());
    prePage.markPageStale(IPageStaleType.NONE);
    refreshDocument();
    markPageStale(IPageStaleType.NONE);
  }
  hookModelEventManager(getModel());
  ReportRequest request=new ReportRequest(ReportXMLSourceEditorFormPage.this);
  List list=new ArrayList();
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator(getModel()).notifyRequest(request);
  return true;
}

Fixed version (ground truth):
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (getStaleType() == IPageStaleType.MODEL_RELOAD) {
    reloadEditorInput();
    doSave(null);
  }
 else   if (prePage != this && (prePage.isDirty() || prePage.getStaleType() != IPageStaleType.NONE)) {
    ModuleHandle model=getProvider().getReportModuleHandle(getEditorInput(),false);
    if (ModuleUtil.compareReportVersion(ModuleUtil.getReportVersion(),model.getVersion()) > 0) {
      if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
        return false;
      }
    }
    prePage.doSave(null);
    UIUtil.doFinishSava(getModel());
    prePage.markPageStale(IPageStaleType.NONE);
    refreshDocument();
    markPageStale(IPageStaleType.NONE);
  }
  hookModelEventManager(getModel());
  ReportRequest request=new ReportRequest(ReportXMLSourceEditorFormPage.this);
  List list=new ArrayList();
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator(getModel()).notifyRequest(request);
  reportXMLEditor.setFocus();
  return true;
}
Program: 70918
Project: 70918
Buggy source:
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (getStaleType() == IPageStaleType.MODEL_RELOAD) {
    reloadEditorInput();
    doSave(null);
  }
 else   if (prePage != this && (prePage.isDirty() || prePage.getStaleType() != IPageStaleType.NONE)) {
    ModuleHandle model=getProvider().getReportModuleHandle(getEditorInput(),false);
    if (ModuleUtil.compareReportVersion(ModuleUtil.getReportVersion(),model.getVersion()) > 0) {
      if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
        return false;
      }
    }
    prePage.doSave(null);
    UIUtil.doFinishSava(getModel());
    prePage.markPageStale(IPageStaleType.NONE);
    refreshDocument();
    markPageStale(IPageStaleType.NONE);
  }
  ReportRequest request=new ReportRequest(ReportXMLSourceEditorFormPage.this);
  List list=new ArrayList();
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
  return true;
}

Fixed version (ground truth):
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (getStaleType() == IPageStaleType.MODEL_RELOAD) {
    reloadEditorInput();
    doSave(null);
  }
 else   if (prePage != this && (prePage.isDirty() || prePage.getStaleType() != IPageStaleType.NONE)) {
    ModuleHandle model=getProvider().getReportModuleHandle(getEditorInput(),false);
    if (ModuleUtil.compareReportVersion(ModuleUtil.getReportVersion(),model.getVersion()) > 0) {
      if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
        return false;
      }
    }
    prePage.doSave(null);
    UIUtil.doFinishSava(getModel());
    prePage.markPageStale(IPageStaleType.NONE);
    refreshDocument();
    markPageStale(IPageStaleType.NONE);
  }
  ReportRequest request=new ReportRequest(ReportXMLSourceEditorFormPage.this);
  List list=new ArrayList();
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
  setFocus();
  return true;
}
Program: 70919
Project: 70919
Buggy source:
/** 
 * @param dimAxisIndex
 * @param sortType
 * @return
 * @throws OLAPException
 */
protected Object fetchValueFromMirror(int dimAxisIndex,int sortType) throws OLAPException {
  if (this.dimTraverse.dimensionCursorPosition[dimAxisIndex] < 0 || this.dimTraverse.dimensionCursorPosition[dimAxisIndex] >= edgeDimensRelation.mirrorLength[dimAxisIndex])   throw new OLAPException(ResourceConstants.RD_EXPR_RESULT_SET_NOT_START);
  if (sortType == IDimensionSortDefn.SORT_UNDEFINED) {
    return this.dimAxis[dimAxisIndex].getDisctinctValue().get(this.dimTraverse.dimensionCursorPosition[dimAxisIndex]);
  }
  Collection collection=null;
  try {
    collection=fetchValueCollectionInEdgeInfo(dimAxisIndex);
  }
 catch (  IOException e) {
  }
  Vector v=this.dimAxis[dimAxisIndex].getDisctinctValue();
  v.removeAll(collection);
  Iterator iter=collection.iterator();
  if (sortType == IDimensionSortDefn.SORT_ASC) {
    for (int i=0, startSize=v.size(); i < collection.size(); i++) {
      v.insertElementAt(iter.next(),startSize);
      startSize++;
    }
  }
 else {
    int index=0;
    while (iter.hasNext()) {
      v.insertElementAt(iter.next(),index);
      index++;
    }
  }
  return v.get(this.dimTraverse.dimensionCursorPosition[dimAxisIndex]);
}

Fixed version (ground truth):
/** 
 * @param dimAxisIndex
 * @param sortType
 * @return
 * @throws OLAPException
 */
protected Object fetchValueFromMirror(int dimAxisIndex,int sortType) throws OLAPException {
  if (this.dimTraverse.dimensionCursorPosition[dimAxisIndex] < 0 || this.dimTraverse.dimensionCursorPosition[dimAxisIndex] >= edgeDimensRelation.mirrorLength[dimAxisIndex])   throw new OLAPException(ResourceConstants.RD_EXPR_RESULT_SET_NOT_START);
  if (sortType == IDimensionSortDefn.SORT_UNDEFINED) {
    Collection collection=null;
    try {
      collection=fetchValueCollectionInEdgeInfo(dimAxisIndex);
    }
 catch (    IOException e) {
    }
    Vector v=this.dimAxis[dimAxisIndex].getDisctinctValue();
    v.removeAll(collection);
    Iterator iter=collection.iterator();
    for (int i=0, startSize=v.size(); i < collection.size(); i++) {
      v.insertElementAt(iter.next(),startSize);
      startSize++;
    }
    return v.get(this.dimTraverse.dimensionCursorPosition[dimAxisIndex]);
  }
 else   return this.dimAxis[dimAxisIndex].getDisctinctValue().get(this.dimTraverse.dimensionCursorPosition[dimAxisIndex]);
}
Program: 70920
Project: 70920
Buggy source:
/** 
 * @return
 */
private Vector populateValueVector(AggrSortDefinition aggrSortDefinition){
  Set valueSet=new HashSet();
  if (aggrSortDefinition != null) {
    aggrSortType=aggrSortDefinition.getSortDirection();
  }
  for (int i=0; i < this.rs.length(); i++) {
    try {
      this.rs.seek(i);
    }
 catch (    IOException e) {
    }
    valueSet.add(this.rs.getLevelKeyValue(levelIndex)[this.rs.getLevelKeyColCount(levelIndex) - 1]);
  }
  final int sortType=this.rs.getSortType(levelIndex);
  Object[] value=valueSet.toArray();
  Arrays.sort(value,new Comparator(){
    public int compare(    final Object arg0,    final Object arg1){
      if (sortType == IDimensionSortDefn.SORT_ASC || sortType == IDimensionSortDefn.SORT_UNDEFINED)       return ((Comparable)arg0).compareTo(arg1);
 else       return ((Comparable)arg0).compareTo(arg1) * -1;
    }
  }
);
  Vector v=new Vector();
  v.addAll(Arrays.asList(value));
  return v;
}

Fixed version (ground truth):
/** 
 * @return
 */
private Vector populateValueVector(AggrSortDefinition aggrSortDefinition){
  Set valueSet=new HashSet();
  if (aggrSortDefinition != null) {
    if (aggrSortDefinition.getAxisQualifierLevel().length == 0)     aggrSortType=aggrSortDefinition.getSortDirection();
 else     aggrSortType=IDimensionSortDefn.SORT_UNDEFINED;
  }
  for (int i=0; i < this.rs.length(); i++) {
    try {
      this.rs.seek(i);
    }
 catch (    IOException e) {
    }
    valueSet.add(this.rs.getLevelKeyValue(levelIndex)[this.rs.getLevelKeyColCount(levelIndex) - 1]);
  }
  final int sortType=this.rs.getSortType(levelIndex);
  Object[] value=valueSet.toArray();
  Arrays.sort(value,new Comparator(){
    public int compare(    final Object arg0,    final Object arg1){
      if (sortType == IDimensionSortDefn.SORT_ASC || sortType == IDimensionSortDefn.SORT_UNDEFINED)       return ((Comparable)arg0).compareTo(arg1);
 else       return ((Comparable)arg0).compareTo(arg1) * -1;
    }
  }
);
  Vector v=new Vector();
  v.addAll(Arrays.asList(value));
  return v;
}
Program: 70921
Project: 70921
Buggy source:
protected BookmarkDef getBookmark(IContent content){
  String bookmarkName=content.getBookmark();
  if (bookmarkName == null)   return null;
  BookmarkDef bookmark=new BookmarkDef(content.getBookmark());
  if (!ExcelUtil.isValidBookmarkName(bookmarkName) || bookmarkName.startsWith(AUTO_GENERATED_BOOKMARK)) {
    bookmark.setGeneratedName(getGenerateBookmark());
  }
  return bookmark;
}

Fixed version (ground truth):
protected BookmarkDef getBookmark(IContent content){
  String bookmarkName=content.getBookmark();
  if (bookmarkName == null)   return null;
  BookmarkDef bookmark=new BookmarkDef(content.getBookmark());
  if (!ExcelUtil.isValidBookmarkName(bookmarkName)) {
    bookmark.setGeneratedName(engine.getGenerateBookmark(bookmarkName));
  }
  return bookmark;
}
Program: 70922
Project: 70922
Buggy source:
public static boolean isValidBookmarkName(String name){
  if (name.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
  if (name.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
  for (int i=0; i < name.length(); i++) {
    if (invalidBookmarkChars.indexOf(name.charAt(i)) != -1) {
      return false;
    }
  }
  if (name.matches("String_Node_Str")) {
    return false;
  }
  if (name.matches("String_Node_Str")) {
    String[] strs=name.split("String_Node_Str");
    if (strs.length > 0) {
      int rowId=0;
      try {
        rowId=Integer.parseInt(strs[strs.length - 1]);
      }
 catch (      NumberFormatException e) {
        return true;
      }
      if (rowId <= 65536) {
        return false;
      }
 else {
        return true;
      }
    }
    return true;
  }
  return true;
}

Fixed version (ground truth):
public static boolean isValidBookmarkName(String name){
  if (name.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
  if (name.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
  if (name.startsWith(ExcelLayoutEngine.AUTO_GENERATED_BOOKMARK)) {
    return false;
  }
  for (int i=0; i < name.length(); i++) {
    if (invalidBookmarkChars.indexOf(name.charAt(i)) != -1) {
      return false;
    }
  }
  if (name.matches("String_Node_Str")) {
    return false;
  }
  if (name.matches("String_Node_Str")) {
    String[] strs=name.split("String_Node_Str");
    if (strs.length > 0) {
      int rowId=0;
      try {
        rowId=Integer.parseInt(strs[strs.length - 1]);
      }
 catch (      NumberFormatException e) {
        return true;
      }
      if (rowId <= 65536) {
        return false;
      }
 else {
        return true;
      }
    }
    return true;
  }
  return true;
}
Program: 70923
Project: 70923
Buggy source:
public void complete(){
  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;
      }
      int styleid=engine.getStyleID(data.getStyle());
      data.setStyleId(styleid);
      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) {
          data.setLinkedBookmark(bookmarkList.get(hyperLink.getUrl()));
        }
      }
    }
  }
}

Fixed version (ground truth):
public void complete(){
  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;
      }
      int styleid=engine.getStyleID(data.getStyle());
      data.setStyleId(styleid);
      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);
        }
      }
    }
  }
}
Program: 70924
Project: 70924
Buggy source:
BirtMath(String functionName) throws BirtException {
  if ("String_Node_Str".equals(functionName))   this.executor=new Function_Add();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_Subtract();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_Multiple();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_Divide();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_Round();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_RoundUp();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_RoundDown();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_Ceiling();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_Mod();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_SafeDivide();
 else   throw new BirtException("String_Node_Str",null,Messages.getString("String_Node_Str") + "String_Node_Str" + functionName);
}

Fixed version (ground truth):
BirtMath(String functionName) throws BirtException {
  if ("String_Node_Str".equals(functionName))   this.executor=new Function_Add();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_Subtract();
 else   if ("String_Node_Str".equals(functionName) || "String_Node_Str".equals(functionName))   this.executor=new Function_Multiple();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_Divide();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_Round();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_RoundUp();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_RoundDown();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_Ceiling();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_Mod();
 else   if ("String_Node_Str".equals(functionName))   this.executor=new Function_SafeDivide();
 else   throw new BirtException("String_Node_Str",null,Messages.getString("String_Node_Str") + "String_Node_Str" + functionName);
}
Program: 70925
Project: 70925
Buggy source:
/** 
 * @param imageName
 * @param imageTitle
 * @param width
 * @param height
 * @param x
 * @param y
 */
private void exportImageDefn(String imageName,String imageTitle,double width,double height,double x,double y,String link){
  println("String_Node_Str" + (shapeCount) + "String_Node_Str");
  if (link != null) {
    print("String_Node_Str" + link + "String_Node_Str");
  }
  println("String_Node_Str" + x + "String_Node_Str"+ y+ "String_Node_Str"+ width+ "String_Node_Str"+ height+ "String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str" + imageName + "String_Node_Str"+ imageTitle+ "String_Node_Str");
  println("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param imageName
 * @param imageTitle
 * @param width
 * @param height
 * @param x
 * @param y
 */
private void exportImageDefn(String imageName,String imageTitle,double width,double height,double x,double y,String link){
  println("String_Node_Str" + (shapeCount) + "String_Node_Str");
  if (link != null) {
    link=codeLink(link);
    print("String_Node_Str" + link + "String_Node_Str");
  }
  println("String_Node_Str" + x + "String_Node_Str"+ y+ "String_Node_Str"+ width+ "String_Node_Str"+ height+ "String_Node_Str");
  println("String_Node_Str");
  println("String_Node_Str" + imageName + "String_Node_Str"+ imageTitle+ "String_Node_Str");
  println("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  println("String_Node_Str");
}
Program: 70926
Project: 70926
Buggy source:
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  ModuleHandle model=getProvider().getReportModuleHandle(getEditorInput());
  if (model != null && getModel() != model) {
    Object oldModel=getModel();
    setModel(model);
    rebuildReportDesign(oldModel);
    if (getModel() != null) {
      this.getGraphicalViewer().setContents(getModel());
      hookModelEventManager(getModel());
      markPageStale(IPageStaleType.NONE);
    }
    updateStackActions();
  }
  GraphicalViewer view=getGraphicalViewer();
  if (view != null) {
    UIUtil.resetViewSelection(view,true);
  }
  return true;
}

Fixed version (ground truth):
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  ModuleHandle model=getProvider().getReportModuleHandle(getEditorInput());
  if (model != null && getModel() != model) {
    Object oldModel=getModel();
    setModel(model);
    rebuildReportDesign(oldModel);
    if (getModel() != null) {
      this.getGraphicalViewer().setContents(getModel());
      hookModelEventManager(getModel());
      markPageStale(IPageStaleType.NONE);
      if (oldModel instanceof ReportDesignHandle) {
        if (!((ReportDesignHandle)getModel()).getBidiOrientation().equals(((ReportDesignHandle)oldModel).getBidiOrientation())) {
          String newOrientation=((ReportDesignHandle)getModel()).getBidiOrientation();
          UIUtil.processOrientationChange(newOrientation,getGraphicalViewer());
        }
      }
    }
    updateStackActions();
  }
  GraphicalViewer view=getGraphicalViewer();
  if (view != null) {
    UIUtil.resetViewSelection(view,true);
  }
  return true;
}
Program: 70927
Project: 70927
Buggy source:
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  ModuleHandle model=getProvider().getReportModuleHandle(getEditorInput());
  if (model != null && getModel() != model) {
    Object oldModel=getModel();
    getProvider().connect(model);
    setModel(model);
    rebuildReportDesign(oldModel);
    if (getModel() != null) {
      setViewContentsAsMasterPage();
      markPageStale(IPageStaleType.NONE);
    }
    updateStackActions();
  }
  GraphicalViewer view=getGraphicalViewer();
  UIUtil.resetViewSelection(view,true);
  return true;
}

Fixed version (ground truth):
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  ModuleHandle model=getProvider().getReportModuleHandle(getEditorInput());
  if (model != null && getModel() != model) {
    Object oldModel=getModel();
    getProvider().connect(model);
    setModel(model);
    rebuildReportDesign(oldModel);
    if (getModel() != null) {
      setViewContentsAsMasterPage();
      markPageStale(IPageStaleType.NONE);
      if (oldModel instanceof ReportDesignHandle) {
        if (!((ReportDesignHandle)getModel()).getBidiOrientation().equals(((ReportDesignHandle)oldModel).getBidiOrientation())) {
          String newOrientation=((ReportDesignHandle)getModel()).getBidiOrientation();
          UIUtil.processOrientationChange(newOrientation,getGraphicalViewer());
        }
      }
    }
    updateStackActions();
  }
  GraphicalViewer view=getGraphicalViewer();
  UIUtil.resetViewSelection(view,true);
  return true;
}
Program: 70928
Project: 70928
Buggy source:
@Override protected void propertyChange(Map info){
  boolean invalidate=false;
  if (info.get(ReportDesignHandle.BIDI_ORIENTATION_PROP) instanceof ReportDesignHandle) {
    String newOrientation=((ReportDesignHandle)info.get(ReportDesignHandle.BIDI_ORIENTATION_PROP)).getBidiOrientation();
    boolean mirrored=DesignChoiceConstants.BIDI_DIRECTION_RTL.equals(newOrientation);
    this.getViewer().flush();
    Composite parent=getViewer().getControl().getParent();
    BidiUIUtils.INSTANCE.applyOrientation(parent,mirrored);
    parent.layout(true);
    getViewer().setProperty(IReportGraphicConstants.REPORT_BIDIORIENTATION_PROPERTY,newOrientation);
    invalidate=true;
  }
  super.propertyChange(info);
  if (invalidate) {
    getFigure().invalidateTree();
    getFigure().revalidate();
  }
}

Fixed version (ground truth):
@Override protected void propertyChange(Map info){
  boolean invalidate=false;
  if (info.get(ReportDesignHandle.BIDI_ORIENTATION_PROP) instanceof ReportDesignHandle) {
    String newOrientation=((ReportDesignHandle)info.get(ReportDesignHandle.BIDI_ORIENTATION_PROP)).getBidiOrientation();
    UIUtil.processOrientationChange(newOrientation,getViewer());
    invalidate=true;
  }
  super.propertyChange(info);
  if (invalidate) {
    getFigure().invalidateTree();
    getFigure().revalidate();
  }
}
Program: 70930
Project: 70930
Buggy source:
public static DataEngineContext newInstance(int mode,ScriptContext context,IDocArchiveReader reader,IDocArchiveWriter writer,ClassLoader classLoader) throws BirtException {
  DataEngineContext result=new DataEngineContext(mode,context.getSharedScope(),reader,writer,classLoader);
  result.scriptContext=context;
  return result;
}

Fixed version (ground truth):
public static DataEngineContext newInstance(int mode,ScriptContext context,IDocArchiveReader reader,IDocArchiveWriter writer,ClassLoader classLoader) throws BirtException {
  DataEngineContext result=new DataEngineContext(mode,context.getSharedScope(),reader,writer,classLoader,context);
  return result;
}