nus-yam/ex-repair huggingface dataset:
Program: 70547
Project: 70547
Buggy source:
protected void buildLogicContainerProperties(IContent content,LayoutContext context){
  IStyle style=content.getStyle();
  if (style != null && !style.isEmpty()) {
    boxStyle=new BoxStyle();
    IStyle cs=content.getComputedStyle();
    Color color=PropertyUtil.getColor(cs.getProperty(IStyle.STYLE_BACKGROUND_COLOR));
    if (color != null) {
      boxStyle.setBackgroundColor(color);
    }
    String url=cs.getBackgroundImage();
    if (url != null) {
      boxStyle.setBackgroundImage(new BackgroundImageInfo(url,cs.getProperty(IStyle.STYLE_BACKGROUND_REPEAT),getDimensionValue(cs.getProperty(IStyle.STYLE_BACKGROUND_POSITION_X),width),getDimensionValue(cs.getProperty(IStyle.STYLE_BACKGROUND_POSITION_Y),width)));
    }
    if (!isInInlineStacking) {
      pageBreakAfter=cs.getProperty(IStyle.STYLE_PAGE_BREAK_AFTER);
      pageBreakInside=cs.getProperty(IStyle.STYLE_PAGE_BREAK_INSIDE);
      pageBreakBefore=cs.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
    }
  }
 else {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
  }
  bookmark=content.getBookmark();
  action=content.getHyperlinkAction();
}

Fixed version (ground truth):
protected void buildLogicContainerProperties(IContent content,LayoutContext context){
  IStyle style=content.getStyle();
  if (style != null && !style.isEmpty()) {
    boxStyle=new BoxStyle();
    IStyle cs=content.getComputedStyle();
    Color color=PropertyUtil.getColor(cs.getProperty(IStyle.STYLE_BACKGROUND_COLOR));
    if (color != null) {
      boxStyle.setBackgroundColor(color);
    }
    String url=style.getBackgroundImage();
    if (url != null) {
      boxStyle.setBackgroundImage(new BackgroundImageInfo(getImageUrl(url),cs.getProperty(IStyle.STYLE_BACKGROUND_REPEAT),getDimensionValue(cs.getProperty(IStyle.STYLE_BACKGROUND_POSITION_X),width),getDimensionValue(cs.getProperty(IStyle.STYLE_BACKGROUND_POSITION_Y),width)));
    }
    if (!isInInlineStacking) {
      pageBreakAfter=cs.getProperty(IStyle.STYLE_PAGE_BREAK_AFTER);
      pageBreakInside=cs.getProperty(IStyle.STYLE_PAGE_BREAK_INSIDE);
      pageBreakBefore=cs.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
    }
  }
 else {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
  }
  bookmark=content.getBookmark();
  action=content.getHyperlinkAction();
}
Program: 70550
Project: 70550
Buggy source:
public static <T>T convertType(Object tempValue,Class<T> type) throws BirtException {
  T value=null;
  if (type.isAssignableFrom(tempValue.getClass())) {
    value=(T)tempValue;
  }
 else   if (type == DimensionType.class) {
  }
 else {
    value=(T)DataTypeUtil.convert(tempValue,type);
  }
  return value;
}

Fixed version (ground truth):
public static <T>T convertType(Object tempValue,Class<T> type) throws BirtException {
  T value=null;
  if (tempValue == null || type.isAssignableFrom(tempValue.getClass())) {
    value=(T)tempValue;
  }
 else   if (type == DimensionType.class) {
  }
 else {
    value=(T)DataTypeUtil.convert(tempValue,type);
  }
  return value;
}
Program: 70551
Project: 70551
Buggy source:
/** 
 * @param shell
 */
public HyperlinkEditorDialog(Shell shell,URLValue urlValue,ChartWizardContext context,TriggerSupportMatrix triggerMatrix,int optionalStyle){
  super(shell);
  fURLValue=urlValue;
  fContext=context;
  fTriggerMatrix=triggerMatrix;
  fOptionalStyle=optionalStyle;
  fbEnableURLParameters=((optionalStyle & TriggerDataComposite.ENABLE_URL_PARAMETERS) == TriggerDataComposite.ENABLE_URL_PARAMETERS);
  if (fURLValue == null) {
    fURLValue=AttributeFactoryImpl.eINSTANCE.createURLValue();
  }
}

Fixed version (ground truth):
/** 
 * @param shell
 */
