nus-yam/ex-repair huggingface dataset:
Program: 70281
Project: 70281
Buggy source:
public final Object clone(){
  final AutoScale sc=new AutoScale(iType,oMinimum,oMaximum);
  sc.oStep=oStep;
  sc.oStepNumber=this.oStepNumber;
  sc.dStart=dStart;
  sc.dEnd=dEnd;
  sc.oMaximumWithMargin=oMaximumWithMargin;
  sc.oMinimumWithMargin=oMinimumWithMargin;
  sc.iMarginPercent=iMarginPercent;
  sc.atcTickCoordinates=atcTickCoordinates;
  sc.dStartShift=dStartShift;
  sc.dEndShift=dEndShift;
  sc.dsiData=dsiData;
  sc.oUnit=oUnit;
  sc.bMaximumFixed=bMaximumFixed;
  sc.bMinimumFixed=bMinimumFixed;
  sc.bStepFixed=bStepFixed;
  sc.fs=fs;
  sc.rtc=rtc;
  sc.bIntegralZoom=bIntegralZoom;
  sc.bCategoryScale=bCategoryScale;
  sc.labelVisHelper=labelVisHelper;
  sc.iScaleDirection=iScaleDirection;
  sc.staggeredHelper=staggeredHelper;
  sc.bAxisLabelStaggered=bAxisLabelStaggered;
  sc.iLabelShowingInterval=iLabelShowingInterval;
  sc.bTickBetweenCategories=bTickBetweenCategories;
  sc.bLabelWithinAxes=bLabelWithinAxes;
  sc.iMinUnit=iMinUnit;
  sc.hmComputedLabelText=sc.hmComputedLabelText;
  sc.tmpSC=tmpSC;
  sc.bExpandMinMax=bExpandMinMax;
  sc.bAlignZero=bAlignZero;
  return sc;
}

Fixed version (ground truth):
public final Object clone(){
  final AutoScale sc=new AutoScale(iType,oMinimum,oMaximum,rtc);
  sc.oStep=oStep;
  sc.oStepNumber=this.oStepNumber;
  sc.dStart=dStart;
  sc.dEnd=dEnd;
  sc.oMaximumWithMargin=oMaximumWithMargin;
  sc.oMinimumWithMargin=oMinimumWithMargin;
  sc.iMarginPercent=iMarginPercent;
  sc.atcTickCoordinates=atcTickCoordinates;
  sc.dStartShift=dStartShift;
  sc.dEndShift=dEndShift;
  sc.dsiData=dsiData;
  sc.oUnit=oUnit;
  sc.bMaximumFixed=bMaximumFixed;
  sc.bMinimumFixed=bMinimumFixed;
  sc.bStepFixed=bStepFixed;
  sc.fs=fs;
  sc.bIntegralZoom=bIntegralZoom;
  sc.bCategoryScale=bCategoryScale;
  sc.labelVisHelper=labelVisHelper;
  sc.iScaleDirection=iScaleDirection;
  sc.staggeredHelper=staggeredHelper;
  sc.bAxisLabelStaggered=bAxisLabelStaggered;
  sc.iLabelShowingInterval=iLabelShowingInterval;
  sc.bTickBetweenCategories=bTickBetweenCategories;
  sc.bLabelWithinAxes=bLabelWithinAxes;
  sc.iMinUnit=iMinUnit;
  sc.hmComputedLabelText=sc.hmComputedLabelText;
  sc.tmpSC=tmpSC;
  sc.bExpandMinMax=bExpandMinMax;
  sc.bAlignZero=bAlignZero;
  return sc;
}
Program: 70282
Project: 70282
Buggy source:
/** 
 * The constructor.
 * @param _iType
 * @param _oMinimum
 * @param _oMaximum
 * @param _oStep
 */
public AutoScale(int _iType,Object _oMinimum,Object _oMaximum){
  iType=_iType;
  oMinimum=_oMinimum;
  oMaximum=_oMaximum;
}

Fixed version (ground truth):
/** 
 * The constructor.
 * @param _iType
 * @param _oMinimum
 * @param _oMaximum
 * @param _oStep
 */
public AutoScale(int _iType,Object _oMinimum,Object _oMaximum,RunTimeContext _rtc){
  iType=_iType;
  oMinimum=_oMinimum;
  oMaximum=_oMaximum;
  rtc=_rtc;
  cacheNumFormat=new ChartUtil.CacheDecimalFormat(rtc.getULocale());
  cacheDateFormat=new ChartUtil.CacheDateFormat(rtc.getULocale());
}
Program: 70283
Project: 70283
Buggy source:
@Override protected DecimalFormat newValue(String pattern){
  return new DecimalFormat(pattern);
}

Fixed version (ground truth):
@Override protected IDateFormatWrapper newValue(Integer iDateTimeUnit){
  return DateFormatWrapperFactory.getPreferredDateFormat(iDateTimeUnit,locale);
}
Program: 70284
Project: 70284
Buggy source:
private String parseBackgroundSize(String backgroundHeight,DimensionType pageHeight){
  int index=backgroundHeight.indexOf("String_Node_Str");
  if (index != -1) {
    String percent=backgroundHeight.substring(0,index);
    int percentValue=Integer.valueOf(percent).intValue();
    return pageHeight.getMeasure() * percentValue / 100 + pageHeight.getUnits();
  }
  return backgroundHeight;
}

