nus-yam/ex-repair huggingface dataset:
Program: 69359
Project: 69359
Buggy source:
protected Control createDialogArea(Composite parent){
  Composite composite=new Composite(parent,SWT.None);
  GridLayout parentLayout=new GridLayout();
  parentLayout.marginLeft=parentLayout.marginTop=parentLayout.marginRight=10;
  parentLayout.marginBottom=15;
  composite.setLayout(parentLayout);
  GridData data=new GridData(GridData.FILL_BOTH);
  composite.setLayoutData(data);
  Label message=new Label(composite,SWT.BOLD);
  message.setFont(new Font(Display.getCurrent(),"String_Node_Str",13,SWT.BOLD));
  message.setText(Messages.getFormattedString("String_Node_Str",new Object[]{this.dataSourceHandle.getQualifiedName()}));
  createSeparator(composite,1);
  Composite content=new Composite(composite,SWT.None);
  GridLayout layout=new GridLayout();
  layout.marginTop=15;
  layout.marginWidth=10;
  layout.numColumns=2;
  content.setLayout(layout);
  GridData layoutData=new GridData(GridData.FILL_BOTH);
  content.setLayoutData(layoutData);
  createCheckboxArea(content);
  createSeparator(content,2);
  createNameText(content);
  return parent;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  Composite composite=new Composite(parent,SWT.None);
  GridLayout parentLayout=new GridLayout();
  parentLayout.marginLeft=parentLayout.marginTop=parentLayout.marginRight=10;
  parentLayout.marginBottom=5;
  composite.setLayout(parentLayout);
  GridData data=new GridData(GridData.FILL_BOTH);
  composite.setLayoutData(data);
  Label message=new Label(composite,SWT.BOLD);
  message.setText(Messages.getFormattedString("String_Node_Str",new Object[]{this.dataSourceHandle.getQualifiedName()}));
  createSeparator(composite,1);
  Composite content=new Composite(composite,SWT.None);
  GridLayout layout=new GridLayout();
  layout.marginWidth=10;
  layout.numColumns=2;
  content.setLayout(layout);
  GridData layoutData=new GridData(GridData.FILL_BOTH);
  content.setLayoutData(layoutData);
  createCheckboxArea(content);
  createSeparator(content,2);
  createNameText(content);
  return parent;
}
Program: 69360
Project: 69360
Buggy source:
private void createSeparator(Composite composite,int span){
  Label separator=new Label(composite,SWT.HORIZONTAL | SWT.SEPARATOR);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.verticalIndent=10;
  gd.horizontalSpan=span;
  separator.setLayoutData(gd);
}

Fixed version (ground truth):
private void createSeparator(Composite composite,int span){
  Label separator=new Label(composite,SWT.HORIZONTAL | SWT.SEPARATOR);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.verticalIndent=5;
  gd.horizontalSpan=span;
  separator.setLayoutData(gd);
}
Program: 69362
Project: 69362
Buggy source:
public boolean performOk(){
  for (int i=0; i < bindingName.size(); i++) {
    try {
      String value=null;
      Text propertyText=(Text)propertyTextList.get(i);
      if (!propertyText.isDisposed() && propertyText.getText() != null && propertyText.getText().trim().length() > 0) {
        value=propertyText.getText().trim();
      }
      Expression expr=new Expression(value,(String)propertyText.getData(DataUIConstants.EXPR_TYPE));
      if (ds instanceof DesignElementHandle) {
        ((DesignElementHandle)ds).setPropertyBinding((String)bindingName.get(i),expr);
      }
    }
 catch (    SemanticException e) {
      logger.log(Level.FINE,e.getMessage(),e);
    }
  }
  return super.performOk();
}