public HyperlinkEditorDialog(Shell shell,URLValue urlValue,ChartWizardContext context,TriggerSupportMatrix triggerMatrix,int optionalStyle){
  super(shell);
  this.setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE);
  fURLValue=urlValue;
  fContext=context;
  fTriggerMatrix=triggerMatrix;
  fOptionalStyle=optionalStyle;
  fbEnableURLParameters=((optionalStyle & TriggerDataComposite.ENABLE_URL_PARAMETERS) == TriggerDataComposite.ENABLE_URL_PARAMETERS);
  if (fURLValue == null) {
    fURLValue=AttributeFactoryImpl.eINSTANCE.createURLValue();
  }
}
Program: 70552
Project: 70552
Buggy source:
public boolean isValid(){
  String text=fTxtHyperlinkLabel.getText();
  if (text == null || "String_Node_Str".equals(text)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean isValid(){
  String text=fTxtHyperlinkLabel.getText();
  if (text == null || "String_Node_Str".equals(text.trim())) {
    return false;
  }
  return true;
}
Program: 70554
Project: 70554
Buggy source:
private void updateButtonStatus(){
  int index=fListHyperlinks.getSelectionIndex();
  boolean enabled=(index >= 0);
  fBtnEdit.setEnabled(enabled);
  fBtnDelete.setEnabled(enabled);
  fBtnUp.setEnabled(enabled && index > 0);
  fBtnDown.setEnabled(enabled && index < (fListHyperlinks.getItemCount() - 1));
  fBtnProperties.setEnabled(fMultiURLValues.getURLValues().size() > 1);
}

Fixed version (ground truth):
private void updateButtonStatus(){
  int index=fListHyperlinks.getSelectionIndex();
  boolean enabled=(index >= 0);
  fBtnEdit.setEnabled(enabled);
  fBtnDelete.setEnabled(enabled);
  fBtnUp.setEnabled(enabled && index > 0);
  fBtnDown.setEnabled(enabled && index < (fListHyperlinks.getItemCount() - 1));
  fBtnProperties.setEnabled(fMultiURLValues != null && fMultiURLValues.getURLValues().size() > 1);
}
Program: 70556
Project: 70556
Buggy source:
/** 
 * @param parent
 * @param style
 */
public MultipleHyperlinksComposite(Composite parent,int style,ChartWizardContext context,TriggerSupportMatrix triggerMatrix,int optionalStyles){
  super(parent,style);
  fContext=context;
  fTriggerMatrix=triggerMatrix;
  fOptionalStyles=optionalStyles;
  placeComponents();
  initListeners();
}

Fixed version (ground truth):
/** 
 * @param parent
 * @param style
 */
public MultipleHyperlinksComposite(Composite parent,int style,ChartWizardContext context,TriggerSupportMatrix triggerMatrix,int optionalStyles){
  super(parent,style);
  fContext=context;
  fTriggerMatrix=triggerMatrix;
  fOptionalStyles=optionalStyles;
  placeComponents();
  initListeners();
  updateButtonStatus();
}
Program: 70558
Project: 70558
Buggy source:
private void switchUI(){
switch (getTriggerIndex()) {
case INDEX_1_URL_REDIRECT:
    Trigger trigger=(Trigger)triggersMap.get(cmbTriggerType.getText());
  if (trigger == null || trigger.getAction() == null) {
    multiHyperlinksComposite.populateUIValues(MultiURLValuesImpl.create());
    this.slValues.topControl=multiHyperlinksComposite;
  }
 else {
    this.slValues.topControl=cmpURL;
  }
break;
case INDEX_2_TOOLTIP:
this.slValues.topControl=cmpTooltip;
break;
case INDEX_3_TOOGLE_VISABILITY:
this.slValues.topControl=cmpVisiblity;
break;
case INDEX_4_SCRIPT:
this.slValues.topControl=cmpScript;
break;
case INDEX_5_HIGHLIGHT:
this.slValues.topControl=cmpHighlight;
break;
case INDEX_6_CALLBACK:
this.slValues.topControl=cmpCallback;
break;
case INDEX_7_TOOGLE_DATAPOINT:
this.slValues.topControl=cmpDPVisibility;
break;
default :
this.slValues.topControl=cmpDefault;
break;
}
grpValue.layout();
}

Fixed version (ground truth):
private void switchUI(){
switch (getTriggerIndex()) {
case INDEX_1_URL_REDIRECT:
    Trigger trigger=(Trigger)triggersMap.get(cmbTriggerType.getText());
  if (trigger == null || !(trigger.getAction().getValue() instanceof MultiURLValues)) {
    multiHyperlinksComposite.populateUIValues(MultiURLValuesImpl.create());
  }
 else {
    multiHyperlinksComposite.populateUIValues((MultiURLValues)trigger.getAction().getValue());
  }
this.slValues.topControl=multiHyperlinksComposite;
break;
case INDEX_2_TOOLTIP:
this.slValues.topControl=cmpTooltip;
break;
case INDEX_3_TOOGLE_VISABILITY:
this.slValues.topControl=cmpVisiblity;
break;
case INDEX_4_SCRIPT:
this.slValues.topControl=cmpScript;
break;
case INDEX_5_HIGHLIGHT:
this.slValues.topControl=cmpHighlight;
break;
case INDEX_6_CALLBACK:
this.slValues.topControl=cmpCallback;
break;
case INDEX_7_TOOGLE_DATAPOINT:
this.slValues.topControl=cmpDPVisibility;
break;
default :
this.slValues.topControl=cmpDefault;
break;
}
grpValue.layout();
}
Program: 70559
Project: 70559
Buggy source:
public void testLabelInstance() throws ScriptException {
  LabelContent labelContent=(LabelContent)reportContent.createLabelContent();
  ILabelInstance labelInstance=new LabelInstance(labelContent,null);
  labelInstance.setText(LABEL_TEXT);
  assertEquals(LABEL_TEXT,labelInstance.getText());
}

Fixed version (ground truth):
public void testLabelInstance() throws ScriptException {
  LabelContent labelContent=(LabelContent)reportContent.createLabelContent();
  ILabelInstance labelInstance=new LabelInstance(labelContent,null,null);
  labelInstance.setText(LABEL_TEXT);
  assertEquals(LABEL_TEXT,labelInstance.getText());
}
Program: 70560
Project: 70560
Buggy source:
public void testListInstance() throws ScriptException {
  ListContent listContent=(ListContent)reportContent.createListContent();
  new ListInstance(listContent,null);
}

Fixed version (ground truth):
public void testListInstance() throws ScriptException {
  ListContent listContent=(ListContent)reportContent.createListContent();
  new ListInstance(listContent,null,null);
}
Program: 70561
Project: 70561
Buggy source:
public void testImageInstance() throws ScriptException {
  ImageContent imageContent=(ImageContent)reportContent.createImageContent();
  IImageInstance imageInstance=new ImageInstance(imageContent,null);
  imageInstance.setAltText(ALT_TEXT);
  assertEquals(ALT_TEXT,imageInstance.getAltText());
  imageInstance.setAltTextKey(ALT_TEXT_KEY);
  assertEquals(ALT_TEXT_KEY,imageInstance.getAltTextKey());
  imageInstance.setData(DATA);
  assertEquals(DATA,imageInstance.getData());
  imageInstance.setImageName(IMAGE_NAME);
  assertEquals(IMAGE_NAME,imageInstance.getImageName());
  assertEquals(ImageItemDesign.IMAGE_NAME,imageInstance.getImageSource());
  imageInstance.setMimeType(MIME_TYPE);
  assertEquals(MIME_TYPE,imageInstance.getMimeType());
  imageInstance.setURL(IMAGE_URL);
  assertEquals(IImageContent.IMAGE_URL,imageInstance.getImageSource());
  assertEquals(IMAGE_URL,imageInstance.getURL());
  imageInstance.setFile(IMAGE_FILE);
  assertEquals(IImageContent.IMAGE_FILE,imageInstance.getImageSource());
  assertEquals(IMAGE_FILE,imageInstance.getFile());
}

Fixed version (ground truth):
public void testImageInstance() throws ScriptException {
  ImageContent imageContent=(ImageContent)reportContent.createImageContent();
  IImageInstance imageInstance=new ImageInstance(imageContent,null,null);
  imageInstance.setAltText(ALT_TEXT);
  assertEquals(ALT_TEXT,imageInstance.getAltText());
  imageInstance.setAltTextKey(ALT_TEXT_KEY);
  assertEquals(ALT_TEXT_KEY,imageInstance.getAltTextKey());
  imageInstance.setData(DATA);
  assertEquals(DATA,imageInstance.getData());
  imageInstance.setImageName(IMAGE_NAME);
  assertEquals(IMAGE_NAME,imageInstance.getImageName());
  assertEquals(ImageItemDesign.IMAGE_NAME,imageInstance.getImageSource());
  imageInstance.setMimeType(MIME_TYPE);
  assertEquals(MIME_TYPE,imageInstance.getMimeType());
  imageInstance.setURL(IMAGE_URL);
  assertEquals(IImageContent.IMAGE_URL,imageInstance.getImageSource());
  assertEquals(IMAGE_URL,imageInstance.getURL());
  imageInstance.setFile(IMAGE_FILE);
  assertEquals(IImageContent.IMAGE_FILE,imageInstance.getImageSource());
  assertEquals(IMAGE_FILE,imageInstance.getFile());
}
Program: 70562
Project: 70562
Buggy source:
public void testCellInstance() throws ScriptException {
  CellContent cellContent=(CellContent)reportContent.createCellContent();
  cellContent.setColumn(1);
  Map expressionMap=new HashMap();
  expressionMap.put(EXPRESSION,EXPRESSION_VALUE);
  ICellInstance cell=new CellInstance(cellContent,null,false);
  cell.setColSpan(COL_SPAN);
  assertEquals(COL_SPAN,cell.getColSpan());
}

Fixed version (ground truth):
public void testCellInstance() throws ScriptException {
  CellContent cellContent=(CellContent)reportContent.createCellContent();
  cellContent.setColumn(1);
  Map expressionMap=new HashMap();
  expressionMap.put(EXPRESSION,EXPRESSION_VALUE);
  ICellInstance cell=new CellInstance(cellContent,null,null,false);
  cell.setColSpan(COL_SPAN);
  assertEquals(COL_SPAN,cell.getColSpan());
}
Program: 70563
Project: 70563
Buggy source:
public void testDataItemInstance() throws ScriptException {
  DataContent dataItemContent=(DataContent)reportContent.createDataContent();
  DataItemDesign dataItemDesign=new DataItemDesign();
  DataItemHandle dataHandle=factory.newDataItem("String_Node_Str");
  dataItemDesign.setHandle(dataHandle);
  dataItemContent.setGenerateBy(dataItemDesign);
  IDataItemInstance dataItem=new DataItemInstance(dataItemContent,null);
  doTestReportElementInstance(dataItem);
}

Fixed version (ground truth):
public void testDataItemInstance() throws ScriptException {
  DataContent dataItemContent=(DataContent)reportContent.createDataContent();
  DataItemDesign dataItemDesign=new DataItemDesign();
  DataItemHandle dataHandle=factory.newDataItem("String_Node_Str");
  dataItemDesign.setHandle(dataHandle);
  dataItemContent.setGenerateBy(dataItemDesign);
  IDataItemInstance dataItem=new DataItemInstance(dataItemContent,null,null);
  doTestReportElementInstance(dataItem);
}
Program: 70565
Project: 70565
Buggy source:
public void testDynamicTextInstance() throws ScriptException {
  ForeignContent foreignContent=(ForeignContent)reportContent.createForeignContent();
  foreignContent.setRawType(IForeignContent.TEXT_TYPE);
  IDynamicTextInstance textInstance=new DynamicTextInstance(foreignContent,null);
  textInstance.setText(DYNAMIC_TEXT);
  assertEquals(DYNAMIC_TEXT,textInstance.getText());
}

Fixed version (ground truth):
public void testDynamicTextInstance() throws ScriptException {
  ForeignContent foreignContent=(ForeignContent)reportContent.createForeignContent();
  foreignContent.setRawType(IForeignContent.TEXT_TYPE);
  IDynamicTextInstance textInstance=new DynamicTextInstance(foreignContent,null,null);
  textInstance.setText(DYNAMIC_TEXT);
  assertEquals(DYNAMIC_TEXT,textInstance.getText());
}
Program: 70566
Project: 70566
Buggy source:
public void testRowInstance() throws ScriptException {
  RowContent rowContent=(RowContent)reportContent.createRowContent();
  Map expressionMap=new HashMap();
  expressionMap.put(EXPRESSION,EXPRESSION_VALUE);
  IRowInstance rowInstance=new RowInstance(rowContent,null);
  rowInstance.setBookmark(BOOKMARK);
  assertEquals(BOOKMARK,rowInstance.getBookmarkValue());
  rowInstance.setHeight(HEIGHT);
  assertEquals(HEIGHT,rowInstance.getHeight());
}

Fixed version (ground truth):
public void testRowInstance() throws ScriptException {
  RowContent rowContent=(RowContent)reportContent.createRowContent();
  Map expressionMap=new HashMap();
  expressionMap.put(EXPRESSION,EXPRESSION_VALUE);
  IRowInstance rowInstance=new RowInstance(rowContent,null,null);
  rowInstance.setBookmark(BOOKMARK);
  assertEquals(BOOKMARK,rowInstance.getBookmarkValue());
  rowInstance.setHeight(HEIGHT);
  assertEquals(HEIGHT,rowInstance.getHeight());
}
Program: 70567
Project: 70567
Buggy source:
public void testGridInstance() throws ScriptException {
  TableContent content=(TableContent)reportContent.createTableContent();
  new GridInstance(content,null);
}

Fixed version (ground truth):
public void testGridInstance() throws ScriptException {
  TableContent content=(TableContent)reportContent.createTableContent();
  new GridInstance(content,null,null);
}
Program: 70568
Project: 70568
Buggy source:
/** 
 * This constructor supports shape definition via an elliptical arc
 * @param oSource
 * @param boEllipse
 * @param dStart
 * @param dExtent
 * @param iArcType
 * @param ac
 */
RegionAction(StructureSource oSource,Bounds boEllipse,double dStart,double dExtent,boolean bSector,Action ac,double dTranslateX,double dTranslateY,double dScale,Region clipping){
  _oSource=oSource;
  boEllipse=BoundsImpl.copyInstance(boEllipse);
  boEllipse.translate(dTranslateX,dTranslateY);
  boEllipse.scale(dScale);
  double x=boEllipse.getLeft();
  double y=boEllipse.getTop();
  double width=boEllipse.getWidth();
  double height=boEllipse.getHeight();
  Path ph=new Path(Display.getDefault());
  ph.addArc((float)x,(float)y,(float)width,(float)height,(float)dStart,(float)dExtent);
  if (bSector) {
    ph.lineTo((float)(x + width / 2),(float)(y + height / 2));
  }
  ph.close();
  if (clipping != null) {
  }
  _ac=ac;
  float[] b=new float[4];
  ph.getBounds(b);
  _bb=new Rectangle((int)b[0],(int)b[1],(int)b[2],(int)b[3]);
  ph.dispose();
}

Fixed version (ground truth):
/** 
 * This constructor supports shape definition via an elliptical arc
 * @param oSource
 * @param boEllipse
 * @param dStart
 * @param dExtent
 * @param iArcType
 * @param ac
 */
RegionAction(StructureSource oSource,Bounds boEllipse,double dStart,double dExtent,boolean bSector,Action ac,double dTranslateX,double dTranslateY,double dScale,Region clipping){
  _oSource=oSource;
  boEllipse=boEllipse.copyInstance();
  boEllipse.translate(dTranslateX,dTranslateY);
  boEllipse.scale(dScale);
  double x=boEllipse.getLeft();
  double y=boEllipse.getTop();
  double width=boEllipse.getWidth();
  double height=boEllipse.getHeight();
  Path ph=new Path(Display.getDefault());
  ph.addArc((float)x,(float)y,(float)width,(float)height,(float)dStart,(float)dExtent);
  if (bSector) {
    ph.lineTo((float)(x + width / 2),(float)(y + height / 2));
  }
  ph.close();
  if (clipping != null) {
  }
  _ac=ac;
  float[] b=new float[4];
  ph.getBounds(b);
  _bb=new Rectangle((int)b[0],(int)b[1],(int)b[2],(int)b[3]);
  ph.dispose();
}
Program: 70569
Project: 70569
Buggy source:
public void drawText(TextRenderEvent tre) throws ChartException {
  String fontName=convertFont(tre.getLabel().getCaption().getFont().getName());
  if (fontName != null) {
    tre.getLabel().getCaption().getFont().setName(fontName);
  }
  iv.modifyEvent(tre);
  if (!tre.getLabel().isVisible())   return;
switch (tre.getAction()) {
case TextRenderEvent.UNDEFINED:
    throw new ChartException(ChartDeviceSwtActivator.ID,ChartException.RENDERING,"String_Node_Str",Messages.getResourceBundle(getULocale()));
case TextRenderEvent.RENDER_SHADOW_AT_LOCATION:
  Location lo=LocationImpl.copyInstance(tre.getLocation());
lo.translate(dTranslateX,dTranslateY);
lo.scale(dScale);
_tr.renderShadowAtLocation(this,tre.getTextPosition(),lo,tre.getLabel());
break;
case TextRenderEvent.RENDER_TEXT_AT_LOCATION:
lo=LocationImpl.copyInstance(tre.getLocation());
lo.translate(dTranslateX,dTranslateY);
lo.scale(dScale);
_tr.renderTextAtLocation(this,tre.getTextPosition(),lo,tre.getLabel());
break;
case TextRenderEvent.RENDER_TEXT_IN_BLOCK:
final Bounds bo=BoundsImpl.copyInstance(tre.getBlockBounds());
bo.translate(dTranslateX,dTranslateY);
bo.scale(dScale);
_tr.renderTextInBlock(this,bo,tre.getBlockAlignment(),tre.getLabel());
break;
}
}

Fixed version (ground truth):
public void drawText(TextRenderEvent tre) throws ChartException {
  String fontName=convertFont(tre.getLabel().getCaption().getFont().getName());
  if (fontName != null) {
    tre.getLabel().getCaption().getFont().setName(fontName);
  }
  iv.modifyEvent(tre);
  if (!tre.getLabel().isVisible())   return;
switch (tre.getAction()) {
case TextRenderEvent.UNDEFINED:
    throw new ChartException(ChartDeviceSwtActivator.ID,ChartException.RENDERING,"String_Node_Str",Messages.getResourceBundle(getULocale()));
case TextRenderEvent.RENDER_SHADOW_AT_LOCATION:
  Location lo=tre.getLocation().copyInstance();
lo.translate(dTranslateX,dTranslateY);
lo.scale(dScale);
_tr.renderShadowAtLocation(this,tre.getTextPosition(),lo,tre.getLabel());
break;
case TextRenderEvent.RENDER_TEXT_AT_LOCATION:
lo=tre.getLocation().copyInstance();
lo.translate(dTranslateX,dTranslateY);
lo.scale(dScale);
_tr.renderTextAtLocation(this,tre.getTextPosition(),lo,tre.getLabel());
break;
case TextRenderEvent.RENDER_TEXT_IN_BLOCK:
final Bounds bo=tre.getBlockBounds().copyInstance();
bo.translate(dTranslateX,dTranslateY);
bo.scale(dScale);
_tr.renderTextInBlock(this,bo,tre.getBlockAlignment(),tre.getLabel());
break;
}
}
Program: 70570
Project: 70570
Buggy source:
/** 
 * @param rotation
 * @param lightDirection
 * @param viewerWidth
 * @param viewerHeight
 */
public Engine3D(Rotation3D rotation,Vector lightDirection,double viewerWidth,double viewerHeight){
  dViewerWidth=viewerWidth;
  dViewerHeight=viewerHeight;
  ROT=Rotation3DImpl.copyInstance(rotation);
  LDR=new Vector(lightDirection);
  reset();
}

Fixed version (ground truth):
/** 
 * @param rotation
 * @param lightDirection
 * @param viewerWidth
 * @param viewerHeight
 */
public Engine3D(Rotation3D rotation,Vector lightDirection,double viewerWidth,double viewerHeight){
  dViewerWidth=viewerWidth;
  dViewerHeight=viewerHeight;
  ROT=rotation.copyInstance();
  LDR=new Vector(lightDirection);
  reset();
}
Program: 70571
Project: 70571
Buggy source:
private static Size getTitleSize(LegendData lgData) throws ChartException {
  Size size=null;
  LabelLimiter lbLimit=null;
  Label laTitle=lgData.lg.getTitle();
  if (laTitle != null && laTitle.isSetVisible() && laTitle.isVisible()) {
    laTitle=LabelImpl.copyInstance(laTitle);
    String sTitle=laTitle.getCaption().getValue();
    laTitle.getCaption().setValue(lgData.rtc.externalizedMessage(sTitle));
    int iTitlePos=lgData.lg.getTitlePosition().getValue();
    double shadow=lgData.dShadowness;
    double space=2 * shadow;
    double percent=lgData.lg.getTitlePercent();
    double dMaxTWidth, dMaxTHeight;
    if (iTitlePos == Position.ABOVE || iTitlePos == Position.BELOW) {
      dMaxTWidth=lgData.dAvailableWidth - shadow;
      dMaxTHeight=lgData.dAvailableHeight * percent - space;
    }
 else {
      dMaxTWidth=lgData.dAvailableWidth * percent - space;
      dMaxTHeight=lgData.dAvailableHeight - shadow;
    }
    lbLimit=new LabelLimiter(dMaxTWidth,dMaxTHeight,0);
    lbLimit.computeWrapping(lgData.xs,laTitle);
    lbLimit=lbLimit.limitLabelSize(lgData.xs,laTitle);
    size=SizeImpl.create(lbLimit.getMaxWidth() + space,lbLimit.getMaxHeight() + space);
    if (iTitlePos == Position.ABOVE || iTitlePos == Position.BELOW) {
      lgData.dAvailableHeight-=size.getHeight();
    }
 else {
      lgData.dAvailableWidth-=size.getWidth();
    }
  }
  lgData.laTitle=laTitle;
  return size;
}

Fixed version (ground truth):
private static Size getTitleSize(LegendData lgData) throws ChartException {
  Size size=null;
  LabelLimiter lbLimit=null;
  Label laTitle=lgData.lg.getTitle();
  if (laTitle != null && laTitle.isSetVisible() && laTitle.isVisible()) {
    laTitle=laTitle.copyInstance();
    String sTitle=laTitle.getCaption().getValue();
    laTitle.getCaption().setValue(lgData.rtc.externalizedMessage(sTitle));
    int iTitlePos=lgData.lg.getTitlePosition().getValue();
    double shadow=lgData.dShadowness;
    double space=2 * shadow;
    double percent=lgData.lg.getTitlePercent();
    double dMaxTWidth, dMaxTHeight;
    if (iTitlePos == Position.ABOVE || iTitlePos == Position.BELOW) {
      dMaxTWidth=lgData.dAvailableWidth - shadow;
      dMaxTHeight=lgData.dAvailableHeight * percent - space;
    }
 else {
      dMaxTWidth=lgData.dAvailableWidth * percent - space;
      dMaxTHeight=lgData.dAvailableHeight - shadow;
    }
    lbLimit=new LabelLimiter(dMaxTWidth,dMaxTHeight,0);
    lbLimit.computeWrapping(lgData.xs,laTitle);
    lbLimit=lbLimit.limitLabelSize(lgData.xs,laTitle);
    size=SizeImpl.create(lbLimit.getMaxWidth() + space,lbLimit.getMaxHeight() + space);
    if (iTitlePos == Position.ABOVE || iTitlePos == Position.BELOW) {
      lgData.dAvailableHeight-=size.getHeight();
    }
 else {
      lgData.dAvailableWidth-=size.getWidth();
    }
  }
  lgData.laTitle=laTitle;
  return size;
}
Program: 70572
Project: 70572
Buggy source:
private void checkValueLabel(LegendItemHints lih){
  if (sed != lih.getSeriesDefinition()) {
    if (laiValue != null) {
      laiValue.dispose();
    }
    Series series=lih.getSeriesDefinition().getSeries().get(0);
    Label laValue=LabelImpl.copyInstance(series.getLabel());
    laValue.setEllipsis(1);
    this.laiValue=new LabelItem(lgData.xs,lgData.rtc,laValue,lgData.maxWrappingSize);
  }
}

Fixed version (ground truth):
private void checkValueLabel(LegendItemHints lih){
  if (sed != lih.getSeriesDefinition()) {
    if (laiValue != null) {
      laiValue.dispose();
    }
    Series series=lih.getSeriesDefinition().getSeries().get(0);
    Label laValue=series.getLabel().copyInstance();
    laValue.setEllipsis(1);
    this.laiValue=new LabelItem(lgData.xs,lgData.rtc,laValue,lgData.maxWrappingSize);
  }
}
Program: 70573
Project: 70573
Buggy source:
public LegendData(IDisplayServer xs,Chart cm,SeriesDefinition[] seda,RunTimeContext rtc){
  this.xs=xs;
  this.cm=cm;
  this.lg=cm.getLegend();
  this.seda=seda;
  this.rtc=rtc;
  this.bPaletteByCategory=(lg.getItemType().getValue() == LegendItemType.CATEGORIES);
  this.la=LabelImpl.create();
  la.setEllipsis(lg.isSetEllipsis() ? lg.getEllipsis() : 1);
  la.setCaption(TextImpl.copyInstance(lg.getText()));
  la.getCaption().setValue("String_Node_Str");
  ITextMetrics itm=xs.getTextMetrics(la);
  this.dItemHeight=itm.getFullHeight();
  itm.dispose();
  ClientArea ca=lg.getClientArea();
  dSeparatorThickness=lg.getSeparator() != null ? lg.getSeparator().getThickness() : ca.getOutline().getThickness();
  dScale=xs.getDpiResolution() / 72d;
  insCa=ca.getInsets().scaledInstance(dScale);
  maxWrappingSize=lg.getWrappingSize() * dScale;
  dHorizontalSpacing=3 * dScale;
  dVerticalSpacing=3 * dScale;
  dSafeSpacing=3 * dScale;
  this.dShadowness=3 * dScale;
  dHorizonalReservedSpace=insCa.getLeft() + insCa.getRight() + 1.5 * dItemHeight + dHorizontalSpacing;
}

Fixed version (ground truth):
public LegendData(IDisplayServer xs,Chart cm,SeriesDefinition[] seda,RunTimeContext rtc){
  this.xs=xs;
  this.cm=cm;
  this.lg=cm.getLegend();
  this.seda=seda;
  this.rtc=rtc;
  this.bPaletteByCategory=(lg.getItemType().getValue() == LegendItemType.CATEGORIES);
  this.la=LabelImpl.create();
  la.setEllipsis(lg.isSetEllipsis() ? lg.getEllipsis() : 1);
  la.setCaption(lg.getText().copyInstance());
  la.getCaption().setValue("String_Node_Str");
  ITextMetrics itm=xs.getTextMetrics(la);
  this.dItemHeight=itm.getFullHeight();
  itm.dispose();
  ClientArea ca=lg.getClientArea();
  dSeparatorThickness=lg.getSeparator() != null ? lg.getSeparator().getThickness() : ca.getOutline().getThickness();
  dScale=xs.getDpiResolution() / 72d;
  insCa=ca.getInsets().scaledInstance(dScale);
  maxWrappingSize=lg.getWrappingSize() * dScale;
  dHorizontalSpacing=3 * dScale;
  dVerticalSpacing=3 * dScale;
  dSafeSpacing=3 * dScale;
  this.dShadowness=3 * dScale;
  dHorizonalReservedSpace=insCa.getLeft() + insCa.getRight() + 1.5 * dItemHeight + dHorizontalSpacing;
}
Program: 70574
Project: 70574
Buggy source:
/** 
 * copy constructor
 * @param original
 */
public static LabelItem copyOf(LabelItem original){
  return new LabelItem(original.xs,original.rtc,LabelImpl.copyInstance(original.la),original.maxWrappingSize);
}

Fixed version (ground truth):
/** 
 * copy constructor
 * @param original
 */
public static LabelItem copyOf(LabelItem original){
  return new LabelItem(original.xs,original.rtc,original.la.copyInstance(),original.maxWrappingSize);
}
Program: 70577
Project: 70577
Buggy source:
public Rectangle getAxisLabelBoundingRectXZ(OneAxis oax) throws ChartException {
  AxisLabelCanvasLocationProvider lProvider=new HAxisLabelCanvasLocationProvider(getPWA3D(),oax);
  AutoScale sc=oax.getScale();
  boolean bTextAxis=(sc.getType() & IConstants.TEXT) == IConstants.TEXT || sc.isCategoryScale();
  AxisTickCoordinates da=oax.getScale().getTickCordinates();
  final int length=bTextAxis ? da.size() - 1 : da.size();
  int iLabelLocation=oax.getLabelPosition();
  Label la=LabelImpl.copyInstance(oax.getLabel());
  AxisLabelTextProvider textProvider=AxisLabelTextProvider.create(oax);
  Rectangle rect=null;
  for (int i=0; i < length; i++) {
    if (sc.isTickLabelVisible(i)) {
      Location[] lo=lProvider.getLocation(i);
      String str=textProvider.getLabelText(i);
      la.getCaption().setValue(str);
      BoundingBox bb=Methods.computeBox(ids,iLabelLocation,la,lo[0].getX(),lo[0].getY());
      if (rect == null) {
        rect=new Rectangle(bb);
      }
 else {
        rect.union(new Rectangle(bb));
      }
    }
  }
  return rect;
}

Fixed version (ground truth):
public Rectangle getAxisLabelBoundingRectXZ(OneAxis oax) throws ChartException {
  AxisLabelCanvasLocationProvider lProvider=new HAxisLabelCanvasLocationProvider(getPWA3D(),oax);
  AutoScale sc=oax.getScale();
  boolean bTextAxis=(sc.getType() & IConstants.TEXT) == IConstants.TEXT || sc.isCategoryScale();
  AxisTickCoordinates da=oax.getScale().getTickCordinates();
  final int length=bTextAxis ? da.size() - 1 : da.size();
  int iLabelLocation=oax.getLabelPosition();
  Label la=oax.getLabel().copyInstance();
  AxisLabelTextProvider textProvider=AxisLabelTextProvider.create(oax);
  Rectangle rect=null;
  for (int i=0; i < length; i++) {
    if (sc.isTickLabelVisible(i)) {
      Location[] lo=lProvider.getLocation(i);
      String str=textProvider.getLabelText(i);
      la.getCaption().setValue(str);
      BoundingBox bb=Methods.computeBox(ids,iLabelLocation,la,lo[0].getX(),lo[0].getY());
      if (rect == null) {
        rect=new Rectangle(bb);
      }
 else {
        rect.union(new Rectangle(bb));
      }
    }
  }
  return rect;
}
Program: 70578
Project: 70578
Buggy source:
public Rectangle[] getAxisLabelBoundingRectY(OneAxis oax) throws ChartException {
  AxisLabelCanvasLocationProvider lProvider=new VAxisLabelCanvasLocationProvider(getPWA3D(),oax);
  AutoScale sc=oax.getScale();
  boolean bTextAxis=(sc.getType() & IConstants.TEXT) == IConstants.TEXT || sc.isCategoryScale();
  AxisTickCoordinates da=oax.getScale().getTickCordinates();
  final int length=bTextAxis ? da.size() - 1 : da.size();
  Label la=LabelImpl.copyInstance(oax.getLabel());
  AxisLabelTextProvider textProvider=AxisLabelTextProvider.create(oax);
  Rectangle[] rect={null,null};
  for (int i=0; i < length; i++) {
    if (sc.isTickLabelVisible(i)) {
      Location[] lo=lProvider.getLocation(i);
      String str=textProvider.getLabelText(i);
      la.getCaption().setValue(str);
      BoundingBox bb0=Methods.computeBox(ids,TextRenderEvent.LEFT,la,lo[0].getX(),lo[0].getY());
      BoundingBox bb1=Methods.computeBox(ids,TextRenderEvent.RIGHT,la,lo[1].getX(),lo[1].getY());
      if (rect[0] == null) {
        rect[0]=new Rectangle(bb0);
        rect[1]=new Rectangle(bb1);
      }
 else {
        rect[0].union(new Rectangle(bb0));
        rect[1].union(new Rectangle(bb1));
      }
    }
  }
  return rect;
}

Fixed version (ground truth):
public Rectangle[] getAxisLabelBoundingRectY(OneAxis oax) throws ChartException {
  AxisLabelCanvasLocationProvider lProvider=new VAxisLabelCanvasLocationProvider(getPWA3D(),oax);
  AutoScale sc=oax.getScale();
  boolean bTextAxis=(sc.getType() & IConstants.TEXT) == IConstants.TEXT || sc.isCategoryScale();
  AxisTickCoordinates da=oax.getScale().getTickCordinates();
  final int length=bTextAxis ? da.size() - 1 : da.size();
  Label la=oax.getLabel().copyInstance();
  AxisLabelTextProvider textProvider=AxisLabelTextProvider.create(oax);
  Rectangle[] rect={null,null};
  for (int i=0; i < length; i++) {
    if (sc.isTickLabelVisible(i)) {
      Location[] lo=lProvider.getLocation(i);
      String str=textProvider.getLabelText(i);
      la.getCaption().setValue(str);
      BoundingBox bb0=Methods.computeBox(ids,TextRenderEvent.LEFT,la,lo[0].getX(),lo[0].getY());
      BoundingBox bb1=Methods.computeBox(ids,TextRenderEvent.RIGHT,la,lo[1].getX(),lo[1].getY());
      if (rect[0] == null) {
        rect[0]=new Rectangle(bb0);
        rect[1]=new Rectangle(bb1);
      }
 else {
        rect[0].union(new Rectangle(bb0));
        rect[1].union(new Rectangle(bb1));
      }
    }
  }
  return rect;
}
Program: 70579
Project: 70579
Buggy source:
public Bounds getAdjustedPlotBounds(boolean refresh){
  if (!refresh && cachedAdjustedBounds != null) {
    return cachedAdjustedBounds;
  }
  final Bounds bo=getPlotBounds().adjustedInstance(getPlotInsets());
  double h, w;
  Label la;
  la=LabelImpl.copyInstance(aax.getPrimaryBase().getLabel());
  la.getCaption().setValue("String_Node_Str");
  h=computeHeight(ids,la);
  la=LabelImpl.copyInstance(aax.getAncillaryBase().getLabel());
  la.getCaption().setValue("String_Node_Str");
  h=Math.max(h,computeHeight(ids,la));
  la=LabelImpl.copyInstance(aax.getPrimaryOrthogonal().getLabel());
  la.getCaption().setValue("String_Node_Str");
  w=computeWidth(ids,la);
  bo.adjust(InsetsImpl.create(0,0,h,w));
  cachedAdjustedBounds=bo;
  return bo;
}

Fixed version (ground truth):
public Bounds getAdjustedPlotBounds(boolean refresh){
  if (!refresh && cachedAdjustedBounds != null) {
    return cachedAdjustedBounds;
  }
  final Bounds bo=getPlotBounds().adjustedInstance(getPlotInsets());
  double h, w;
  Label la;
  la=aax.getPrimaryBase().getLabel().copyInstance();
  la.getCaption().setValue("String_Node_Str");
  h=computeHeight(ids,la);
  la=aax.getAncillaryBase().getLabel().copyInstance();
  la.getCaption().setValue("String_Node_Str");
  h=Math.max(h,computeHeight(ids,la));
  la=aax.getPrimaryOrthogonal().getLabel().copyInstance();
  la.getCaption().setValue("String_Node_Str");
  w=computeWidth(ids,la);
  bo.adjust(InsetsImpl.create(0,0,h,w));
  cachedAdjustedBounds=bo;
  return bo;
}
Program: 70580
Project: 70580
Buggy source:
/** 
 * @param se
 * @return
 * @throws IllegalArgumentException
 */
public final Label getLabelAttributes(Series se) throws IllegalArgumentException {
  return LabelImpl.copyInstance(se.getLabel());
}

Fixed version (ground truth):
/** 
 * @param se
 * @return
 * @throws IllegalArgumentException
 */
public final Label getLabelAttributes(Series se) throws IllegalArgumentException {
  return se.getLabel().copyInstance();
}
Program: 70581
Project: 70581
Buggy source:
/** 
 * @param bReduceByInsets
 * @return
 */
public final Bounds getClientAreaBounds(boolean bReduceByInsets){
  final Bounds boClientArea=BoundsImpl.copyInstance(pwa.getPlotBounds());
  if (bReduceByInsets) {
    boClientArea.adjust(pwa.getPlotInsets());
  }
  return boClientArea;
}

Fixed version (ground truth):
/** 
 * @param bReduceByInsets
 * @return
 */
public final Bounds getClientAreaBounds(boolean bReduceByInsets){
  final Bounds boClientArea=pwa.getPlotBounds().copyInstance();
  if (bReduceByInsets) {
    boClientArea.adjust(pwa.getPlotInsets());
  }
  return boClientArea;
}
Program: 70582
Project: 70582
Buggy source:
/** 
 * @param se
 * @return
 * @throws IllegalArgumentException
 */
public final Label getLabelAttributes(Series se) throws IllegalArgumentException {
  return LabelImpl.copyInstance(se.getLabel());
}

Fixed version (ground truth):
/** 
 * @param se
 * @return
 * @throws IllegalArgumentException
 */
public final Label getLabelAttributes(Series se) throws IllegalArgumentException {
  return se.getLabel().copyInstance();
}
Program: 70583
Project: 70583
Buggy source:
/** 
 * @param bReduceByInsets
 * @return
 */
public final Bounds getClientAreaBounds(boolean bReduceByInsets){
  final Bounds boClientArea=BoundsImpl.copyInstance(pwa.getPlotBounds());
  if (bReduceByInsets) {
    boClientArea.adjust(pwa.getPlotInsets());
  }
  return boClientArea;
}

Fixed version (ground truth):
/** 
 * @param bReduceByInsets
 * @return
 */
public final Bounds getClientAreaBounds(boolean bReduceByInsets){
  final Bounds boClientArea=pwa.getPlotBounds().copyInstance();
  if (bReduceByInsets) {
    boClientArea.adjust(pwa.getPlotInsets());
  }
  return boClientArea;
}
Program: 70584
Project: 70584
Buggy source:
public Bounds getClientAreaBounds(boolean bReduceByInsets){
  final Bounds boClientArea=BoundsImpl.copyInstance(pwoa.getBounds());
  if (bReduceByInsets) {
    boClientArea.adjust(pwoa.getCellInsets());
  }
  return boClientArea;
}

Fixed version (ground truth):
public Bounds getClientAreaBounds(boolean bReduceByInsets){
  final Bounds boClientArea=pwoa.getBounds().copyInstance();
  if (bReduceByInsets) {
    boClientArea.adjust(pwoa.getCellInsets());
  }
  return boClientArea;
}
Program: 70586
Project: 70586
Buggy source:
public PrimitiveRenderEvent copy(){
  Arc3DRenderEvent are=new Arc3DRenderEvent(source);
  if (object3D != null) {
    are.object3D=new Object3D(object3D);
  }
  if (outline != null) {
    are.setOutline(LineAttributesImpl.copyInstance(outline));
  }
  if (ifBackground != null) {
    are.setBackground(FillUtil.copyOf(ifBackground));
  }
  are.setStyle(iStyle);
  are.setWidth(dWidth);
  are.setHeight(dHeight);
  are.setStartAngle(dStartInDegrees);
  are.setAngleExtent(dExtentInDegrees);
  are.setInnerRadius(dInnerRadius);
  are.setOuterRadius(dOuterRadius);
  return are;
}

Fixed version (ground truth):
public PrimitiveRenderEvent copy(){
  Arc3DRenderEvent are=new Arc3DRenderEvent(source);
  if (object3D != null) {
    are.object3D=new Object3D(object3D);
  }
  if (outline != null) {
    are.setOutline(outline.copyInstance());
  }
  if (ifBackground != null) {
    are.setBackground(ifBackground.copyInstance());
  }
  are.setStyle(iStyle);
  are.setWidth(dWidth);
  are.setHeight(dHeight);
  are.setStartAngle(dStartInDegrees);
  are.setAngleExtent(dExtentInDegrees);
  are.setInnerRadius(dInnerRadius);
  are.setOuterRadius(dOuterRadius);
  return are;
}
Program: 70587
Project: 70587
Buggy source:
public PrimitiveRenderEvent copy() throws ChartException {
  ArcRenderEvent are=new ArcRenderEvent(source);
  if (outline != null) {
    are.setOutline(LineAttributesImpl.copyInstance(outline));
  }
  if (ifBackground != null) {
    are.setBackground(FillUtil.copyOf(ifBackground));
  }
  if (loTopLeft != null) {
    are.setTopLeft(LocationImpl.copyInstance(loTopLeft));
  }
  are.setStyle(iStyle);
  are.setWidth(dWidth);
  are.setHeight(dHeight);
  are.setStartAngle(dStartInDegrees);
  are.setEndAngle(dExtentInDegrees);
  are.setInnerRadius(dInnerRadius);
  are.setOuterRadius(dOuterRadius);
  return are;
}

Fixed version (ground truth):
public PrimitiveRenderEvent copy() throws ChartException {
  ArcRenderEvent are=new ArcRenderEvent(source);
  if (outline != null) {
    are.setOutline(outline.copyInstance());
  }
  if (ifBackground != null) {
    are.setBackground(FillUtil.copyOf(ifBackground));
  }
  if (loTopLeft != null) {
    are.setTopLeft(loTopLeft.copyInstance());
  }
  are.setStyle(iStyle);
  are.setWidth(dWidth);
  are.setHeight(dHeight);
  are.setStartAngle(dStartInDegrees);
  are.setEndAngle(dExtentInDegrees);
  are.setInnerRadius(dInnerRadius);
  are.setOuterRadius(dOuterRadius);
  return are;
}
Program: 70588
Project: 70588
Buggy source:
protected void buildLogicContainerProperties(IContent content,LayoutContext context){
  IStyle style=content.getStyle();
  if (style != null && !style.isEmpty()) {
    boxStyle=new BoxStyle();
    Color color=PropertyUtil.getColor(style.getProperty(IStyle.STYLE_BACKGROUND_COLOR));
    if (color != null) {
      boxStyle.setBackgroundColor(color);
    }
    String url=style.getBackgroundImage();
    if (url != null) {
      boxStyle.setBackgroundImage(new BackgroundImageInfo(url,style.getProperty(IStyle.STYLE_BACKGROUND_REPEAT),getDimensionValue(style.getProperty(IStyle.STYLE_BACKGROUND_POSITION_X),width),getDimensionValue(style.getProperty(IStyle.STYLE_BACKGROUND_POSITION_Y),width)));
    }
    if (!isInInlineStacking) {
      pageBreakAfter=style.getProperty(IStyle.STYLE_PAGE_BREAK_AFTER);
      pageBreakInside=style.getProperty(IStyle.STYLE_PAGE_BREAK_INSIDE);
      pageBreakBefore=style.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
    }
  }
 else {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
  }
  bookmark=content.getBookmark();
  action=content.getHyperlinkAction();
}

Fixed version (ground truth):
protected void buildLogicContainerProperties(IContent content,LayoutContext context){
  IStyle style=content.getStyle();
  if (style != null && !style.isEmpty()) {
    boxStyle=new BoxStyle();
    IStyle cs=content.getComputedStyle();
    Color color=PropertyUtil.getColor(cs.getProperty(IStyle.STYLE_BACKGROUND_COLOR));
    if (color != null) {
      boxStyle.setBackgroundColor(color);
    }
    String url=cs.getBackgroundImage();
    if (url != null) {
      boxStyle.setBackgroundImage(new BackgroundImageInfo(url,cs.getProperty(IStyle.STYLE_BACKGROUND_REPEAT),getDimensionValue(cs.getProperty(IStyle.STYLE_BACKGROUND_POSITION_X),width),getDimensionValue(cs.getProperty(IStyle.STYLE_BACKGROUND_POSITION_Y),width)));
    }
    if (!isInInlineStacking) {
      pageBreakAfter=cs.getProperty(IStyle.STYLE_PAGE_BREAK_AFTER);
      pageBreakInside=cs.getProperty(IStyle.STYLE_PAGE_BREAK_INSIDE);
      pageBreakBefore=cs.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
    }
  }
 else {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
  }
  bookmark=content.getBookmark();
  action=content.getHyperlinkAction();
}
Program: 70589
Project: 70589
Buggy source:
void doRenderReportletWithBookmark() throws Exception {
  IReportDocument document=engine.openReportDocument(REPORT_DOCUMENT);
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  IRenderOption option=new HTMLRenderOption();
  option.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML);
  option.setOutputStream(out);
  String[] bookmarks=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (int i=0; i < bookmarks.length; i++) {
    IRenderTask renderTask=engine.createRenderTask(document);
    renderTask.setRenderOption(option);
    renderTask.setReportlet(bookmarks[i]);
    renderTask.render();
    assertTrue(renderTask.getErrors().isEmpty());
    renderTask.close();
    String pageContent=out.toString("String_Node_Str");
    if (bookmarks[i].indexOf("String_Node_Str") == -1) {
      assertTrue(pageContent.indexOf("String_Node_Str") != -1);
      int indexOf=pageContent.indexOf("String_Node_Str");
      int lastIndexOf=pageContent.lastIndexOf("String_Node_Str");
      assertTrue(indexOf != -1 && lastIndexOf != -1 && indexOf != lastIndexOf);
    }
 else {
      assertTrue(pageContent.indexOf("String_Node_Str") != -1);
      int indexOf=pageContent.indexOf("String_Node_Str");
      int lastIndexOf=pageContent.lastIndexOf("String_Node_Str");
      assertTrue(indexOf != -1 && lastIndexOf != -1 && indexOf == lastIndexOf);
    }
    out.reset();
  }
  document.close();
}

Fixed version (ground truth):
void doRenderReportletWithBookmark() throws Exception {
  IReportDocument document=engine.openReportDocument(REPORT_DOCUMENT);
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  IRenderOption option=new HTMLRenderOption();
  option.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML);
  option.setOutputStream(out);
  String[] bookmarks=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (int i=0; i < bookmarks.length; i++) {
    IRenderTask renderTask=engine.createRenderTask(document);
    renderTask.setRenderOption(option);
    renderTask.setReportlet(bookmarks[i]);
    renderTask.render();
    assertTrue(renderTask.getErrors().isEmpty());
    renderTask.close();
    String pageContent=out.toString("String_Node_Str");
    if (bookmarks[i].indexOf("String_Node_Str") == -1) {
      assertTrue(pageContent.indexOf("String_Node_Str") != -1);
      int indexOf=pageContent.indexOf("String_Node_Str");
      int lastIndexOf=pageContent.lastIndexOf("String_Node_Str");
      assertTrue(indexOf != -1 && lastIndexOf != -1 && indexOf != lastIndexOf);
    }
 else {
      int indexOf=pageContent.indexOf("String_Node_Str");
      int lastIndexOf=pageContent.lastIndexOf("String_Node_Str");
      assertTrue(indexOf != -1 && lastIndexOf != -1 && indexOf == lastIndexOf);
    }
    out.reset();
  }
  document.close();
}
Program: 70590
Project: 70590
Buggy source:
public void close() throws BirtException {
  height=currentBP + getOffsetY() + localProperties.getPaddingBottom();
  if (!isInInlineStacking && context.isAutoPageBreak()) {
    int aHeight=getAllocatedHeight();
    while (aHeight + parent.getAbsoluteBP() >= context.getMaxBP()) {
      parent.autoPageBreak();
      aHeight=getAllocatedHeight();
    }
  }
  if (height > parent.getSpecifiedHeight()) {
    height=parent.getSpecifiedHeight();
    setNeedClip(true);
  }
  parent.update(this);
  finished=true;
}