Fixed version (ground truth):
private String parseBackgroundSize(String backgroundHeight,DimensionType pageHeight){
  if (backgroundHeight == null)   return null;
  backgroundHeight=backgroundHeight.trim();
  if (backgroundHeight.endsWith("String_Node_Str")) {
    try {
      String percent=backgroundHeight.substring(0,backgroundHeight.length() - 1);
      int percentValue=Integer.valueOf(percent).intValue();
      return pageHeight.getMeasure() * percentValue / 100 + pageHeight.getUnits();
    }
 catch (    NumberFormatException e) {
      return null;
    }
  }
  return backgroundHeight;
}
Program: 70285
Project: 70285
Buggy source:
private void startBackgroundContainer(IStyle style,DimensionType pageWidth,DimensionType pageHeight){
  String backgroundHeight=parseBackgroundSize(style.getBackgroundHeight(),pageHeight);
  String backgroundWidth=parseBackgroundSize(style.getBackgroundWidth(),pageWidth);
  if (backgroundHeight == null && backgroundWidth == null) {
    return;
  }
  String image=style.getBackgroundImage();
  if (image == null || "String_Node_Str".equalsIgnoreCase(image)) {
    return;
  }
  needOutputBackgroundSize=true;
  String backgroundPositionX=style.getBackgroundPositionX();
  if (backgroundPositionX == null) {
    backgroundPositionX="String_Node_Str";
  }
  String backgroundPositionY=style.getBackgroundPositionY();
  if (backgroundPositionY == null) {
    backgroundPositionY="String_Node_Str";
  }
  writer.openTag(HTMLTags.TAG_DIV);
  writer.attribute(HTMLTags.ATTR_STYLE,"String_Node_Str" + pageWidth + "String_Node_Str"+ pageHeight+ "String_Node_Str");
  writer.openTag(HTMLTags.TAG_IMAGE);
  writer.attributeAllowEmpty(HTMLTags.ATTR_ALT,"String_Node_Str");
  image=handleStyleImage(image,true);
  if (image != null && image.length() > 0) {
    writer.attribute(HTMLTags.ATTR_SRC,image);
    writer.attribute(HTMLTags.ATTR_STYLE,"String_Node_Str" + backgroundWidth + "String_Node_Str"+ backgroundHeight+ "String_Node_Str"+ backgroundPositionX+ "String_Node_Str"+ backgroundPositionY+ "String_Node_Str");
  }
  writer.closeTag(HTMLTags.TAG_IMAGE);
}

Fixed version (ground truth):
private void startBackgroundContainer(IStyle style,DimensionType pageWidth,DimensionType pageHeight){
  String backgroundHeight=parseBackgroundSize(style.getBackgroundHeight(),pageHeight);
  String backgroundWidth=parseBackgroundSize(style.getBackgroundWidth(),pageWidth);
  if (backgroundHeight == null && backgroundWidth == null) {
    return;
  }
 else {
    if (backgroundHeight == null) {
      backgroundHeight="String_Node_Str";
    }
    if (backgroundWidth == null) {
      backgroundWidth="String_Node_Str";
    }
  }
  String image=style.getBackgroundImage();
  if (image == null || "String_Node_Str".equalsIgnoreCase(image)) {
    return;
  }
  needOutputBackgroundSize=true;
  String backgroundPositionX=style.getBackgroundPositionX();
  if (backgroundPositionX == null) {
    backgroundPositionX="String_Node_Str";
  }
  String backgroundPositionY=style.getBackgroundPositionY();
  if (backgroundPositionY == null) {
    backgroundPositionY="String_Node_Str";
  }
  writer.openTag(HTMLTags.TAG_DIV);
  writer.attribute(HTMLTags.ATTR_STYLE,"String_Node_Str" + pageWidth + "String_Node_Str"+ pageHeight+ "String_Node_Str");
  writer.openTag(HTMLTags.TAG_IMAGE);
  writer.attributeAllowEmpty(HTMLTags.ATTR_ALT,"String_Node_Str");
  image=handleStyleImage(image,true);
  if (image != null && image.length() > 0) {
    writer.attribute(HTMLTags.ATTR_SRC,image);
    writer.attribute(HTMLTags.ATTR_STYLE,"String_Node_Str" + backgroundWidth + "String_Node_Str"+ backgroundHeight+ "String_Node_Str"+ backgroundPositionX+ "String_Node_Str"+ backgroundPositionY+ "String_Node_Str");
  }
  writer.closeTag(HTMLTags.TAG_IMAGE);
}
Program: 70286
Project: 70286
Buggy source:
private void refreshImage(){
  String str=DEUtil.removeQuote(uriEditor.getText());
  try {
    if (selectedType == URI_TYPE) {
      ImageManager.getInstance().reloadURIImage(inputImage.getModuleHandle(),str);
    }
 else {
      ImageManager.getInstance().rloadImage(inputImage.getModuleHandle(),str);
    }
  }
 catch (  IOException e) {
  }
  clearPreview();
  preview(str);
  IReportResourceSynchronizer synchronizer=ReportPlugin.getDefault().getResourceSynchronizerService();
  if (synchronizer != null) {
    synchronizer.notifyResourceChanged(new ReportResourceChangeEvent(this,str,IReportResourceChangeEvent.ImageResourceChange));
  }
}

Fixed version (ground truth):
private void refreshImage(){
  String str=DEUtil.removeQuote(uriEditor.getText().trim());
  if (str == null || str.length() == 0) {
    return;
  }
  try {
    if (selectedType == URI_TYPE) {
      ImageManager.getInstance().reloadURIImage(inputImage.getModuleHandle(),str);
    }
 else {
      ImageManager.getInstance().rloadImage(inputImage.getModuleHandle(),str);
    }
  }
 catch (  IOException e) {
  }
  clearPreview();
  preview(str);
  IReportResourceSynchronizer synchronizer=ReportPlugin.getDefault().getResourceSynchronizerService();
  if (synchronizer != null) {
    synchronizer.notifyResourceChanged(new ReportResourceChangeEvent(this,str,IReportResourceChangeEvent.ImageResourceChange));
  }
}
Program: 70287
Project: 70287
Buggy source:
public void focusLost(FocusEvent e){
  preview(DEUtil.removeQuote(uriEditor.getText()));
}

Fixed version (ground truth):
public void focusLost(FocusEvent e){
  preview(DEUtil.removeQuote(uriEditor.getText().trim()));
}
Program: 70288
Project: 70288
Buggy source:
private void buildURIEditor(int type){
  Label uriEditorLabel=new Label(inputArea,SWT.NONE);
  GridData labelGd=new GridData(GridData.FILL_HORIZONTAL);
  labelGd.horizontalSpan=4;
  uriEditorLabel.setLayoutData(labelGd);
  uriEditorLabel.setText(uriEditorLabelMap.get(Integer.valueOf(type)));
  uriEditor=new Text(inputArea,SWT.SINGLE | SWT.BORDER);
  GridData textGd=new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
  uriEditor.setLayoutData(textGd);
  uriEditor.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      updateButtons();
    }
  }
);
  uriEditor.addFocusListener(new FocusListener(){
    public void focusGained(    FocusEvent e){
    }
    public void focusLost(    FocusEvent e){
      preview(DEUtil.removeQuote(uriEditor.getText()));
    }
  }
);
  initURIEditor();
}