Fixed version (ground truth):
public boolean performOk(){
  for (int i=0; i < bindingName.size(); i++) {
    try {
      String value=null;
      Text propertyText=(Text)propertyTextList.get(i);
      if (!propertyText.isDisposed() && propertyText.getText() != null && propertyText.getText().trim().length() > 0) {
        value=propertyText.getText().trim();
      }
      Expression expr=new Expression(value,(String)propertyText.getData(DataUIConstants.EXPR_TYPE));
      if (ds instanceof DesignElementHandle) {
        ((DesignElementHandle)ds).setPropertyBinding((String)bindingName.get(i),expr);
      }
    }
 catch (    Exception e) {
      logger.log(Level.FINE,e.getMessage(),e);
      ExceptionHandler.handle(e);
      return true;
    }
  }
  return super.performOk();
}
Program: 69365
Project: 69365
Buggy source:
public void widgetSelected(SelectionEvent e){
  Object source=e.getSource();
  if (source == fCmbAggregate) {
    String aggFunc=((String[])fCmbAggregate.getData())[fCmbAggregate.getSelectionIndex()];
    showAggregateParameters(aggFunc);
    if (AGG_FUNC_NONE.equals(aggFunc)) {
      fGrouping.setEnabled(false);
      fGrouping.setAggregateExpression(null);
    }
 else {
      fGrouping.setEnabled(true);
      fGrouping.setAggregateExpression(aggFunc);
    }
  }
 else   if (isAggParametersWidget(source)) {
    setAggParameter((Text)source);
  }
 else   if (isBuilderBtnWidget(source)) {
    try {
      Text txtArg=fExprBuilderWidgetsMap.get(source);
      String sExpr=fChartContext.getUIServiceProvider().invoke(IUIServiceProvider.COMMAND_EXPRESSION_DATA_BINDINGS,txtArg.getText(),fChartContext.getExtendedItem(),fTitle);
      txtArg.setText(sExpr);
      setAggParameter(txtArg);
    }
 catch (    ChartException e1) {
      WizardBase.displayException(e1);
    }
  }
 else   if (source == fBtnOK) {
    if (query != null) {
      query.setGrouping(fGrouping);
      query.getGrouping().eAdapters().addAll(query.eAdapters());
    }
 else {
      fSeriesDefi.setGrouping(fGrouping);
      fSeriesDefi.getGrouping().eAdapters().addAll(fSeriesDefi.eAdapters());
    }
    ChartUIUtil.checkAggregateType(fChartContext);
    closeAggregateEditor(getShell());
  }
 else   if (source == fBtnCancel) {
    closeAggregateEditor(getShell());
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  Object source=e.getSource();
  if (source == fCmbAggregate) {
    String aggFunc=((String[])fCmbAggregate.getData())[fCmbAggregate.getSelectionIndex()];
    showAggregateParameters(aggFunc);
    if (AGG_FUNC_NONE.equals(aggFunc)) {
      fGrouping.setEnabled(false);
      fGrouping.setAggregateExpression(null);
    }
 else {
      fGrouping.setEnabled(true);
      fGrouping.setAggregateExpression(aggFunc);
    }
  }
 else   if (isAggParametersWidget(source)) {
    setAggParameter((Text)source);
  }
 else   if (isBuilderBtnWidget(source)) {
    try {
      Text txtArg=fExprBuilderWidgetsMap.get(source);
      String sExpr=fChartContext.getUIServiceProvider().invoke(IUIServiceProvider.COMMAND_EXPRESSION_DATA_BINDINGS,txtArg.getText(),fChartContext.getExtendedItem(),fTitle);
      txtArg.setText(sExpr);
      setAggParameter(txtArg);
    }
 catch (    ChartException e1) {
      WizardBase.displayException(e1);
    }
  }
 else   if (source == fBtnOK) {
    if (query != null) {
      query.setGrouping(fGrouping);
      query.getGrouping().eAdapters().addAll(query.eAdapters());
    }
 else {
      fSeriesDefi.setGrouping(fGrouping);
      fSeriesDefi.getGrouping().eAdapters().addAll(fSeriesDefi.eAdapters());
    }
    ChartUIUtil.checkAggregateType(fChartContext);
    DataDefinitionTextManager.getInstance().updateTooltip();
    closeAggregateEditor(getShell());
  }
 else   if (source == fBtnCancel) {
    closeAggregateEditor(getShell());
  }
}
Program: 69366
Project: 69366
Buggy source:
/** 
 * Handle grouping/sorting action.
 */
protected void handleGroupAction(){
  SeriesDefinition sdBackup=seriesdefinition.copyInstance();
  GroupSortingDialog groupDialog=createGroupSortingDialog(sdBackup);
  if (groupDialog.open() == Window.OK) {
    if (!sdBackup.eIsSet(DataPackage.eINSTANCE.getSeriesDefinition_Sorting())) {
      seriesdefinition.eUnset(DataPackage.eINSTANCE.getSeriesDefinition_Sorting());
    }
 else {
      seriesdefinition.setSorting(sdBackup.getSorting());
    }
    seriesdefinition.setSortKey(sdBackup.getSortKey());
    seriesdefinition.getSortKey().eAdapters().addAll(seriesdefinition.eAdapters());
    seriesdefinition.setGrouping(sdBackup.getGrouping());
    seriesdefinition.getGrouping().eAdapters().addAll(seriesdefinition.eAdapters());
    ChartUIUtil.checkGroupType(context,context.getModel());
    ChartUIUtil.checkAggregateType(context);
  }
}

Fixed version (ground truth):
/** 
 * Handle grouping/sorting action.
 */
protected void handleGroupAction(){
  SeriesDefinition sdBackup=seriesdefinition.copyInstance();
  GroupSortingDialog groupDialog=createGroupSortingDialog(sdBackup);
  if (groupDialog.open() == Window.OK) {
    if (!sdBackup.eIsSet(DataPackage.eINSTANCE.getSeriesDefinition_Sorting())) {
      seriesdefinition.eUnset(DataPackage.eINSTANCE.getSeriesDefinition_Sorting());
    }
 else {
      seriesdefinition.setSorting(sdBackup.getSorting());
    }
    seriesdefinition.setSortKey(sdBackup.getSortKey());
    seriesdefinition.getSortKey().eAdapters().addAll(seriesdefinition.eAdapters());
    seriesdefinition.setGrouping(sdBackup.getGrouping());
    seriesdefinition.getGrouping().eAdapters().addAll(seriesdefinition.eAdapters());
    ChartUIUtil.checkGroupType(context,context.getModel());
    ChartUIUtil.checkAggregateType(context);
    DataDefinitionTextManager.getInstance().updateTooltip();
  }
}
Program: 69367
Project: 69367
Buggy source:
private String getTooltipForDataText(String queryText){
  if (isTableSharedBinding()) {
    int index=cmbDefinition.getSelectionIndex();
    if (index >= 0) {
      ColumnBindingInfo cbi=(ColumnBindingInfo)((Object[])cmbDefinition.getData())[index];
      if (cbi.getColumnType() == ColumnBindingInfo.GROUP_COLUMN || cbi.getColumnType() == ColumnBindingInfo.AGGREGATE_COLUMN) {
        return cbi.getTooltip();
      }
    }
  }
  if (queryText.trim().length() == 0) {
    return tooltipWhenBlank;
  }
  return queryText;
}

Fixed version (ground truth):
private String getTooltipForDataText(String queryText){
  if (isTableSharedBinding()) {
    int index=cmbDefinition.getSelectionIndex();
    if (index >= 0) {
      ColumnBindingInfo cbi=(ColumnBindingInfo)((Object[])cmbDefinition.getData())[index];
      if (cbi.getColumnType() == ColumnBindingInfo.GROUP_COLUMN || cbi.getColumnType() == ColumnBindingInfo.AGGREGATE_COLUMN) {
        return cbi.getTooltip();
      }
    }
  }
  if (queryText.trim().length() == 0) {
    return tooltipWhenBlank;
  }
  if (ChartUIConstants.QUERY_VALUE.equals(queryType) && context.getDataServiceProvider().checkState(IDataServiceProvider.HAS_DATA_SET)) {
    SeriesDefinition baseSd=ChartUIUtil.getBaseSeriesDefinitions(context.getModel()).get(0);
    SeriesGrouping sg=null;
    if (baseSd.getGrouping() != null && baseSd.getGrouping().isEnabled()) {
      sg=baseSd.getGrouping();
      if (seriesdefinition.getGrouping() != null && seriesdefinition.getGrouping().isEnabled()) {
        sg=seriesdefinition.getGrouping();
      }
      if (query.getGrouping() != null && query.getGrouping().isEnabled()) {
        sg=query.getGrouping();
      }
    }
    if (sg != null) {
      StringBuffer sbuf=new StringBuffer();
      sbuf.append(sg.getAggregateExpression());
      sbuf.append("String_Node_Str");
      sbuf.append(queryText);
      IAggregateFunction aFunc=null;
      try {
        aFunc=PluginSettings.instance().getAggregateFunction(sg.getAggregateExpression());
      }
 catch (      ChartException e) {
      }
      int count=aFunc != null ? aFunc.getParametersCount() : sg.getAggregateParameters().size();
      for (int i=0; i < sg.getAggregateParameters().size(); i++) {
        if (i < count) {
          sbuf.append("String_Node_Str");
          sbuf.append(sg.getAggregateParameters().get(i));
        }
      }
      sbuf.append("String_Node_Str");
      return sbuf.toString();
    }
  }
  return queryText;
}
Program: 69368
Project: 69368
Buggy source:
/** 
 * Set tooltip for input control.
 */
private void setTooltipForInputControl(){
  getInputControl().setToolTipText(getTooltipForDataText(getExpression(getInputControl())));
}

Fixed version (ground truth):
/** 
 * Set tooltip for input control.
 */
public void setTooltipForInputControl(){
  getInputControl().setToolTipText(getTooltipForDataText(getExpression(getInputControl())));
}
Program: 69369
Project: 69369
Buggy source:
public ColumnBindingMetaData(IBaseQueryDefinition queryDefn,IResultClass rsClass) throws DataException {
  bindingList=new ArrayList<Binding>();
  bindingList.addAll(queryDefn.getBindings().values());
  if (((QueryDefinition)queryDefn).needAutoBinding() && rsClass != null) {
    IResultMetaData metaData=new ResultMetaData(rsClass);
    aliasMap=new HashMap<Integer,String>();
    int columnCount=metaData.getColumnCount();
    for (int i=0; i < columnCount; i++) {
      int colIndex=i + 1;
      try {
        String colName=metaData.getColumnName(colIndex);
        if (isTemp(colName)) {
          continue;
        }
        String alias=metaData.getColumnAlias(colIndex);
        if (alias != null) {
          aliasMap.put(new Integer(colIndex),alias);
        }
        ScriptExpression baseExpr=new ScriptExpression(ExpressionUtil.createJSDataSetRowExpression(colName),metaData.getColumnType(colIndex));
        Binding binding=new Binding(colName,baseExpr);
        binding.setDisplayName(colName);
        bindingList.add(binding);
      }
 catch (      BirtException e) {
      }
    }
  }
}

Fixed version (ground truth):
public ColumnBindingMetaData(IBaseQueryDefinition queryDefn,IResultClass rsClass) throws DataException {
  bindingList=new ArrayList<Binding>();
  bindingList.addAll(queryDefn.getBindings().values());
  if (((QueryDefinition)queryDefn).needAutoBinding() && rsClass != null) {
    IResultMetaData metaData=new ResultMetaData(rsClass);
    aliasMap=new HashMap<Integer,String>();
    int columnCount=metaData.getColumnCount();
    for (int i=0; i < columnCount; i++) {
      int colIndex=i + 1;
      try {
        String colName=metaData.getColumnName(colIndex);
        if (isTemp(colName)) {
          continue;
        }
        String alias=metaData.getColumnAlias(colIndex);
        if (alias != null) {
          aliasMap.put(new Integer(colIndex),alias);
        }
        ScriptExpression baseExpr=new ScriptExpression(ExpressionUtil.createJSDataSetRowExpression(colName),metaData.getColumnType(colIndex));
        Binding binding=new Binding(colName,baseExpr);
        binding.setDisplayName(metaData.getColumnLabel(colIndex));
        bindingList.add(binding);
      }
 catch (      BirtException e) {
      }
    }
  }
}
Program: 69370
Project: 69370
Buggy source:
public IBinding adaptBinding(ComputedColumnHandle handle){
  try {
    if (handle == null)     return null;
    Binding result=new Binding(handle.getName());
    if (handle.getExpression() != null) {
      ScriptExpression expr=this.adaptExpression((Expression)handle.getExpressionProperty(org.eclipse.birt.report.model.api.elements.structures.ComputedColumn.EXPRESSION_MEMBER).getValue(),handle.getDataType());
      expr.setGroupName(handle.getAggregateOn());
      result.setExpression(expr);
    }
    result.setDataType(org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType(handle.getDataType()));
    result.setAggrFunction(org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelAggregationType(handle.getAggregateFunction()));
    result.setFilter(handle.getFilterExpression() == null ? null : this.adaptExpression((Expression)handle.getExpressionProperty(org.eclipse.birt.report.model.api.elements.structures.ComputedColumn.FILTER_MEMBER).getValue(),DesignChoiceConstants.COLUMN_DATA_TYPE_BOOLEAN));
    populateArgument(result,handle);
    populateAggregateOns(result,handle);
    return result;
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
    return null;
  }
}

Fixed version (ground truth):
public IBinding adaptBinding(ComputedColumnHandle handle){
  try {
    if (handle == null)     return null;
    Binding result=new Binding(handle.getName());
    if (handle.getExpression() != null) {
      ScriptExpression expr=this.adaptExpression((Expression)handle.getExpressionProperty(org.eclipse.birt.report.model.api.elements.structures.ComputedColumn.EXPRESSION_MEMBER).getValue(),handle.getDataType());
      expr.setGroupName(handle.getAggregateOn());
      result.setExpression(expr);
    }
    result.setDisplayName(handle.getDisplayName());
    result.setDataType(org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType(handle.getDataType()));
    result.setAggrFunction(org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelAggregationType(handle.getAggregateFunction()));
    result.setFilter(handle.getFilterExpression() == null ? null : this.adaptExpression((Expression)handle.getExpressionProperty(org.eclipse.birt.report.model.api.elements.structures.ComputedColumn.FILTER_MEMBER).getValue(),DesignChoiceConstants.COLUMN_DATA_TYPE_BOOLEAN));
    populateArgument(result,handle);
    populateAggregateOns(result,handle);
    return result;
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
    return null;
  }
}
Program: 69371
Project: 69371
Buggy source:
private static String getCurrencySymbol(ULocale locale){
  NumberFormat format=NumberFormat.getCurrencyInstance(locale);
  String symbol=format.getCurrency().getSymbol();
  if (symbol.equals("String_Node_Str")) {
    symbol="String_Node_Str";
  }
  if (symbol.equals("String_Node_Str")) {
    symbol="String_Node_Str";
  }
  if (symbol.equals("String_Node_Str")) {
    symbol="String_Node_Str";
  }
  return symbol;
}

Fixed version (ground truth):
private static String getCurrencySymbol(ULocale locale){
  NumberFormat format=NumberFormat.getCurrencyInstance(locale);
  Currency currency=format.getCurrency();
  if (currency != null) {
    String symbol=currency.getSymbol(locale);
    if (symbol.equals("String_Node_Str")) {
      symbol="String_Node_Str";
    }
    if (symbol.equals("String_Node_Str")) {
      symbol="String_Node_Str";
    }
    if (symbol.equals("String_Node_Str")) {
      symbol="String_Node_Str";
    }
    if (symbol == null) {
      symbol="String_Node_Str";
    }
    return symbol;
  }
  return "String_Node_Str";
}
Program: 69373
Project: 69373
Buggy source:
/** 
 * @param parent Parent composite to which the canvas is to be added
 * @param style SWT style for this composite
 * @param fdSelected FontDefinition instance that holds the font information to be displayed
 * @param cdSelected ColorDefinition instance that provides the foreground color for text to be displayed
 */
public FontCanvas(Composite parent,int style,FontDefinition fdSelected,ColorDefinition cdSelected,boolean bUseSize,boolean bUseColor,boolean bUseAlignment){
  super(parent,style);
  this.setSize(parent.getClientArea().x,parent.getClientArea().x);
  this.fdCurrent=fdSelected == null ? FontDefinitionImpl.createEmpty() : fdSelected;
  this.cdCurrent=cdSelected == null ? ColorDefinitionImpl.create(0,0,0) : cdSelected;
  this.bUseColor=bUseColor;
  this.bUseAlignment=bUseAlignment;
  this.bUseSize=bUseSize;
  try {
    idr=PluginSettings.instance().getDevice("String_Node_Str");
  }
 catch (  ChartException pex) {
    idr=null;
    WizardBase.displayException(pex);
  }
  addDisposeListener(this);
  addPaintListener(this);
}

Fixed version (ground truth):
/** 
 * @param parent Parent composite to which the canvas is to be added
 * @param style SWT style for this composite
 * @param fdSelected FontDefinition instance that holds the font information to be displayed
 * @param cdSelected ColorDefinition instance that provides the foreground color for text to be displayed
 */
public FontCanvas(Composite parent,int style,FontDefinition fdSelected,ColorDefinition cdSelected,boolean bUseSize,boolean bUseColor,boolean bUseAlignment){
  super(parent,style);
  this.setSize(parent.getClientArea().x,parent.getClientArea().x);
  this.fdCurrent=fdSelected == null ? FontDefinitionImpl.createEmpty() : fdSelected;
  this.cdCurrent=cdSelected == null ? ColorDefinitionImpl.create(0,0,0) : cdSelected;
  this.bUseColor=bUseColor;
  this.bUseAlignment=bUseAlignment;
  this.bUseSize=bUseSize;
  try {
    idr=PluginSettings.instance().getDevice("String_Node_Str");
  }
 catch (  ChartException pex) {
    idr=null;
    WizardBase.displayException(pex);
  }
  addDisposeListener(this);
  addPaintListener(this);
  GC gc=new GC(this);
  Event e=new Event();
  e.gc=gc;
  notifyListeners(SWT.Paint,e);
}
Program: 69374
Project: 69374
Buggy source:
public Point getPreferredSize(){
  int height=btnFont.computeSize(SWT.DEFAULT,SWT.DEFAULT).y;
  return new Point(120,(24 > height) ? 24 : height);
}

Fixed version (ground truth):
public Point getPreferredSize(){
  Point bP=btnFont.computeSize(SWT.DEFAULT,SWT.DEFAULT);
  return new Point(cnvSelection.getPreferredWidth() + bP.x + 2,bP.y);
}
Program: 69380
Project: 69380
Buggy source:
public static boolean canPreviewWithErrors(ModuleHandle model){
  if (model == null) {
    return false;
  }
  model.checkReport();
  List list=model.getErrorList();
  if (list.size() > 0) {
    return MessageDialog.openConfirm(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
  return true;
}

Fixed version (ground truth):
public static boolean canPreviewWithErrors(ModuleHandle model){
  if (model == null) {
    return false;
  }
  model.checkReport();
  List errorList=model.getErrorList();
  if (errorList.size() > 0) {
    ErrorStatus status=new ErrorStatus(ReportPlugin.REPORT_UI,1009,Messages.getString("String_Node_Str"),null);
    for (int i=0; i < errorList.size(); i++) {
      ErrorDetail ed=(ErrorDetail)errorList.get(i);
      status.addError("String_Node_Str" + ed.getLineNo() + "String_Node_Str"+ ed.getMessage());
    }
    return new ErrorDialog(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),status,IStatus.OK | IStatus.INFO | IStatus.WARNING| IStatus.ERROR){
      protected void createButtonsForButtonBar(      Composite parent){
        createButton(parent,IDialogConstants.OK_ID,IDialogConstants.OK_LABEL,true);
        createButton(parent,IDialogConstants.CANCEL_ID,IDialogConstants.CANCEL_LABEL,false);
        createDetailsButton(parent);
      }
    }
.open() == Window.OK;
  }
  return true;
}
Program: 69381
Project: 69381
Buggy source:
public ImageData(IImageContent image,StyleEntry style,int datatype,Image imageInfo,XlsContainer currentContainer){
  super();
  this.style=style;
  this.dataType=datatype;
  height=imageInfo.getHeight() * ExcelUtil.PX_PT;
  double imageWidth=imageInfo.getWidth() * ExcelUtil.PX_PT;
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  container=currentContainer;
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}

Fixed version (ground truth):
public ImageData(IImageContent image,StyleEntry style,int datatype,Image imageInfo,XlsContainer currentContainer){
  super();
  this.style=style;
  this.dataType=datatype;
  height=ExcelUtil.convertImageSize(image.getHeight(),(int)(imageInfo.getHeight() * ExcelUtil.PX_PT));
  double imageWidth=ExcelUtil.convertImageSize(image.getWidth(),(int)(imageInfo.getWidth() * ExcelUtil.PX_PT));
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  container=currentContainer;
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}
Program: 69382
Project: 69382
Buggy source:
public void addImageData(IImageContent image,IStyle style,HyperlinkDef link,BookmarkDef bookmark){
  XlsContainer container=getCurrentContainer();
  ContainerSizeInfo rule=container.getSizeInfo();
  StyleEntry entry=engine.getStyle(style,rule);
  SheetData data=createImageData(image,entry,container);
  data.setHyperlinkDef(link);
  data.setBookmark(bookmark);
  data.setSizeInfo(rule);
  addData(data);
}

Fixed version (ground truth):
public void addImageData(IImageContent image,IStyle style,HyperlinkDef link,BookmarkDef bookmark){
  XlsContainer container=getCurrentContainer();
  ContainerSizeInfo parentSizeInfo=container.getSizeInfo();
  ColumnsInfo imageColumnsInfo=LayoutUtil.createImage(image,parentSizeInfo.getWidth());
  splitColumns(imageColumnsInfo,parentSizeInfo);
  StyleEntry entry=engine.getStyle(style,parentSizeInfo);
  SheetData data=createImageData(image,entry,container);
  data.setHyperlinkDef(link);
  data.setBookmark(bookmark);
  ContainerSizeInfo imageSizeInfo=new ContainerSizeInfo(parentSizeInfo.getStartCoordinate(),imageColumnsInfo.getTotalWidth());
  data.setSizeInfo(imageSizeInfo);
  addData(data);
}
Program: 69383
Project: 69383
Buggy source:
public static int getElementWidth(IContent content,int width){
  DimensionType value=content.getWidth();
  if (value != null) {
    try {
      width=Math.min(ExcelUtil.covertDimensionType(value,width),width);
    }
 catch (    Exception e) {
    }
  }
  return width;
}

Fixed version (ground truth):
private static int getElementWidth(DimensionType contentWdith,int width){
  try {
    width=Math.min(ExcelUtil.covertDimensionType(contentWdith,width),width);
  }
 catch (  Exception e) {
  }
  return width;
}
Program: 69384
Project: 69384
Buggy source:
public static ColumnsInfo createChart(IForeignContent content,int width){
  ExtendedItemDesign design=(ExtendedItemDesign)content.getGenerateBy();
  DimensionType value=design.getWidth();
  if (value != null) {
    width=Math.min(ExcelUtil.covertDimensionType(value,width),width);
  }
  int[] column=new int[]{width};
  return new ColumnsInfo(column);
}

Fixed version (ground truth):
public static ColumnsInfo createChart(IForeignContent content,int width){
  ExtendedItemDesign design=(ExtendedItemDesign)content.getGenerateBy();
  DimensionType value=design.getWidth();
  if (value != null) {
    width=getElementWidth(value,width);
  }
  int[] column=new int[]{width};
  return new ColumnsInfo(column);
}
Program: 69385
Project: 69385
Buggy source:
private void traverse(IArea area){
  if (area instanceof ContainerArea) {
    if (area instanceof TableArea) {
      tableIds.add(((TableArea)area).getContent().getInstanceID().toUniqueString());
    }
    ContainerArea container=(ContainerArea)area;
    if (container.content != null) {
      start(container);
    }
    if (!(container.content instanceof ForeignContent)) {
      for (Iterator<IArea> i=container.getChildren(); i.hasNext(); ) {
        IArea child=i.next();
        traverse(child);
      }
    }
  }
  String bookmark=area.getBookmark();
  if (bookmark != null) {
    context.addBookmarkMap(context.getPageNumber(),bookmark);
  }
}

Fixed version (ground truth):
private void traverse(IArea area){
  if (area instanceof ContainerArea) {
    if (area instanceof TableArea) {
      tableIds.add(((TableArea)area).getContent().getInstanceID().toUniqueString());
    }
    ContainerArea container=(ContainerArea)area;
    if (container.content != null && !container.isDummy) {
      start(container);
    }
    if (!(container.content instanceof ForeignContent)) {
      for (Iterator<IArea> i=container.getChildren(); i.hasNext(); ) {
        IArea child=i.next();
        traverse(child);
      }
    }
  }
  String bookmark=area.getBookmark();
  if (bookmark != null) {
    context.addBookmarkMap(context.getPageNumber(),bookmark);
  }
}
Program: 69386
Project: 69386
Buggy source:
public List<UnresolvedRowHint> getUnresolvedRowHints(){
  ArrayList<UnresolvedRowHint> unresolvedRowHintsList=new ArrayList<UnresolvedRowHint>();
  Iterator<String> iter=getTableKeys().iterator();
  while (iter.hasNext()) {
    String key=iter.next();
    if (unresolvedRowHints != null) {
      UnresolvedRowHint hint=unresolvedRowHints.get(key);
      if (hint != null) {
        unresolvedRowHintsList.add(hint);
        continue;
      }
    }
    UnresolvedRowHint hint=htmlUnresolvedRowHints.get(key);
    if (hint != null) {
      unresolvedRowHintsList.add(hint);
    }
  }
  return unresolvedRowHintsList;
}

Fixed version (ground truth):
public List<UnresolvedRowHint> getUnresolvedRowHints(){
  ArrayList<UnresolvedRowHint> unresolvedRowHintsList=new ArrayList<UnresolvedRowHint>();
  Iterator<String> iter=getTableKeys().iterator();
  while (iter.hasNext()) {
    String key=iter.next();
    if (docUnresolvedRowHints != null) {
      UnresolvedRowHint hint=docUnresolvedRowHints.get(key);
      if (hint != null) {
        unresolvedRowHintsList.add(hint);
        continue;
      }
    }
    UnresolvedRowHint hint=htmlUnresolvedRowHints.get(key);
    if (hint != null) {
      unresolvedRowHintsList.add(hint);
    }
  }
  return unresolvedRowHintsList;
}
Program: 69387
Project: 69387
Buggy source:
public void addUnresolvedRowHint(String tableId,UnresolvedRowHint hint){
  if (unresolvedRowHints == null) {
    unresolvedRowHints=new HashMap<String,UnresolvedRowHint>();
  }
  unresolvedRowHints.put(htmlLayoutContext.getPageHintManager().getHintMapKey(tableId),hint);
}

Fixed version (ground truth):
public void addUnresolvedRowHint(String tableId,UnresolvedRowHint hint){
  if (currentPageUnresolvedRowHints == null) {
    currentPageUnresolvedRowHints=new HashMap<String,UnresolvedRowHint>();
  }
  currentPageUnresolvedRowHints.put(htmlLayoutContext.getPageHintManager().getHintMapKey(tableId),hint);
}
Program: 69388
Project: 69388
Buggy source:
private UnresolvedRowHint convertRowToHint(RowArea row){
  IRowContent rowContent=(IRowContent)row.getContent();
  ITableContent table=rowContent.getTable();
  InstanceID tableId=table.getInstanceID();
  InstanceID rowId=rowContent.getInstanceID();
  UnresolvedRowHint hint=new UnresolvedRowHint(tableId.toUniqueString(),rowId.toUniqueString());
  for (Iterator i=row.getChildren(); i.hasNext(); ) {
    AbstractArea area=(AbstractArea)i.next();
    String style=null;
    if (area instanceof CellArea) {
      CellArea cell=(CellArea)area;
      ICellContent cellContent=(ICellContent)cell.getContent();
      if (cellContent != null) {
        style=cellContent.getStyle().getCssText();
      }
      hint.addUnresolvedCell(style,cell.columnID,cell.colSpan,cell.rowSpan);
    }
  }
  return hint;
}

Fixed version (ground truth):
private UnresolvedRowHint convertRowToHint(RowArea row){
  IRowContent rowContent=(IRowContent)row.getContent();
  ITableContent table=rowContent.getTable();
  InstanceID tableId=table.getInstanceID();
  InstanceID rowId=rowContent.getInstanceID();
  UnresolvedRowHint hint=new UnresolvedRowHint(tableId.toUniqueString(),rowId.toUniqueString());
  if (row.cells != null) {
    for (int i=0; i < row.cells.length; i++) {
      AbstractArea area=(AbstractArea)row.cells[i];
      String style=null;
      if (area instanceof DummyCell) {
        CellArea cell=((DummyCell)area).getCell();
        ICellContent cellContent=(ICellContent)cell.getContent();
        if (cellContent != null) {
          style=cellContent.getStyle().getCssText();
        }
        hint.addUnresolvedCell(style,cell.columnID,((DummyCell)area).colSpan,((DummyCell)area).rowSpan);
      }
 else       if (area instanceof CellArea) {
        CellArea cell=(CellArea)area;
        ICellContent cellContent=(ICellContent)cell.getContent();
        if (cellContent != null) {
          style=cellContent.getStyle().getCssText();
        }
        hint.addUnresolvedCell(style,cell.columnID,cell.colSpan,cell.rowSpan);
      }
    }
  }
  return hint;
}
Program: 69389
Project: 69389
Buggy source:
private CellArea createEmptyCell(CellArea upperCell,int columnId,RowArea row,RowArea lastRow){
  ICellContent cellContent=null;
  int rowSpan=1;
  if (upperCell != null) {
    cellContent=(ICellContent)upperCell.getContent();
    rowSpan=upperCell.getRowSpan() - 1;
  }
  if (cellContent == null) {
    cellContent=tableContent.getReportContent().createCellContent();
    cellContent.setColumn(columnId);
    cellContent.setColSpan(1);
    cellContent.setRowSpan(1);
    cellContent.setParent(row.getContent());
  }
  int emptyCellColID=cellContent.getColumn();
  int emptyCellColSpan=cellContent.getColSpan();
  CellArea emptyCell=upperCell.cloneArea();
  emptyCell.setHeight(0);
  emptyCell.setRowSpan(rowSpan);
  CellArea leftSideCellArea=null;
  if (emptyCellColID > startCol) {
    leftSideCellArea=row.getCell(emptyCellColID - 1);
    if (leftSideCellArea == null) {
      int k=emptyCellColID - 1;
      while (leftSideCellArea == null && k > startCol) {
        k--;
        leftSideCellArea=row.getCell(k);
      }
    }
  }
 else {
    leftSideCellArea=null;
  }
  emptyCell.setParent(row);
  row.setCell(emptyCell);
  resolveBorderConflict(emptyCell,true);
  emptyCell.setWidth(getCellWidth(emptyCellColID,emptyCellColID + emptyCellColSpan));
  emptyCell.setPosition(layoutInfo.getXPosition(columnId),0);
  if (leftSideCellArea != null) {
    int index=row.indexOf(leftSideCellArea);
    row.addChild(index + 1,emptyCell);
  }
 else {
    row.addChild(0,emptyCell);
  }
  return emptyCell;
}

Fixed version (ground truth):
private CellArea createEmptyCell(CellArea upperCell,int columnId,RowArea row,RowArea lastRow){
  ICellContent cellContent=null;
  int rowSpan=1;
  if (upperCell != null) {
    cellContent=(ICellContent)upperCell.getContent();
    rowSpan=upperCell.getRowSpan() - 1;
  }
  if (cellContent == null) {
    cellContent=tableContent.getReportContent().createCellContent();
    cellContent.setColumn(columnId);
    cellContent.setColSpan(1);
    cellContent.setRowSpan(1);
    cellContent.setParent(row.getContent());
  }
  int emptyCellColID=cellContent.getColumn();
  int emptyCellColSpan=cellContent.getColSpan();
  CellArea emptyCell=upperCell.cloneArea();
  emptyCell.setHeight(0);
  emptyCell.setRowSpan(rowSpan);
  CellArea leftSideCellArea=null;
  if (emptyCellColID > startCol) {
    leftSideCellArea=row.getCell(emptyCellColID - 1);
    if (leftSideCellArea == null) {
      int k=emptyCellColID - 1;
      while (leftSideCellArea == null && k > startCol) {
        k--;
        leftSideCellArea=row.getCell(k);
      }
    }
  }
 else {
    leftSideCellArea=null;
  }
  emptyCell.setParent(row);
  row.setCell(emptyCell);
  resolveBorderConflict(emptyCell,true);
  emptyCell.setWidth(getCellWidth(emptyCellColID,emptyCellColID + emptyCellColSpan));
  emptyCell.setPosition(layoutInfo.getXPosition(columnId),0);
  if (leftSideCellArea != null) {
    int index=row.indexOf(leftSideCellArea);
    row.addChild(index + 1,emptyCell);
  }
 else {
    row.addChild(0,emptyCell);
  }
  emptyCell.isDummy=true;
  return emptyCell;
}
Program: 69391
Project: 69391
Buggy source:
public void close() throws BirtException {
  int overFlowType=context.getPageOverflow();
  if (overFlowType == IPDFRenderOption.FIT_TO_PAGE_SIZE) {
    float scale=calculatePageScale(this);
    if (1f == scale) {
      pageContent.setExtension(IContent.LAYOUT_EXTENSION,this);
      outputPage(pageContent);
      return;
    }
    this.setScale(scale);
    getBody().setNeedClip(false);
    updatePageDimension(scale,this);
  }
 else   if (overFlowType == IPDFRenderOption.ENLARGE_PAGE_SIZE) {
    getBody().setNeedClip(false);
    updatePageDimension(this);
  }
  pageContent.setExtension(IContent.LAYOUT_EXTENSION,this);
  outputPage(pageContent);
  finished=true;
}

Fixed version (ground truth):
public void close() throws BirtException {
  int overFlowType=context.getPageOverflow();
  if (overFlowType == IPDFRenderOption.FIT_TO_PAGE_SIZE) {
    float scale=calculatePageScale(this);
    if (1f == scale) {
      pageContent.setExtension(IContent.LAYOUT_EXTENSION,this);
      outputPage(pageContent);
      return;
    }
    this.setScale(scale);
    getBody().setNeedClip(false);
    updatePageDimension(scale,this);
  }
 else   if (overFlowType == IPDFRenderOption.ENLARGE_PAGE_SIZE) {
    getBody().setNeedClip(false);
    updatePageDimension(this);
  }
  pageContent.setExtension(IContent.LAYOUT_EXTENSION,this);
  outputPage(pageContent);
  context.resetUnresolveRowHints();
  finished=true;
}
Program: 69393
Project: 69393
Buggy source:
public void endLine(boolean endParagraph) throws BirtException {
  lineCount++;
  if (getChildrenCount() > 0) {
    close(false);
  }
  if (lineParent != null) {
    lineParent.removeChild(this);
    lineParent.endLine(endParagraph);
    initialize();
  }
}

Fixed version (ground truth):
public void endLine(boolean endParagraph) throws BirtException {
  lineCount++;
  if (getChildrenCount() > 0) {
    close(false);
  }
  if (lineParent != null) {
    lineParent.endLine(endParagraph);
    initialize();
  }
}
Program: 69394
Project: 69394
Buggy source:
public void initialize() throws BirtException {
  IStyle style=content.getStyle();
  calculateSpecifiedWidth(content);
  if (style == null || style.isEmpty()) {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
  }
 else {
    buildProperties(content,context);
  }
  maxAvaWidth=parent.getCurrentMaxContentWidth();
  bookmark=content.getBookmark();
  action=content.getHyperlinkAction();
  vAlign=style.getProperty(IStyle.STYLE_VERTICAL_ALIGN);
  currentIP=0;
  currentBP=0;
  parent.add(this);
}

Fixed version (ground truth):
public void initialize() throws BirtException {
  IStyle style=content.getStyle();
  calculateSpecifiedWidth(content);
  if (style == null || style.isEmpty()) {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
  }
 else {
    buildProperties(content,context);
  }
  maxAvaWidth=parent.getCurrentMaxContentWidth();
  bookmark=content.getBookmark();
  action=content.getHyperlinkAction();
  vAlign=style.getProperty(IStyle.STYLE_VERTICAL_ALIGN);
  currentIP=0;
  currentBP=0;
}
Program: 69395
Project: 69395
Buggy source:
public LineArea(LineArea area){
  super(area);
  this.baseLevel=area.baseLevel;
}

Fixed version (ground truth):
public LineArea(LineArea area){
  super(area);
  this.baseLevel=area.baseLevel;
  this.isInlineStacking=true;
}
Program: 69396
Project: 69396
Buggy source:
public TextAreaLayout(ContainerArea parent,LayoutContext context,IContent content){
  parentLM=(InlineStackingArea)parent;
  ITextContent textContent=(ITextContent)content;
  parentLM.setTextIndent(textContent);
  String text=textContent.getText();
  if (text != null && text.length() != 0)   transform(textContent);
 else   textContent.setText("String_Node_Str");
  this.textContent=textContent;
  comp=new TextCompositor(textContent,context.getFontManager(),context);
  ContainerArea ancestor=parentLM;
  do {
    if (null == ancestor) {
      comp.setNewLineStatus(true);
      return;
    }
    if (!ancestor.isEmpty()) {
      comp.setNewLineStatus(false);
      return;
    }
    if (ancestor instanceof LineArea) {
      comp.setNewLineStatus(ancestor.isEmpty());
      return;
    }
    ancestor=ancestor.getParent();
  }
 while (true);
}

Fixed version (ground truth):
public TextAreaLayout(ContainerArea parent,LayoutContext context,IContent content){
  parentLM=(InlineStackingArea)parent;
  ITextContent textContent=(ITextContent)content;
  parentLM.setTextIndent(textContent);
  String text=textContent.getText();
  if (text != null && text.length() != 0)   transform(textContent);
 else   textContent.setText("String_Node_Str");
  this.textContent=textContent;
  comp=new TextCompositor(textContent,context.getFontManager(),context);
  LineArea lineParent=getLineParent();
  boolean isEmptyLine=isEmtpy(lineParent);
  comp.setNewLineStatus(isEmptyLine);
}
Program: 69399
Project: 69399
Buggy source:
/** 
 * @param handle
 * @return
 */
public int getBackgroundImageHeight(DesignElementHandle handle){
  DimensionHandle obj=handle.getDimensionProperty(StyleHandle.BACKGROUND_SIZE_HEIGHT);
  if (obj == null || obj.getUnits() == null || obj.getUnits().length() == 0) {
    return 0;
  }
  int fontSize=DEUtil.getFontSizeIntValue(getHandle());
  double py=0;
  py=DEUtil.convertToPixel(obj,fontSize);
  return (int)py;
}

Fixed version (ground truth):
/** 
 * @param handle
 * @return
 */
public int getBackgroundImageHeight(DesignElementHandle handle,Dimension size,Image image){
  DimensionHandle obj=handle.getDimensionProperty(StyleHandle.BACKGROUND_SIZE_HEIGHT);
  if (obj == null || obj.getUnits() == null || obj.getUnits().length() == 0) {
    if (image == null) {
      return 0;
    }
    String str=handle.getStringProperty(StyleHandle.BACKGROUND_SIZE_WIDTH);
    if (DesignChoiceConstants.BACKGROUND_SIZE_CONTAIN.equals(str)) {
      Dimension imageSize=new Dimension(image);
      if (((double)imageSize.width / ((double)imageSize.height)) > ((double)size.width / ((double)size.height))) {
        double value=((double)imageSize.height * ((double)size.width) / ((double)imageSize.width));
        return (int)value;
      }
 else {
        return size.height;
      }
    }
 else     if (DesignChoiceConstants.BACKGROUND_SIZE_COVER.equals(str)) {
      return size.height;
    }
    return 0;
  }
  int fontSize=DEUtil.getFontSizeIntValue(getHandle());
  double py=0;
  py=DEUtil.convertToPixel(obj,fontSize);
  return (int)py;
}
Program: 69400
Project: 69400
Buggy source:
/** 
 * @param handle
 * @return
 */
public int getBackgroundImageWidth(DesignElementHandle handle){
  DimensionHandle obj=handle.getDimensionProperty(StyleHandle.BACKGROUND_SIZE_WIDTH);
  if (obj == null || obj.getUnits() == null || obj.getUnits().length() == 0) {
    return 0;
  }
  int fontSize=DEUtil.getFontSizeIntValue(getHandle());
  double px=0;
  px=DEUtil.convertToPixel(obj,fontSize);
  return (int)px;
}

Fixed version (ground truth):
/** 
 * @param handle
 * @return
 */
public int getBackgroundImageWidth(DesignElementHandle handle,Dimension size,Image image){
  DimensionHandle obj=handle.getDimensionProperty(StyleHandle.BACKGROUND_SIZE_WIDTH);
  if (obj == null || obj.getUnits() == null || obj.getUnits().length() == 0) {
    if (image == null) {
      return 0;
    }
    String str=handle.getStringProperty(StyleHandle.BACKGROUND_SIZE_WIDTH);
    if (DesignChoiceConstants.BACKGROUND_SIZE_CONTAIN.equals(str)) {
      Dimension imageSize=new Dimension(image);
      if (((double)imageSize.width / ((double)imageSize.height)) > ((double)size.width / ((double)size.height))) {
        return size.width;
      }
 else {
        double value=((double)imageSize.width * ((double)size.height) / ((double)imageSize.height));
        return (int)value;
      }
    }
 else     if (DesignChoiceConstants.BACKGROUND_SIZE_COVER.equals(str)) {
      return size.width;
    }
    return 0;
  }
  int fontSize=DEUtil.getFontSizeIntValue(getHandle());
  double px=0;
  px=DEUtil.convertToPixel(obj,fontSize);
  return (int)px;
}
Program: 69401
Project: 69401
Buggy source:
public void refreshFigure(){
  int color=getBackgroundColor((MasterPageHandle)getModel());
  getFigure().setBackgroundColor(getBackGroundColor(color));
  Dimension size=getMasterPageSize((MasterPageHandle)getModel());
  Rectangle bounds=new Rectangle(0,0,size.width - 1,size.height - 1);
  ((AbstractPageFlowLayout)getFigure().getLayoutManager()).setInitSize(bounds);
  ReportDesignMarginBorder reportDesignMarginBorder=new ReportDesignMarginBorder(getMasterPageInsets((MasterPageHandle)getModel()));
  reportDesignMarginBorder.setBackgroundColor(((MasterPageHandle)getModel()).getPropertyHandle(StyleHandle.BACKGROUND_COLOR_PROP).getIntValue());
  refreshMarginBorder(reportDesignMarginBorder);
  refreshBackground((MasterPageHandle)getModel());
  ((ReportElementFigure)getFigure()).setBackGroundImageSize(getModelAdapter().getBackgroundImageWidth((MasterPageHandle)getModel()),getModelAdapter().getBackgroundImageHeight((MasterPageHandle)getModel()));
}

Fixed version (ground truth):
public void refreshFigure(){
  int color=getBackgroundColor((MasterPageHandle)getModel());
  getFigure().setBackgroundColor(getBackGroundColor(color));
  Dimension size=getMasterPageSize((MasterPageHandle)getModel());
  Rectangle bounds=new Rectangle(0,0,size.width - 1,size.height - 1);
  ((AbstractPageFlowLayout)getFigure().getLayoutManager()).setInitSize(bounds);
  ReportDesignMarginBorder reportDesignMarginBorder=new ReportDesignMarginBorder(getMasterPageInsets((MasterPageHandle)getModel()));
  reportDesignMarginBorder.setBackgroundColor(((MasterPageHandle)getModel()).getPropertyHandle(StyleHandle.BACKGROUND_COLOR_PROP).getIntValue());
  refreshMarginBorder(reportDesignMarginBorder);
  refreshBackground((MasterPageHandle)getModel());
  ((ReportElementFigure)getFigure()).setBackGroundImageSize(getModelAdapter().getBackgroundImageWidth((MasterPageHandle)getModel(),size,getBackImage((MasterPageHandle)getModel())),getModelAdapter().getBackgroundImageHeight((MasterPageHandle)getModel(),size,getBackImage((MasterPageHandle)getModel())));
}
Program: 69402
Project: 69402
Buggy source:
public void refreshFigure(){
  SimpleMasterPageHandle masterPageHandle=getSimpleMasterPageHandle();
  Dimension size=getMasterPageSize(masterPageHandle);
  Rectangle bounds=new Rectangle(0,0,size.width - 1,size.height - 1);
  ReportRootFigure figure=(ReportRootFigure)getFigure();
  figure.setShowMargin(showMargin);
  ((ReportDesignLayout)(figure.getLayoutManager())).setAuto(DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_AUTO_LAYOUT.equals(((ReportDesignHandle)getModel()).getLayoutPreference()));
  ((ReportDesignLayout)(figure.getLayoutManager())).setAuto(DesignChoiceConstants.BIDI_DIRECTION_LTR.equals(((ReportDesignHandle)getModel()).getBidiOrientation()));
  if (!showMargin) {
    Insets mg=getMasterPageInsets(masterPageHandle);
    bounds.width-=mg.getWidth();
    bounds.height-=mg.getHeight();
  }
  Insets initInsets=getMasterPageInsets(masterPageHandle);
  ((AbstractPageFlowLayout)getFigure().getLayoutManager()).setInitSize(bounds);
  ((AbstractPageFlowLayout)getFigure().getLayoutManager()).setInitInsets(initInsets);
  refreshMarginBorder((ReportDesignMarginBorder)getFigure().getBorder());
  int color=getBackgroundColor(masterPageHandle);
  getFigure().setBackgroundColor(getBackGroundColor(color));
  refreshBackground(masterPageHandle);
  ((ReportElementFigure)getFigure()).setBackGroundImageSize(getModelAdapter().getBackgroundImageWidth(masterPageHandle),getModelAdapter().getBackgroundImageHeight(masterPageHandle));
}

Fixed version (ground truth):
public void refreshFigure(){
  SimpleMasterPageHandle masterPageHandle=getSimpleMasterPageHandle();
  Dimension size=getMasterPageSize(masterPageHandle);
  Rectangle bounds=new Rectangle(0,0,size.width - 1,size.height - 1);
  ReportRootFigure figure=(ReportRootFigure)getFigure();
  figure.setShowMargin(showMargin);
  ((ReportDesignLayout)(figure.getLayoutManager())).setAuto(DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_AUTO_LAYOUT.equals(((ReportDesignHandle)getModel()).getLayoutPreference()));
  ((ReportDesignLayout)(figure.getLayoutManager())).setAuto(DesignChoiceConstants.BIDI_DIRECTION_LTR.equals(((ReportDesignHandle)getModel()).getBidiOrientation()));
  if (!showMargin) {
    Insets mg=getMasterPageInsets(masterPageHandle);
    bounds.width-=mg.getWidth();
    bounds.height-=mg.getHeight();
  }
  Insets initInsets=getMasterPageInsets(masterPageHandle);
  ((AbstractPageFlowLayout)getFigure().getLayoutManager()).setInitSize(bounds);
  ((AbstractPageFlowLayout)getFigure().getLayoutManager()).setInitInsets(initInsets);
  refreshMarginBorder((ReportDesignMarginBorder)getFigure().getBorder());
  int color=getBackgroundColor(masterPageHandle);
  getFigure().setBackgroundColor(getBackGroundColor(color));
  refreshBackground(masterPageHandle);
  ((ReportElementFigure)getFigure()).setBackGroundImageSize(getModelAdapter().getBackgroundImageWidth(masterPageHandle,size,getBackImage(masterPageHandle)),getModelAdapter().getBackgroundImageHeight(masterPageHandle,size,getBackImage(masterPageHandle)));
}