Fixed version (ground truth):
public void close() throws BirtException {
  height=currentBP + getOffsetY() + localProperties.getPaddingBottom();
  if (!isInInlineStacking && context.isAutoPageBreak()) {
    int aHeight=getAllocatedHeight();
    while (aHeight + parent.getAbsoluteBP() >= context.getMaxBP()) {
      parent.autoPageBreak();
      aHeight=getAllocatedHeight();
    }
  }
  parent.update(this);
  finished=true;
}
Program: 70591
Project: 70591
Buggy source:
/** 
 * Updates the row height and the height of the cells in the row.
 * @param rowArea
 * @param height
 */
private void updateRowHeight(RowArea row,int height){
  if (height < 0)   return;
  row.setHeight(height);
  for (int i=startCol; i <= endCol; i++) {
    CellArea cell=row.getCell(i);
    if (cell != null) {
      if (cell.getRowSpan() == 1) {
        if (cell instanceof DummyCell) {
          CellArea refCell=((DummyCell)cell).getCell();
          int delta=((DummyCell)cell).getDelta();
          refCell.setHeight(delta + height);
          verticalAlign(refCell);
        }
 else {
          cell.setHeight(height);
          verticalAlign(cell);
        }
      }
      i=i + cell.getColSpan() - 1;
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the row height and the height of the cells in the row.
 * @param rowArea
 * @param height
 */
private void updateRowHeight(RowArea row,int height){
  if (height < 0)   return;
  row.setHeight(height);
  boolean isFixedLayout=row.context.isFixedLayout();
  for (int i=startCol; i <= endCol; i++) {
    CellArea cell=row.getCell(i);
    if (cell != null) {
      if (cell.getRowSpan() == 1) {
        if (cell instanceof DummyCell) {
          CellArea refCell=((DummyCell)cell).getCell();
          int delta=((DummyCell)cell).getDelta();
          refCell.setHeight(delta + height);
          verticalAlign(refCell);
        }
 else {
          int cellHeight=cell.getHeight();
          cell.setHeight(height);
          verticalAlign(cell);
          if (isFixedLayout && cellHeight > height) {
            cell.setNeedClip(true);
          }
        }
      }
      i=i + cell.getColSpan() - 1;
    }
  }
}
Program: 70592
Project: 70592
Buggy source:
protected SplitResult _split(int height,boolean force) throws BirtException {
  RowArea result=null;
  for (int i=0; i < cells.length; i++) {
    if (cells[i] != null) {
      SplitResult splitCell=cells[i].split(height,force);
      CellArea cell=(CellArea)splitCell.getResult();
      if (cell != null) {
        if (result == null) {
          result=cloneArea();
        }
        result.addChild(cell);
        result.setCell(cell);
      }
      i=cells[i].getColSpan() + i - 1;
    }
  }
  if (result != null) {
    result.updateRow(this);
    updateRow();
    return new SplitResult(result,SplitResult.SPLIT_SUCCEED_WITH_PART);
  }
 else {
    return SplitResult.SUCCEED_WITH_NULL;
  }
}

Fixed version (ground truth):
protected SplitResult _split(int height,boolean force) throws BirtException {
  RowArea result=null;
  for (int i=0; i < cells.length; i++) {
    if (cells[i] != null) {
      SplitResult splitCell=cells[i].split(height,force);
      CellArea cell=(CellArea)splitCell.getResult();
      if (cell != null) {
        if (result == null) {
          result=cloneArea();
        }
        result.addChild(cell);
        result.setCell(cell);
      }
      i=cells[i].getColSpan() + i - 1;
    }
  }
  if (result != null) {
    result.updateRow(this);
    updateRow();
    return new SplitResult(result,SplitResult.SPLIT_SUCCEED_WITH_PART);
  }
 else {
    updateRow();
    return SplitResult.SUCCEED_WITH_NULL;
  }
}