Fixed version (ground truth):
private void buildURIEditor(int type){
  Label uriEditorLabel=new Label(inputArea,SWT.NONE);
  GridData labelGd=new GridData(GridData.FILL_HORIZONTAL);
  labelGd.horizontalSpan=4;
  uriEditorLabel.setLayoutData(labelGd);
  uriEditorLabel.setText(uriEditorLabelMap.get(Integer.valueOf(type)));
  uriEditor=new Text(inputArea,SWT.SINGLE | SWT.BORDER);
  GridData textGd=new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
  uriEditor.setLayoutData(textGd);
  uriEditor.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      updateButtons();
    }
  }
);
  uriEditor.addFocusListener(new FocusListener(){
    public void focusGained(    FocusEvent e){
    }
    public void focusLost(    FocusEvent e){
      preview(DEUtil.removeQuote(uriEditor.getText().trim()));
    }
  }
);
  initURIEditor();
}
Program: 70289
Project: 70289
Buggy source:
protected ImageArea createImageArea(IImageContent content){
  ImageArea area=new ImageArea();
switch (content.getImageSource()) {
case IImageContent.IMAGE_FILE:
case IImageContent.IMAGE_URL:
    area.setUrl(content.getURI());
  break;
case IImageContent.IMAGE_NAME:
case IImageContent.IMAGE_EXPRESSION:
area.setData(content.getData());
break;
}
return area;
}

Fixed version (ground truth):
protected ImageArea createImageArea(IImageContent content){
  ImageArea area=new ImageArea();
switch (content.getImageSource()) {
case IImageContent.IMAGE_FILE:
case IImageContent.IMAGE_URL:
    area.setUrl(content.getURI());
  area.setExtension(content.getExtension());
area.setMIMEType(content.getMIMEType());
break;
case IImageContent.IMAGE_NAME:
case IImageContent.IMAGE_EXPRESSION:
area.setData(content.getData());
area.setExtension(content.getExtension());
area.setMIMEType(content.getMIMEType());
break;
}
return area;
}
Program: 70290
Project: 70290
Buggy source:
/** 
 * 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);
}

Fixed version (ground truth):
/** 
 * Build the style of the page
 */
public void buildPageStyle(IPageContent page,StringBuffer styleBuffer,boolean needOutputBackgroundSize){
  IStyle style=page.getStyle();
  if (!needOutputBackgroundSize) {
    AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  }
 else   AttributeBuilder.buildBackgroundColor(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildBorders(styleBuffer,style);
}
Program: 70292
Project: 70292
Buggy source:
public void endPage(IPageContent page) throws BirtException {
  logger.log(Level.FINE,"String_Node_Str");
  writer.closeTag(HTMLTags.TAG_TD);
  if (page != null && outputMasterPageContent && outputMasterPageMargins) {
    outputHMargin(page.getMarginRight());
  }
  writer.closeTag(HTMLTags.TAG_TR);
  if (page != null && outputMasterPageContent) {
    if (showPageFooter(page)) {
      writer.openTag(HTMLTags.TAG_TR);
      if (outputMasterPageMargins) {
        outputHMargin(page.getMarginLeft());
      }
      outputPageBand(page,page.getPageFooter());
      if (outputMasterPageMargins) {
        outputHMargin(page.getMarginRight());
      }
      writer.closeTag(HTMLTags.TAG_TR);
    }
    if (outputMasterPageMargins) {
      outputVMargin(page.getMarginBottom());
    }
  }
  writer.closeTag(HTMLTags.TAG_TABLE);
}

Fixed version (ground truth):
public void endPage(IPageContent page) throws BirtException {
  logger.log(Level.FINE,"String_Node_Str");
  writer.closeTag(HTMLTags.TAG_TD);
  if (page != null && outputMasterPageContent && outputMasterPageMargins) {
    outputHMargin(page.getMarginRight());
  }
  writer.closeTag(HTMLTags.TAG_TR);
  if (page != null && outputMasterPageContent) {
    if (showPageFooter(page)) {
      writer.openTag(HTMLTags.TAG_TR);
      if (outputMasterPageMargins) {
        outputHMargin(page.getMarginLeft());
      }
      outputPageBand(page,page.getPageFooter());
      if (outputMasterPageMargins) {
        outputHMargin(page.getMarginRight());
      }
      writer.closeTag(HTMLTags.TAG_TR);
    }
    if (outputMasterPageMargins) {
      outputVMargin(page.getMarginBottom());
    }
  }
  writer.closeTag(HTMLTags.TAG_TABLE);
  if (needOutputBackgroundSize) {
    endBackgroundContainer();
    needOutputBackgroundSize=false;
  }
}
Program: 70294
Project: 70294
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();
  currentBP=getContentY();
  currentIP=getContentX();
  bookmark=content.getBookmark();
  action=content.getHyperlinkAction();
  vAlign=style.getProperty(IStyle.STYLE_VERTICAL_ALIGN);
  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);
  parent.add(this);
}
Program: 70295
Project: 70295
Buggy source:
/** 
 * Test all get/set accessors set values of the cell then get the values one by one to test if they work correctly
 */
public void testAccessor(){
  CellDesign cell=new CellDesign();
  cell.setColSpan(1);
  cell.setColumn(2);
  cell.setRowSpan(3);
  Expression<String> drop=newConstant("String_Node_Str");
  cell.setDrop(drop);
  assertEquals(cell.getColSpan(),1);
  assertEquals(cell.getColumn(),2);
  assertEquals(cell.getRowSpan(),3);
  assertEquals(cell.getDrop(),drop);
}

Fixed version (ground truth):
/** 
 * Test all get/set accessors set values of the cell then get the values one by one to test if they work correctly
 */
public void testAccessor(){
  CellDesign cell=new CellDesign();
  cell.setColSpan(1);
  cell.setColumn(2);
  cell.setRowSpan(3);
  String drop="String_Node_Str";
  cell.setDrop(drop);
  assertEquals(cell.getColSpan(),1);
  assertEquals(cell.getColumn(),2);
  assertEquals(cell.getRowSpan(),3);
  assertEquals(cell.getDrop(),drop);
}
Program: 70297
Project: 70297
Buggy source:
public Object visitCell(CellDesign cell,Object value){
  PolicyNode parent=parentNode;
  visitReportItem(cell,value);
  parentNode=currentNode;
  Expression<String> drop=cell.getDrop();
  if (cell.getRowSpan() != 1 || cell.getColSpan() != 1 || needProcessDrop(drop)) {
    currentNode.execute=true;
  }
  int count=cell.getContentCount();
  for (int i=0; i < count; i++) {
    ReportItemDesign item=cell.getContent(i);
    item.accept(this,null);
  }
  parentNode=parent;
  return value;
}

Fixed version (ground truth):
public Object visitCell(CellDesign cell,Object value){
  PolicyNode parent=parentNode;
  visitReportItem(cell,value);
  parentNode=currentNode;
  if (cell.getRowSpan() != 1 || cell.getColSpan() != 1 || needProcessDrop(cell.getDrop())) {
    currentNode.execute=true;
  }
  int count=cell.getContentCount();
  for (int i=0; i < count; i++) {
    ReportItemDesign item=cell.getContent(i);
    item.accept(this,null);
  }
  parentNode=parent;
  return value;
}
Program: 70298
Project: 70298
Buggy source:
private boolean needProcessDrop(Expression<String> drop){
  return drop != null && (drop.isExpression() || !"String_Node_Str".equals(drop.getDesignValue()));
}

Fixed version (ground truth):
private boolean needProcessDrop(String drop){
  return drop != null && !"String_Node_Str".equals(drop);
}
Program: 70299
Project: 70299
Buggy source:
/** 
 * @return Returns the drop.
 */
public Expression<String> getDrop(){
  return drop;
}

Fixed version (ground truth):
/** 
 * @return Returns the drop.
 */
public String getDrop(){
  return drop;
}
Program: 70300
Project: 70300
Buggy source:
/** 
 * @param drop The drop to set.
 */
public void setDrop(Expression<String> drop){
  this.drop=drop;
}

Fixed version (ground truth):
/** 
 * @param drop The drop to set.
 */
public void setDrop(String drop){
  this.drop=drop;
}
Program: 70301
Project: 70301
Buggy source:
protected void readCellField(DataInputStream in,CellDesign cell,short fieldType) throws IOException {
switch (fieldType) {
case FIELD_COLUMN:
    int column=IOUtil.readInt(in);
  cell.setColumn(column);
break;
case FIELD_COL_SPAN:
int colSpan=IOUtil.readInt(in);
cell.setColSpan(colSpan);
break;
case FIELD_ROW_SPAN:
int rowSpan=IOUtil.readInt(in);
cell.setRowSpan(rowSpan);
break;
case FIELD_DROP:
Expression<String> drop=readStringConstant(in);
cell.setDrop(drop);
break;
case FIELD_DISPLAY_GROUP_ICON:
boolean displayGroupIcon=IOUtil.readBool(in);
cell.setDisplayGroupIcon(displayGroupIcon);
break;
case FIELD_DIAGONAL_NUMBER:
int diagonalNumber=IOUtil.readInt(in);
cell.setDiagonalNumber(diagonalNumber);
break;
case FIELD_DIAGONAL_STYLE:
String diagonalStyle=IOUtil.readString(in);
cell.setDiagonalStyle(diagonalStyle);
break;
case FIELD_DIAGONAL_WIDTH:
DimensionType diagonalWidth=readDimension(in);
cell.setDiagonalWidth(diagonalWidth);
break;
case FIELD_ANTIDIAGONAL_NUMBER:
int antidiagonalNumber=IOUtil.readInt(in);
cell.setAntidiagonalNumber(antidiagonalNumber);
break;
case FIELD_ANTIDIAGONAL_STYLE:
String antidiagonalStyle=IOUtil.readString(in);
cell.setAntidiagonalStyle(antidiagonalStyle);
break;
case FIELD_ANTIDIAGONAL_WIDTH:
DimensionType antidiagonalWidth=readDimension(in);
cell.setAntidiagonalWidth(antidiagonalWidth);
break;
default :
readReportItemField(in,cell,fieldType);
}
}

Fixed version (ground truth):
protected void readCellField(DataInputStream in,CellDesign cell,short fieldType) throws IOException {
switch (fieldType) {
case FIELD_COLUMN:
    int column=IOUtil.readInt(in);
  cell.setColumn(column);
break;
case FIELD_COL_SPAN:
int colSpan=IOUtil.readInt(in);
cell.setColSpan(colSpan);
break;
case FIELD_ROW_SPAN:
int rowSpan=IOUtil.readInt(in);
cell.setRowSpan(rowSpan);
break;
case FIELD_DROP:
String drop=IOUtil.readString(in);
cell.setDrop(drop);
break;
case FIELD_DISPLAY_GROUP_ICON:
boolean displayGroupIcon=IOUtil.readBool(in);
cell.setDisplayGroupIcon(displayGroupIcon);
break;
case FIELD_DIAGONAL_NUMBER:
int diagonalNumber=IOUtil.readInt(in);
cell.setDiagonalNumber(diagonalNumber);
break;
case FIELD_DIAGONAL_STYLE:
String diagonalStyle=IOUtil.readString(in);
cell.setDiagonalStyle(diagonalStyle);
break;
case FIELD_DIAGONAL_WIDTH:
DimensionType diagonalWidth=readDimension(in);
cell.setDiagonalWidth(diagonalWidth);
break;
case FIELD_ANTIDIAGONAL_NUMBER:
int antidiagonalNumber=IOUtil.readInt(in);
cell.setAntidiagonalNumber(antidiagonalNumber);
break;
case FIELD_ANTIDIAGONAL_STYLE:
String antidiagonalStyle=IOUtil.readString(in);
cell.setAntidiagonalStyle(antidiagonalStyle);
break;
case FIELD_ANTIDIAGONAL_WIDTH:
DimensionType antidiagonalWidth=readDimension(in);
cell.setAntidiagonalWidth(antidiagonalWidth);
break;
default :
readReportItemField(in,cell,fieldType);
}
}
Program: 70303
Project: 70303
Buggy source:
public void startCell(ICellContent cell) throws BirtException {
  if (cellEmitter != null) {
    cellEmitter.startCell(cell);
  }
 else {
    if (!isNestTable()) {
      BufferedReportEmitter buffer=null;
      int colId=cell.getColumn();
      int colSpan=cell.getColSpan();
      int rowSpan=cell.getRowSpan();
      if (cell.getGenerateBy() instanceof CellDesign) {
        CellDesign cellDesign=(CellDesign)cell.getGenerateBy();
        if (cellDesign != null) {
          String dropType=cell.getDrop();
          if (dropType != null && !"String_Node_Str".equals(dropType)) {
            rowSpan=createDropID(getGroupLevel(),dropType);
          }
        }
      }
      if (!hasDropCell() && (rowSpan < 0 || rowSpan > 1)) {
        layoutEvents.push(new LayoutEvent(LayoutEvent.ON_FIRST_DROP_CELL,new StartInfo(layout.getRowCount() - 1,colId)));
      }
      if (hasDropCell() || rowSpan < 0 || rowSpan > 1) {
        buffer=new BufferedReportEmitter(emitter);
        cellEmitter=buffer;
      }
      createCell(colId,rowSpan,colSpan,new CellContent(cell,buffer));
      if (hasDropCell()) {
        return;
      }
      emitter.startCell(layout.getWrappedCellContent(cell));
    }
 else {
      emitter.startCell(cell);
    }
  }
}

Fixed version (ground truth):
public void startCell(ICellContent cell) throws BirtException {
  if (cellEmitter != null) {
    cellEmitter.startCell(cell);
  }
 else {
    if (!isNestTable()) {
      BufferedReportEmitter buffer=null;
      int colId=cell.getColumn();
      int colSpan=cell.getColSpan();
      int rowSpan=cell.getRowSpan();
      if (cell.getGenerateBy() instanceof CellDesign) {
        CellDesign cellDesign=(CellDesign)cell.getGenerateBy();
        if (cellDesign != null) {
          String dropType=cellDesign.getDrop();
          if (dropType != null && !"String_Node_Str".equals(dropType)) {
            rowSpan=createDropID(getGroupLevel(),dropType);
          }
        }
      }
      if (!hasDropCell() && (rowSpan < 0 || rowSpan > 1)) {
        layoutEvents.push(new LayoutEvent(LayoutEvent.ON_FIRST_DROP_CELL,new StartInfo(layout.getRowCount() - 1,colId)));
      }
      if (hasDropCell() || rowSpan < 0 || rowSpan > 1) {
        buffer=new BufferedReportEmitter(emitter);
        cellEmitter=buffer;
      }
      createCell(colId,rowSpan,colSpan,new CellContent(cell,buffer));
      if (hasDropCell()) {
        return;
      }
      emitter.startCell(layout.getWrappedCellContent(cell));
    }
 else {
      emitter.startCell(cell);
    }
  }
}
Program: 70304
Project: 70304
Buggy source:
/** 
 * start cell update content cache
 * @param cell
 */
public int getRowSpan(ICellContent cell){
  int groupLevel=getGroupLevel();
  int rowSpan=cell.getRowSpan();
  if (groupLevel >= 0) {
    String dropType=cell.getDrop();
    if (dropType != null && !"String_Node_Str".equals(dropType)) {
      return createDropID(groupLevel,dropType);
    }
  }
  return rowSpan;
}

Fixed version (ground truth):
/** 
 * start cell update content cache
 * @param cell
 */
public int getRowSpan(ICellContent cell){
  int groupLevel=getGroupLevel();
  int rowSpan=cell.getRowSpan();
  if (groupLevel >= 0) {
    Object generateBy=cell.getGenerateBy();
    if (generateBy instanceof CellDesign) {
      CellDesign cellDesign=(CellDesign)generateBy;
      if (cellDesign != null) {
        String dropType=cellDesign.getDrop();
        if (dropType != null && !"String_Node_Str".equals(dropType)) {
          return createDropID(groupLevel,dropType);
        }
      }
    }
  }
  return rowSpan;
}
Program: 70306
Project: 70306
Buggy source:
public void handleEvent(Event event){
  Object source=event.widget;
  if (source == fComboStyle) {
    updateProperties(fCurrentStyleKeyType);
    switchProperties(MenuStylesKeyType.get(fComboStyle.getSelectionIndex()));
  }
 else   if (source == fBtnAdd) {
    doAdd();
  }
 else   if (source == fBtnRemove) {
    doRemove();
  }
 else   if (source == fTable) {
    if (event.type == SWT.Resize) {
      int totalWidth=0;
      int valuewidth=0;
      int i=0;
      for (      TableColumn tc : fTable.getColumns()) {
        totalWidth+=tc.getWidth();
        if (i == 1) {
          valuewidth=tc.getWidth();
        }
        i++;
      }
      valuewidth+=(fTable.getClientArea().width - totalWidth);
      fTable.getColumn(1).setWidth(valuewidth);
    }
 else     if (event.type == SWT.Selection) {
      updateButtonStatus();
    }
  }
}

Fixed version (ground truth):
public void handleEvent(Event event){
  Object source=event.widget;
  if (source == fComboStyle) {
    updateProperties(fCurrentStyleKeyType);
    switchProperties(MenuStylesKeyType.get(fComboStyle.getSelectionIndex()));
  }
 else   if (source == fBtnAdd) {
    doAdd();
  }
 else   if (source == fBtnRemove) {
    doRemove();
  }
 else   if (source == fTable) {
    if (event.type == SWT.Resize) {
      int totalWidth=0;
      int valuewidth=0;
      int i=0;
      for (      TableColumn tc : fTable.getColumns()) {
        totalWidth+=tc.getWidth();
        if (i == 1) {
          valuewidth=tc.getWidth();
        }
        i++;
      }
      valuewidth+=(fTable.getClientArea().width - totalWidth);
      fTable.getColumn(1).setWidth(valuewidth);
    }
 else     if (event.type == SWT.Selection) {
      updateButtonStatus();
    }
 else     if (event.type == SWT.KeyDown) {
      if (event.character == ' ') {
        fTableViewer.editElement(fTableViewer.getElementAt(fTable.getSelectionIndex()),0);
      }
    }
  }
}
Program: 70307
Project: 70307
Buggy source:
private CellEditor[] getCellEditors(Table table){
  CellEditor[] editors=new CellEditor[COLUMNS.length];
  editors[0]=new TextCellEditor(table);
  editors[1]=new TextCellEditor(table);
  return editors;
}

Fixed version (ground truth):
private CellEditor[] getCellEditors(Table table){
  CellEditor[] editors=new CellEditor[COLUMNS.length];
  editors[0]=new TextCellEditor(table){
    @Override protected void keyReleaseOccured(    KeyEvent keyEvent){
      super.keyReleaseOccured(keyEvent);
      if (keyEvent.character == '\r') {
        fTableViewer.editElement(fTableViewer.getElementAt(fTable.getSelectionIndex()),1);
      }
    }
  }
;
  editors[1]=new TextCellEditor(table);
  return editors;
}
Program: 70308
Project: 70308
Buggy source:
/** 
 * @param c
 */
private void placeComponents(Composite c){
  GridLayout gl=(GridLayout)c.getLayout();
  gl.numColumns=4;
  Label labelStyle=new Label(c,SWT.NONE);
  labelStyle.setText(Messages.getString("String_Node_Str"));
  fComboStyle=new Combo(c,SWT.NONE);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.horizontalSpan=2;
  fComboStyle.setLayoutData(gd);
  Label label=new Label(c,SWT.NONE);
  fTable=new Table(c,SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL);
  fTable.setLinesVisible(true);
  fTable.setHeaderVisible(true);
  gd=new GridData(GridData.FILL_BOTH);
  gd.horizontalSpan=3;
  gd.verticalSpan=16;
  fTable.setLayoutData(gd);
  fTableViewer=new TableViewer(fTable);
  fTableViewer.setUseHashlookup(true);
  fBtnAdd=new Button(c,SWT.NONE);
  fBtnAdd.setText(Messages.getString("String_Node_Str"));
  fBtnRemove=new Button(c,SWT.NONE);
  fBtnRemove.setText(Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * @param c
 */
private void placeComponents(Composite c){
  GridLayout gl=(GridLayout)c.getLayout();
  gl.numColumns=4;
  Label labelStyle=new Label(c,SWT.NONE);
  labelStyle.setText(Messages.getString("String_Node_Str"));
  fComboStyle=new Combo(c,SWT.NONE);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.horizontalSpan=2;
  fComboStyle.setLayoutData(gd);
  Label label=new Label(c,SWT.NONE);
  fTable=new Table(c,SWT.BORDER | SWT.V_SCROLL | SWT.FULL_SELECTION);
  fTable.setLinesVisible(true);
  fTable.setHeaderVisible(true);
  gd=new GridData(GridData.FILL_BOTH);
  gd.horizontalSpan=3;
  gd.verticalSpan=16;
  fTable.setLayoutData(gd);
  fTableViewer=new TableViewer(fTable);
  fTableViewer.setUseHashlookup(true);
  fBtnAdd=new Button(c,SWT.NONE);
  fBtnAdd.setText(Messages.getString("String_Node_Str"));
  fBtnRemove=new Button(c,SWT.NONE);
  fBtnRemove.setText(Messages.getString("String_Node_Str"));
}
Program: 70309
Project: 70309
Buggy source:
private void initListeners(Composite c){
  c.addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      updateProperties(MenuStylesKeyType.get(fComboStyle.getSelectionIndex()));
    }
  }
);
  fComboStyle.addListener(SWT.Selection,this);
  fBtnAdd.addListener(SWT.Selection,this);
  fBtnRemove.addListener(SWT.Selection,this);
  fTable.addListener(SWT.Resize,this);
  fTable.addListener(SWT.Selection,this);
}

Fixed version (ground truth):
private void initListeners(Composite c){
  c.addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      updateProperties(MenuStylesKeyType.get(fComboStyle.getSelectionIndex()));
    }
  }
);
  fComboStyle.addListener(SWT.Selection,this);
  fBtnAdd.addListener(SWT.Selection,this);
  fBtnRemove.addListener(SWT.Selection,this);
  fTable.addListener(SWT.Resize,this);
  fTable.addListener(SWT.Selection,this);
  fTable.addListener(SWT.KeyDown,this);
}
Program: 70310
Project: 70310
Buggy source:
public void close() throws BirtException {
  if (hasStyle) {
    int height=currentBP + localProperties.getPaddingTop() + boxStyle.getTopBorderWidth()+ localProperties.getPaddingBottom()+ boxStyle.getBottomBorderWidth();
    if (specifiedHeight > height) {
      if (IStyle.BOTTOM_VALUE.equals(vAlign)) {
        int offset=specifiedHeight - height;
        Iterator<IArea> iter=getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setY(offset + child.getY());
        }
      }
 else       if (IStyle.MIDDLE_VALUE.equals(vAlign)) {
        int offset=(specifiedHeight - height) / 2;
        Iterator iter=getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setY(child.getY() + offset);
        }
      }
      height=specifiedHeight;
    }
    this.height=height;
  }
 else {
    if (specifiedHeight > currentBP) {
      height=specifiedHeight;
    }
 else {
      height=currentBP;
    }
  }
  update();
  finished=true;
}

Fixed version (ground truth):
public void close() throws BirtException {
  if (hasStyle) {
    int height=currentBP + localProperties.getPaddingTop() + boxStyle.getTopBorderWidth()+ localProperties.getPaddingBottom()+ boxStyle.getBottomBorderWidth();
    if (specifiedHeight > height) {
      if (IStyle.BOTTOM_VALUE.equals(vAlign)) {
        int offset=specifiedHeight - height;
        Iterator<IArea> iter=getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setY(offset + child.getY());
        }
      }
 else       if (IStyle.MIDDLE_VALUE.equals(vAlign)) {
        int offset=(specifiedHeight - height) / 2;
        Iterator iter=getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setY(child.getY() + offset);
        }
      }
      height=specifiedHeight;
    }
    this.height=height;
    updateBackgroundImage();
  }
 else {
    if (specifiedHeight > currentBP) {
      height=specifiedHeight;
    }
 else {
      height=currentBP;
    }
  }
  update();
  finished=true;
}
Program: 70312
Project: 70312
Buggy source:
public void close() throws BirtException {
  height=currentBP + getOffsetY() + localProperties.getPaddingBottom();
  checkPageBreak();
  parent.update(this);
  finished=true;
}

Fixed version (ground truth):
public void close() throws BirtException {
  height=currentBP + getOffsetY() + localProperties.getPaddingBottom();
  updateBackgroundImage();
  checkPageBreak();
  parent.update(this);
  finished=true;
}
Program: 70313
Project: 70313
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);
  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;
  parent.add(this);
}
Program: 70314
Project: 70314
Buggy source:
@Override public Dimension getFixPreferredSize(int w,int h){
  int width=0;
  int height=0;
  if (recommendSize.width > 0) {
    width=recommendSize.width;
  }
 else {
    width=getPreferredSize(w,h,true).width;
  }
  if (recommendSize.height > 0) {
    height=recommendSize.height;
  }
 else {
    height=getPreferredSize(w,h,true).height;
  }
  return new Dimension(width,height);
}

Fixed version (ground truth):
@Override public Dimension getFixPreferredSize(int w,int h){
  int width=0;
  int height=0;
  if (recommendSize.width > 0) {
    width=recommendSize.width;
  }
 else {
    if (recommendSize.height > 0) {
      width=getPreferredSize(w,recommendSize.height,true,false,true).width;
    }
 else {
      width=getPreferredSize(w,h,true,false,false).width;
    }
  }
  if (recommendSize.height > 0) {
    height=recommendSize.height;
  }
 else {
    if (recommendSize.width > 0) {
      height=getPreferredSize(width,h,true,true,false).height;
    }
 else {
      height=getPreferredSize(w,h,true,false,false).height;
    }
  }
  return new Dimension(width,height);
}
Program: 70315
Project: 70315
Buggy source:
private Dimension getMinimumSize(int wHint,int hHint,boolean isFix){
  if (DesignChoiceConstants.DISPLAY_NONE.equals(display)) {
    return ZERO_DIMENSION;
  }
  int rx=recommendSize != null ? recommendSize.width : 0;
  int ry=recommendSize != null ? recommendSize.height : 0;
  rx=getRealRecommendSizeX(rx,wHint);
  if (wHint == -1 && hHint == -1) {
    int maxWidth=calcMaxSegment();
    Dimension dim=super.getMinimumSize(rx == 0 ? maxWidth : rx,-1);
    dim.height=Math.max(dim.height,Math.max(getInsets().getHeight(),ry));
    return dim;
  }
  Dimension dim;
  if (isFix) {
    int tempHint=wHint;
    int maxWidth=calcMaxSegment();
    if (wHint < maxWidth) {
      tempHint=maxWidth;
    }
    dim=super.getMinimumSize(tempHint <= 0 ? -1 : tempHint,hHint);
    return new Dimension(Math.max(dim.width,rx),Math.max(dim.height,ry));
  }
 else {
    dim=super.getMinimumSize(rx == 0 ? -1 : rx,hHint);
  }
  if (dim.width < wHint) {
    return new Dimension(Math.max(dim.width,rx),Math.max(dim.height,ry));
  }
  dim=super.getMinimumSize(wHint,hHint);
  return new Dimension(Math.max(dim.width,rx),Math.max(dim.height,ry));
}

Fixed version (ground truth):
private Dimension getMinimumSize(int wHint,int hHint,boolean isFix,boolean forceWidth,boolean forceHeight){
  if (DesignChoiceConstants.DISPLAY_NONE.equals(display)) {
    return ZERO_DIMENSION;
  }
  int rx=recommendSize != null ? recommendSize.width : 0;
  int ry=recommendSize != null ? recommendSize.height : 0;
  rx=getRealRecommendSizeX(rx,wHint);
  if (wHint == -1 && hHint == -1) {
    int maxWidth=calcMaxSegment();
    Dimension dim=super.getMinimumSize(rx == 0 ? maxWidth : rx,-1);
    dim.height=Math.max(dim.height,Math.max(getInsets().getHeight(),ry));
    return dim;
  }
  Dimension dim;
  if (isFix) {
    int tempHint=wHint;
    int maxWidth=calcMaxSegment();
    if (wHint < maxWidth && !forceWidth) {
      tempHint=maxWidth;
    }
    dim=super.getMinimumSize(tempHint <= 0 ? -1 : tempHint,hHint);
    return new Dimension(Math.max(dim.width,rx),Math.max(dim.height,ry));
  }
 else {
    dim=super.getMinimumSize(rx == 0 ? -1 : rx,hHint);
  }
  if (dim.width < wHint) {
    return new Dimension(Math.max(dim.width,rx),Math.max(dim.height,ry));
  }
  dim=super.getMinimumSize(wHint,hHint);
  return new Dimension(Math.max(dim.width,rx),Math.max(dim.height,ry));
}
Program: 70316
Project: 70316
Buggy source:
@Override public Dimension getFixMinimumSize(int w,int h){
  int width=0;
  int height=0;
  if (recommendSize.width > 0) {
    width=recommendSize.width;
  }
 else {
    if (recommendSize.height > 0) {
      width=getMinimumSize(w,recommendSize.height,true).width;
    }
 else {
      width=getMinimumSize(w,h,true).width;
    }
  }
  if (recommendSize.height > 0) {
    height=recommendSize.height;
  }
 else {
    if (recommendSize.width > 0) {
      height=getMinimumSize(width,h,true).height;
    }
 else {
      height=getMinimumSize(w,h,true).height;
    }
  }
  return new Dimension(width,height);
}

Fixed version (ground truth):
@Override public Dimension getFixMinimumSize(int w,int h){
  int width=0;
  int height=0;
  if (recommendSize.width > 0) {
    width=recommendSize.width;
  }
 else {
    if (recommendSize.height > 0) {
      width=getMinimumSize(w,recommendSize.height,true,false,true).width;
    }
 else {
      width=getMinimumSize(w,h,true,false,false).width;
    }
  }
  if (recommendSize.height > 0) {
    height=recommendSize.height;
  }
 else {
    if (recommendSize.width > 0) {
      height=getMinimumSize(width,h,true,true,false).height;
    }
 else {
      height=getMinimumSize(w,h,true,false,false).height;
    }
  }
  return new Dimension(width,height);
}
Program: 70317
Project: 70317
Buggy source:
public Dimension getPreferredSize(int wHint,int hHint){
  return getPreferredSize(wHint,hHint,false);
}

Fixed version (ground truth):
public Dimension getPreferredSize(int wHint,int hHint){
  return getPreferredSize(wHint,hHint,false,false,false);
}
Program: 70319
Project: 70319
Buggy source:
public static String formatDateTime(String format,ULocale locale){
  String language=locale.getLanguage();
  String code=locale2Code.get(locale);
  if (code == null) {
    code=locale2Code.get(new Locale(language));
  }
  return code + format;
}

Fixed version (ground truth):
public static String formatDateTime(String format,ULocale locale){
  String language=locale.getLanguage();
  String code=locale2Code.get(locale);
  if (code == null) {
    code=locale2Code.get(new Locale(language));
  }
  if (code == null) {
    return format;
  }
  return code + format;
}
Program: 70320
Project: 70320
Buggy source:
public boolean isHeaderRepeat(){
  if (headerRepeat != null) {
    return headerRepeat.booleanValue();
  }
  if (generateBy instanceof ListItemDesign) {
    return getConstantValue(((ListItemDesign)generateBy).isRepeatHeader());
  }
  return false;
}

Fixed version (ground truth):
public boolean isHeaderRepeat(){
  if (headerRepeat != null) {
    return headerRepeat.booleanValue();
  }
  if (generateBy instanceof ListItemDesign) {
    return getBooleanValue(((ListItemDesign)generateBy).isRepeatHeader(),false);
  }
  return false;
}
Program: 70321
Project: 70321
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();
  currentBP=getContentY();
  currentIP=getContentX();
  bookmark=content.getBookmark();
  action=content.getHyperlinkAction();
  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();
  currentBP=getContentY();
  currentIP=getContentX();
  bookmark=content.getBookmark();
  action=content.getHyperlinkAction();
  vAlign=style.getProperty(IStyle.STYLE_VERTICAL_ALIGN);
  parent.add(this);
}
Program: 70322
Project: 70322
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);
    updatePageDimension(scale,this);
  }
 else   if (overFlowType == IPDFRenderOption.ENLARGE_PAGE_SIZE) {
    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);
  finished=true;
}
Program: 70323
Project: 70323
Buggy source:
protected boolean needRepeat(){
  ITableContent table=(ITableContent)content;
  if (table != null && table.isHeaderRepeat()) {
    IContent header=(IContent)table.getHeader();
    if (header != null && header.getChildren().size() > 0) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean needRepeat(){
  ITableContent table=(ITableContent)content;
  if (table != null && table.isHeaderRepeat()) {
    IContent header=(IContent)table.getHeader();
    if (header != null) {
      return true;
    }
  }
  return false;
}
Program: 70324
Project: 70324
Buggy source:
protected void addCaption(String caption) throws BirtException {
  if (caption == null || "String_Node_Str".equals(caption)) {
    return;
  }
  ReportContent report=(ReportContent)content.getReportContent();
  ILabelContent captionLabel=report.createLabelContent();
  captionLabel.setText(caption);
  StyleDeclaration style=new StyleDeclaration(report.getCSSEngine());
  style.setProperty(IStyle.STYLE_TEXT_ALIGN,IStyle.CENTER_VALUE);
  captionLabel.setInlineStyle(style);
  RowArea captionRow=new RowArea(getColumnCount());
  captionRow.setParent(this);
  captionRow.setWidth(width);
  CellArea captionCell=new CellArea();
  captionCell.setColSpan(getColumnCount());
  captionCell.setWidth(width);
  captionCell.setMaxAvaWidth(width);
  captionRow.children.add(captionCell);
  ILayout layout=new BlockTextArea(captionCell,context,captionLabel);
  layout.layout();
  int h=((BlockContainerArea)layout).getAllocatedHeight();
  captionCell.setContentHeight(h);
  captionRow.setHeight(captionCell.getAllocatedHeight());
  add(captionRow);
  repeatList.add(captionRow);
  update(captionRow);
}

Fixed version (ground truth):
protected void addCaption(String caption) throws BirtException {
  if (caption == null || "String_Node_Str".equals(caption)) {
    return;
  }
  ReportContent report=(ReportContent)content.getReportContent();
  ILabelContent captionLabel=report.createLabelContent();
  captionLabel.setText(caption);
  StyleDeclaration style=new StyleDeclaration(report.getCSSEngine());
  style.setProperty(IStyle.STYLE_TEXT_ALIGN,IStyle.CENTER_VALUE);
  captionLabel.setInlineStyle(style);
  RowArea captionRow=new RowArea(getColumnCount());
  captionRow.setParent(this);
  captionRow.setWidth(width);
  CellArea captionCell=new CellArea();
  captionCell.setColSpan(getColumnCount());
  captionCell.setWidth(width);
  captionCell.setMaxAvaWidth(width);
  captionRow.children.add(captionCell);
  ILayout layout=new BlockTextArea(captionCell,context,captionLabel);
  layout.layout();
  int h=((BlockContainerArea)layout).getAllocatedHeight();
  captionCell.setContentHeight(h);
  captionRow.setHeight(captionCell.getAllocatedHeight());
  add(captionRow);
  if (repeatList == null) {
    repeatList=new ArrayList();
  }
  repeatList.add(captionRow);
  update(captionRow);
}
Program: 70326
Project: 70326
Buggy source:
/** 
 * Set width
 * @param columnWidth Column width
 * @throws SemanticException
 */
public void setWidth(int columnWidth) throws SemanticException {
  double value=MetricUtility.pixelToPixelInch(columnWidth);
  DimensionValue dimensionValue=new DimensionValue(value,DesignChoiceConstants.UNITS_IN);
  getColumnHandle().getWidth().setValue(dimensionValue);
}

Fixed version (ground truth):
public void setWidth(int columnWidth) throws SemanticException {
  setWidth(columnWidth,DesignChoiceConstants.UNITS_IN);
}
Program: 70327
Project: 70327
Buggy source:
/** 
 * Gets size of image item. If the image size is 0, return null.
 * @return the size of image item.
 */
public Dimension getSize(){
  DimensionHandle handle=getImageHandle().getWidth();
  int px=(int)DEUtil.convertoToPixel(handle);
  handle=getImageHandle().getHeight();
  int py=(int)DEUtil.convertoToPixel(handle);
  if (px != 0 && py != 0) {
    return new Dimension(px,py);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets size of image item. If the image size is 0, return null.
 * @return the size of image item.
 */
public Dimension getSize(){
  DimensionHandle widthHandle=getImageHandle().getWidth();
  int px=(int)DEUtil.convertoToPixel(widthHandle);
  DimensionHandle heightHandle=getImageHandle().getHeight();
  int py=(int)DEUtil.convertoToPixel(heightHandle);
  if (DEUtil.isFixLayout(getHandle())) {
    if (px == 0 && widthHandle.isSet()) {
      px=1;
    }
    if (py == 0 && heightHandle.isSet()) {
      py=1;
    }
  }
  if (px != 0 && py != 0) {
    return new Dimension(px,py);
  }
  return null;
}
Program: 70328
Project: 70328
Buggy source:
/** 
 * Gets size of image item. Always returns a non-null value.
 * @return
 */
public Dimension getRawSize(){
  DimensionHandle handle=getImageHandle().getWidth();
  int px=(int)DEUtil.convertoToPixel(handle);
  handle=getImageHandle().getHeight();
  int py=(int)DEUtil.convertoToPixel(handle);
  return new Dimension(Math.max(px,0),Math.max(py,0));
}

Fixed version (ground truth):
/** 
 * Gets size of image item. Always returns a non-null value.
 * @return
 */
public Dimension getRawSize(){
  DimensionHandle widthHandle=getImageHandle().getWidth();
  int px=(int)DEUtil.convertoToPixel(widthHandle);
  DimensionHandle heightHandle=getImageHandle().getHeight();
  int py=(int)DEUtil.convertoToPixel(heightHandle);
  if (DEUtil.isFixLayout(getHandle())) {
    if (px == 0 && widthHandle.isSet()) {
      px=1;
    }
    if (py == 0 && heightHandle.isSet()) {
      py=1;
    }
  }
  return new Dimension(Math.max(px,0),Math.max(py,0));
}