nus-yam/ex-repair huggingface dataset:
Program: 70983
Project: 70983
Buggy source:
private void processLevelPageBreakIntervals(IColumn col) throws OLAPException {
  if (lastColumnLevelState == null) {
    lastColumnLevelState=GroupUtil.getLevelCursorState(columnCursor);
    checkedColumnLevelState=GroupUtil.getLevelCursorState(columnCursor);
    return;
  }
  long[] currentColumnLevelState=GroupUtil.getLevelCursorState(columnCursor);
  for (int i=0; i < columnLevelPageBreakIntervals.length; i++) {
    if (columnLevelPageBreakIntervals[i] > 0) {
      long currentPos=currentColumnLevelState[i];
      long lastPos=lastColumnLevelState[i];
      if (currentPos == lastPos) {
        continue;
      }
      long lastCheckedPos=checkedColumnLevelState[i];
      if (currentPos - lastCheckedPos >= columnLevelPageBreakIntervals[i]) {
        col.getStyle().setProperty(IStyle.STYLE_PAGE_BREAK_BEFORE,IStyle.ALWAYS_VALUE);
        System.arraycopy(currentColumnLevelState,0,checkedColumnLevelState,0,currentColumnLevelState.length);
      }
      for (int j=i + 1; j < columnLevelPageBreakIntervals.length; j++) {
        checkedColumnLevelState[j]=0;
      }
    }
  }
  lastColumnLevelState=currentColumnLevelState;
}

Fixed version (ground truth):
private void processLevelPageBreakIntervals(IColumn col) throws OLAPException {
  if (lastColumnLevelState == null) {
    lastColumnLevelState=GroupUtil.getLevelCursorState(columnCursor);
    checkedColumnLevelState=GroupUtil.getLevelCursorState(columnCursor);
    return;
  }
  long[] currentColumnLevelState=GroupUtil.getLevelCursorState(columnCursor);
  for (int i=0; i < columnLevelPageBreakIntervals.length; i++) {
    long currentPos=currentColumnLevelState[i];
    long lastPos=lastColumnLevelState[i];
    if (currentPos == lastPos) {
      continue;
    }
    if (columnLevelPageBreakIntervals[i] > 0) {
      long lastCheckedPos=checkedColumnLevelState[i];
      if (currentPos - lastCheckedPos >= columnLevelPageBreakIntervals[i]) {
        col.getStyle().setProperty(IStyle.STYLE_PAGE_BREAK_BEFORE,IStyle.ALWAYS_VALUE);
        System.arraycopy(currentColumnLevelState,0,checkedColumnLevelState,0,currentColumnLevelState.length);
      }
    }
    for (int j=i + 1; j < columnLevelPageBreakIntervals.length; j++) {
      checkedColumnLevelState[j]=0;
    }
  }
  lastColumnLevelState=currentColumnLevelState;
}
Program: 70984
Project: 70984
Buggy source:
public void endListBand(IListBandContent listBand){
  engine.endCell();
}

Fixed version (ground truth):
public void endListBand(IListBandContent listBand){
  engine.endContainer();
}
Program: 70985
Project: 70985
Buggy source:
private void addData(SheetData data){
  XlsContainer container=getCurrentContainer();
  container.setEmpty(false);
  int col=axis.getColumnIndexByCoordinate(data.getSizeInfo().getStartCoordinate());
  int span=axis.getColumnIndexByCoordinate(data.getSizeInfo().getEndCoordinate()) - col;
  applyTopBorderStyle(data);
  updataRowIndex(data,container);
  outputDataIfBufferIsFull();
  addDatatoCache(col,data);
  for (int i=col + 1; i < col + span; i++) {
    BlankData blankData=new BlankData(data);
    addDatatoCache(i,blankData);
  }
  if (container instanceof XlsCell) {
    XlsCell cell=(XlsCell)container;
    data.setRowSpanInDesign(cell.getRowSpan() - 1);
  }
}

Fixed version (ground truth):
private void addData(SheetData data){
  XlsContainer container=getCurrentContainer();
  container.setEmpty(false);
  int col=axis.getColumnIndexByCoordinate(data.getSizeInfo().getStartCoordinate());
  int span=axis.getColumnIndexByCoordinate(data.getSizeInfo().getEndCoordinate()) - col;
  applyTopBorderStyle(data);
  updataRowIndex(data,container);
  outputDataIfBufferIsFull();
  addDatatoCache(col,data);
  SheetData newData=new Data(data);
  for (int i=col + 1; i < col + span; i++) {
    BlankData blankData=new BlankData(newData);
    addDatatoCache(i,blankData);
  }
  if (container instanceof XlsCell) {
    XlsCell cell=(XlsCell)container;
    data.setRowSpanInDesign(cell.getRowSpan() - 1);
  }
}
Program: 70986
Project: 70986
Buggy source:
protected void endCell(IContent content,boolean finished,IContentEmitter emitter,boolean visible) throws BirtException {
  AbstractNode current=(AbstractNode)currentNode;
  if (!current.isFirst) {
    current.setFinished(false);
  }
 else {
    current.setFinished(finished);
  }
  if (currentNode.isStarted()) {
    currentNode.end();
  }
 else {
    if (finished && !isRepeated) {
      currentNode.start();
      currentNode.end();
    }
  }
  currentNode=currentNode.getParent();
}

Fixed version (ground truth):
protected void endCell(IContent content,boolean finished,IContentEmitter emitter,boolean visible) throws BirtException {
  AbstractNode current=(AbstractNode)currentNode;
  if (!current.isFirst) {
    current.setFinished(false);
  }
 else {
    current.setFinished(finished);
  }
  if (currentNode.isStarted()) {
    currentNode.end();
  }
 else {
    if (finished && !isRepeated) {
    }
  }
  currentNode=currentNode.getParent();
}
Program: 70987
Project: 70987
Buggy source:
public void endContainer(IContent content,boolean finished,IContentEmitter emitter,boolean visible) throws BirtException {
  int type=content.getContentType();
switch (type) {
case IContent.TABLE_BAND_CONTENT:
case IContent.LIST_BAND_CONTENT:
    boolean isFinished=finished && !isRepeated;
  _endContainer(content,isFinished,emitter,visible);
break;
case IContent.PAGE_CONTENT:
endPage(content,finished,emitter);
break;
case IContent.CELL_CONTENT:
endCell(content,finished,emitter,visible);
break;
default :
_endContainer(content,finished,emitter,visible);
break;
}
}

Fixed version (ground truth):
public void endContainer(IContent content,boolean finished,IContentEmitter emitter,boolean visible) throws BirtException {
  int type=content.getContentType();
switch (type) {
case IContent.TABLE_BAND_CONTENT:
case IContent.LIST_BAND_CONTENT:
    boolean isFinished=finished && !isRepeated;
  _endContainer(content,isFinished,emitter,visible);
break;
case IContent.PAGE_CONTENT:
endPage(content,finished,emitter);
break;
case IContent.ROW_CONTENT:
isFinished=finished && !isRepeated;
endRow(content,finished,emitter,visible);
break;
case IContent.CELL_CONTENT:
endCell(content,finished,emitter,visible);
break;
default :
_endContainer(content,finished,emitter,visible);
break;
}
}
Program: 70988
Project: 70988
Buggy source:
public URLClassLoader(URL[] urls,ClassLoader parent){
  super(new URL[]{},parent);
  this.urls=urls;
  loaders=new ArrayList<Loader>(urls.length);
  for (int i=0; i < urls.length; i++) {
    Loader loader=createLoader(urls[i]);
    loaders.add(loader);
  }
}

Fixed version (ground truth):
public URLClassLoader(URL[] urls,ClassLoader parent){
  super(new URL[]{},parent);
  initURLs(urls);
  loaders=new ArrayList<Loader>(urls.length);
  for (int i=0; i < urls.length; i++) {
    Loader loader=createLoader(urls[i]);
    loaders.add(loader);
  }
}
Program: 70989
Project: 70989
Buggy source:
public URL[] getURLs(){
  return urls;
}

Fixed version (ground truth):
public URL[] getURLs(){
  return this.urls.toArray(new URL[0]);
}
Program: 70990
Project: 70990
Buggy source:
/** 
 * Returns the raw column with, if it's a fix value, covert it to Pixel unit, if it's a relative value or none, retain it.
 * @return The raw width
 */
public String getRawWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  String unit=handle.getUnits();
  if (unit == null || unit.length() == 0) {
    return "String_Node_Str";
  }
 else   if (unit.equals(DesignChoiceConstants.UNITS_PERCENTAGE)) {
    return String.valueOf(handle.getMeasure()) + unit;
  }
 else {
    int px=(int)DEUtil.convertoToPixel(handle);
    if (handle.isSet()) {
      px=1;
    }
    if (px <= 0) {
      TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
      return String.valueOf(adapter.getDefaultWidth(getColumnNumber()));
    }
    return String.valueOf(px);
  }
}

Fixed version (ground truth):
/** 
 * Returns the raw column with, if it's a fix value, covert it to Pixel unit, if it's a relative value or none, retain it.
 * @return The raw width
 */
public String getRawWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  String unit=handle.getUnits();
  if (unit == null || unit.length() == 0) {
    return "String_Node_Str";
  }
 else   if (unit.equals(DesignChoiceConstants.UNITS_PERCENTAGE)) {
    return String.valueOf(handle.getMeasure()) + unit;
  }
 else {
    int px=(int)DEUtil.convertoToPixel(handle);
    if (px <= 0) {
      if (handle.isSet()) {
        px=1;
      }
 else {
        TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
        return String.valueOf(adapter.getDefaultWidth(getColumnNumber()));
      }
    }
    return String.valueOf(px);
  }
}
Program: 70993
Project: 70993
Buggy source:
public void handleEvent(Event event){
  if (event.widget.equals(cmbBackground)) {
    getChart().getBlock().setBackground((Fill)event.data);
  }
 else   if (event.widget.equals(fccWall)) {
    if (hasWallAndFloor()) {
      ((ChartWithAxes)getChart()).setWallFill((Fill)event.data);
    }
  }
 else   if (event.widget.equals(fccFloor)) {
    if (hasWallAndFloor()) {
      ((ChartWithAxes)getChart()).setFloorFill((Fill)event.data);
    }
  }
 else   if (event.widget == txtEmptyMsg) {
    getChart().getEmptyMessage().getCaption().setValue(txtEmptyMsg.getText());
  }
 else   if (event.widget == btnAutoHide) {
    getChart().getEmptyMessage().setVisible(!btnAutoHide.getSelection());
    txtEmptyMsg.setEnabled(getChart().getEmptyMessage().isVisible());
    fdcEmptyMsg.setEnabled(getChart().getEmptyMessage().isVisible());
  }
 else   if (event.widget == fdcEmptyMsg) {
    Text caption=getChart().getEmptyMessage().getCaption();
    caption.setFont((FontDefinition)((Object[])event.data)[0]);
    caption.setColor((ColorDefinition)((Object[])event.data)[1]);
  }
}

Fixed version (ground truth):
public void handleEvent(Event event){
  if (event.widget.equals(cmbBackground)) {
    getChart().getBlock().setBackground((Fill)event.data);
  }
 else   if (event.widget.equals(fccWall)) {
    if (hasWallAndFloor()) {
      ((ChartWithAxes)getChart()).setWallFill((Fill)event.data);
    }
  }
 else   if (event.widget.equals(fccFloor)) {
    if (hasWallAndFloor()) {
      ((ChartWithAxes)getChart()).setFloorFill((Fill)event.data);
    }
  }
 else   if (event.widget == txtEmptyMsg) {
    getChart().getEmptyMessage().getCaption().setValue(txtEmptyMsg.getText());
  }
 else   if (event.widget == btnAutoHide) {
    getChart().getEmptyMessage().setVisible(!btnAutoHide.getSelection());
    updateEmptyMessageUIStates();
  }
 else   if (event.widget == fdcEmptyMsg) {
    Text caption=getChart().getEmptyMessage().getCaption();
    caption.setFont((FontDefinition)((Object[])event.data)[0]);
    caption.setColor((ColorDefinition)((Object[])event.data)[1]);
  }
}
Program: 70995
Project: 70995
Buggy source:
protected void writeFields(DataOutputStream out) throws IOException {
  if (name != null) {
    IOUtil.writeShort(out,FIELD_NAME);
    IOUtil.writeString(out,name);
  }
  if (x != null) {
    IOUtil.writeShort(out,FIELD_X);
    x.writeObject(out);
  }
  if (y != null) {
    IOUtil.writeShort(out,FIELD_Y);
    y.writeObject(out);
  }
  if (width != null) {
    IOUtil.writeShort(out,FIELD_WIDTH);
    width.writeObject(out);
  }
  if (height != null) {
    IOUtil.writeShort(out,FIELD_HEIGHT);
    height.writeObject(out);
  }
  if (hyperlink != null) {
    IOUtil.writeShort(out,FIELD_HYPERLINK);
    ((ActionContent)hyperlink).writeObject(out);
  }
  if (bookmark != null) {
    IOUtil.writeShort(out,FIELD_BOOKMARK);
    IOUtil.writeString(out,bookmark);
  }
  if (helpText != null) {
    IOUtil.writeShort(out,FIELD_HELPTEXT);
    IOUtil.writeString(out,helpText);
  }
  if (inlineStyle != null) {
    if (!inlineStyle.isEmpty()) {
      IOUtil.writeShort(out,FIELD_INLINESTYLE_VERSION_1);
      inlineStyle.write(out);
    }
  }
  if (instanceId != null) {
    IOUtil.writeShort(out,FIELD_INSTANCE_ID);
    IOUtil.writeString(out,instanceId.toString());
  }
  if (toc != null) {
    IOUtil.writeShort(out,FIELD_TOC);
    IOUtil.writeObject(out,toc);
  }
  if (acl != null) {
    IOUtil.writeShort(out,FIELD_ACL);
    IOUtil.writeObject(out,acl);
  }
}

Fixed version (ground truth):
protected void writeFields(DataOutputStream out) throws IOException {
  if (name != null) {
    IOUtil.writeShort(out,FIELD_NAME);
    IOUtil.writeString(out,name);
  }
  if (x != null) {
    IOUtil.writeShort(out,FIELD_X);
    x.writeObject(out);
  }
  if (y != null) {
    IOUtil.writeShort(out,FIELD_Y);
    y.writeObject(out);
  }
  if (width != null) {
    IOUtil.writeShort(out,FIELD_WIDTH);
    width.writeObject(out);
  }
  if (height != null) {
    IOUtil.writeShort(out,FIELD_HEIGHT);
    height.writeObject(out);
  }
  if (hyperlink != null) {
    IOUtil.writeShort(out,FIELD_HYPERLINK);
    ((ActionContent)hyperlink).writeObject(out);
  }
  if (bookmark != null) {
    IOUtil.writeShort(out,FIELD_BOOKMARK);
    IOUtil.writeString(out,bookmark);
  }
  if (helpText != null) {
    IOUtil.writeShort(out,FIELD_HELPTEXT);
    IOUtil.writeString(out,helpText);
  }
  if (inlineStyle != null) {
    if (!inlineStyle.isEmpty()) {
      IOUtil.writeShort(out,FIELD_INLINESTYLE_VERSION_1);
      inlineStyle.write(out);
    }
  }
  if (classStyle != null && !classStyle.isEmpty()) {
    IOUtil.writeShort(out,FIELD_CLASS_STYLE);
    classStyle.write(out);
  }
  if (instanceId != null) {
    IOUtil.writeShort(out,FIELD_INSTANCE_ID);
    IOUtil.writeString(out,instanceId.toString());
  }
  if (toc != null) {
    IOUtil.writeShort(out,FIELD_TOC);
    IOUtil.writeObject(out,toc);
  }
  if (acl != null) {
    IOUtil.writeShort(out,FIELD_ACL);
    IOUtil.writeObject(out,acl);
  }
}
Program: 70996
Project: 70996
Buggy source:
protected void readField(int version,int filedId,DataInputStream in,ClassLoader loader) throws IOException {
switch (filedId) {
case FIELD_NAME:
    name=IOUtil.readString(in);
  break;
case FIELD_X:
x=new DimensionType();
x.readObject(in);
break;
case FIELD_Y:
y=new DimensionType();
y.readObject(in);
break;
case FIELD_WIDTH:
width=new DimensionType();
width.readObject(in);
break;
case FIELD_HEIGHT:
height=new DimensionType();
height.readObject(in);
break;
case FIELD_HYPERLINK:
ActionContent action=new ActionContent();
action.readObject(in,loader);
hyperlink=action;
break;
case FIELD_BOOKMARK:
bookmark=IOUtil.readString(in);
break;
case FIELD_HELPTEXT:
helpText=IOUtil.readString(in);
break;
case FIELD_INLINESTYLE_VERSION_0:
String styleCssText=IOUtil.readString(in);
if (styleCssText != null && styleCssText.length() != 0) {
inlineStyle=new StyleDeclaration(cssEngine);
inlineStyle.setCssText(styleCssText);
}
break;
case FIELD_INLINESTYLE_VERSION_1:
IStyle style=new StyleDeclaration(cssEngine);
if (null != style) {
style.read(in);
if (!style.isEmpty()) {
inlineStyle=style;
}
}
break;
case FIELD_INSTANCE_ID:
String value=IOUtil.readString(in);
instanceId=InstanceID.parse(value);
break;
case FIELD_TOC:
toc=IOUtil.readObject(in,loader);
break;
case FIELD_ACL:
acl=IOUtil.readString(in);
}
}

Fixed version (ground truth):
protected void readField(int version,int filedId,DataInputStream in,ClassLoader loader) throws IOException {
switch (filedId) {
case FIELD_NAME:
    name=IOUtil.readString(in);
  break;
case FIELD_X:
x=new DimensionType();
x.readObject(in);
break;
case FIELD_Y:
y=new DimensionType();
y.readObject(in);
break;
case FIELD_WIDTH:
width=new DimensionType();
width.readObject(in);
break;
case FIELD_HEIGHT:
height=new DimensionType();
height.readObject(in);
break;
case FIELD_HYPERLINK:
ActionContent action=new ActionContent();
action.readObject(in,loader);
hyperlink=action;
break;
case FIELD_BOOKMARK:
bookmark=IOUtil.readString(in);
break;
case FIELD_HELPTEXT:
helpText=IOUtil.readString(in);
break;
case FIELD_INLINESTYLE_VERSION_0:
String styleCssText=IOUtil.readString(in);
if (styleCssText != null && styleCssText.length() != 0) {
inlineStyle=new StyleDeclaration(cssEngine);
inlineStyle.setCssText(styleCssText);
}
break;
case FIELD_INLINESTYLE_VERSION_1:
inlineStyle=readStyle(in);
break;
case FIELD_CLASS_STYLE:
classStyle=readStyle(in);
break;
case FIELD_INSTANCE_ID:
String value=IOUtil.readString(in);
instanceId=InstanceID.parse(value);
break;
case FIELD_TOC:
toc=IOUtil.readObject(in,loader);
break;
case FIELD_ACL:
acl=IOUtil.readString(in);
}
}
Program: 70998
Project: 70998
Buggy source:
private void readReport(DataInputStream dis) throws IOException {
  short num=IOUtil.readShort(dis);
  for (short i=0; i < num; i++) {
    short reportSegmentType=IOUtil.readShort(dis);
switch (reportSegmentType) {
case FIELD_REPORT_STYLES:
      readReportSytles(dis);
    break;
case FIELD_REPORT_NAMED_EXPRESSIONS:
  readReportNamedExpressions(dis);
break;
case FIELD_REPORT_MASTER_PAGES:
readReportPageSetup(dis);
break;
case FIELD_REPORT_BODY:
readReportBodyContent(dis);
break;
default :
throw new IOException("String_Node_Str" + reportSegmentType);
}
}
}

Fixed version (ground truth):
private void readReport(DataInputStream dis) throws IOException {
  short num=IOUtil.readShort(dis);
  for (short i=0; i < num; i++) {
    short reportSegmentType=IOUtil.readShort(dis);
switch (reportSegmentType) {
case FIELD_REPORT_STYLES:
      readReportSytles(dis);
    break;
case FIELD_ROOT_STYLE:
  reportDesign.setRootStyle(readStyle(dis));
break;
case FIELD_REPORT_NAMED_EXPRESSIONS:
readReportNamedExpressions(dis);
break;
case FIELD_REPORT_MASTER_PAGES:
readReportPageSetup(dis);
break;
case FIELD_REPORT_BODY:
readReportBodyContent(dis);
break;
default :
throw new IOException("String_Node_Str" + reportSegmentType);
}
}
String rootStyleName=reportDesign.getRootStyleName();
if (rootStyleName != null && reportDesign.getRootStyle() == null) {
reportDesign.setRootStyle(reportDesign.findStyle(rootStyleName));
}
}
Program: 70999
Project: 70999
Buggy source:
protected void readStyledElementField(DataInputStream in,StyledElementDesign design,short fieldType) throws IOException {
switch (fieldType) {
case FIELD_STYLE_CLASS:
    String styleClass=IOUtil.readString(in);
  design.setStyleClass(styleClass);
break;
case FIELD_MAP:
MapDesign map=readMap(in);
design.setMap(map);
break;
case FIELD_HIGHLIGHT:
HighlightDesign highlight=readHighlight(in);
design.setHighlight(highlight);
break;
default :
readReportElementField(in,design,fieldType);
}
}

Fixed version (ground truth):
protected void readStyledElementField(DataInputStream in,StyledElementDesign design,short fieldType) throws IOException {
switch (fieldType) {
case FIELD_STYLE_CLASS:
    String styleClass=IOUtil.readString(in);
  design.setStyleClass(styleClass);
break;
case FIELD_STYLE:
design.setStyle(readStyle(in));
break;
case FIELD_MAP:
MapDesign map=readMap(in);
design.setMap(map);
break;
case FIELD_HIGHLIGHT:
HighlightDesign highlight=readHighlight(in);
design.setHighlight(highlight);
break;
default :
readReportElementField(in,design,fieldType);
}
}
Program: 71000
Project: 71000
Buggy source:
private void writeReport(DataOutputStream dos,Report design) throws IOException {
  IOUtil.writeShort(dos,(short)4);
  IOUtil.writeShort(dos,FIELD_REPORT_STYLES);
  writeReportStyles(dos,design);
  IOUtil.writeShort(dos,FIELD_REPORT_NAMED_EXPRESSIONS);
  writeReportNamedExpressions(dos,design);
  IOUtil.writeShort(dos,FIELD_REPORT_MASTER_PAGES);
  ReportItemWriter writer=new ReportItemWriter(dos);
  writeReportPageSetup(dos,writer,design);
  IOUtil.writeShort(dos,FIELD_REPORT_BODY);
  writeReportBodyContent(dos,writer,design);
}

Fixed version (ground truth):
private void writeReport(DataOutputStream dos,Report design) throws IOException {
  IOUtil.writeShort(dos,(short)5);
  IOUtil.writeShort(dos,FIELD_REPORT_STYLES);
  writeReportStyles(dos,design);
  IOUtil.writeShort(dos,FIELD_ROOT_STYLE);
  design.getRootStyle().write(dos);
  IOUtil.writeShort(dos,FIELD_REPORT_NAMED_EXPRESSIONS);
  writeReportNamedExpressions(dos,design);
  IOUtil.writeShort(dos,FIELD_REPORT_MASTER_PAGES);
  ReportItemWriter writer=new ReportItemWriter(dos);
  writeReportPageSetup(dos,writer,design);
  IOUtil.writeShort(dos,FIELD_REPORT_BODY);
  writeReportBodyContent(dos,writer,design);
}
Program: 71001
Project: 71001
Buggy source:
protected void writeStyledElement(DataOutputStream out,StyledElementDesign design) throws IOException {
  writeReportElement(out,design);
  String styleClass=design.getStyleClass();
  if (styleClass != null) {
    IOUtil.writeShort(out,FIELD_STYLE_CLASS);
    IOUtil.writeString(out,styleClass);
  }
  MapDesign map=design.getMap();
  if (map != null) {
    IOUtil.writeShort(out,FIELD_MAP);
    writeMap(out,map);
  }
  HighlightDesign highlight=design.getHighlight();
  ;
  if (highlight != null) {
    IOUtil.writeShort(out,FIELD_HIGHLIGHT);
    writeHighlight(out,highlight);
  }
}

Fixed version (ground truth):
protected void writeStyledElement(DataOutputStream out,StyledElementDesign design) throws IOException {
  writeReportElement(out,design);
  String styleClass=design.getStyleClass();
  if (styleClass != null) {
    IOUtil.writeShort(out,FIELD_STYLE_CLASS);
    IOUtil.writeString(out,styleClass);
  }
  IStyle style=design.getStyle();
  if (style != null && !style.isEmpty()) {
    IOUtil.writeShort(out,FIELD_STYLE);
    style.write(out);
  }
  MapDesign map=design.getMap();
  if (map != null) {
    IOUtil.writeShort(out,FIELD_MAP);
    writeMap(out,map);
  }
  HighlightDesign highlight=design.getHighlight();
  ;
  if (highlight != null) {
    IOUtil.writeShort(out,FIELD_HIGHLIGHT);
    writeHighlight(out,highlight);
  }
}
Program: 71004
Project: 71004
Buggy source:
/** 
 */
public void applyContainerBottomStyle(){
  XlsContainer container=engine.getCurrentContainer();
  ContainerSizeInfo rule=container.getSizeInfo();
  StyleEntry entry=container.getStyle();
  int start=rule.getStartCoordinate();
  int col=engine.getAxis().getColumnIndexByCoordinate(start);
  int span=engine.getAxis().getColumnIndexByCoordinate(rule.getEndCoordinate()) - col;
  for (int i=0; i < span; i++) {
    SheetData data=engine.getColumnLastData(i);
    if (data == null) {
      continue;
    }
    StyleBuilder.applyBottomBorder(entry,data.style);
  }
}

Fixed version (ground truth):
/** 
 */
public void applyContainerBottomStyle(){
  XlsContainer container=engine.getCurrentContainer();
  ContainerSizeInfo rule=container.getSizeInfo();
  StyleEntry entry=container.getStyle();
  int start=rule.getStartCoordinate();
  int col=engine.getAxis().getColumnIndexByCoordinate(start);
  int span=engine.getAxis().getColumnIndexByCoordinate(rule.getEndCoordinate());
  for (int i=col; i < span; i++) {
    SheetData data=engine.getColumnLastData(i);
    if (data == null) {
      continue;
    }
    StyleBuilder.applyBottomBorder(entry,data.style);
  }
}
Program: 71005
Project: 71005
Buggy source:
public void run(){
  try {
    this.statement.execute();
    if (this.closeStatementAfterExecution)     this.statement.close();
  }
 catch (  DataException e) {
    this.exception=e;
  }
  this.close=true;
}

Fixed version (ground truth):
public void run(){
  try {
    this.statement.execute();
    if (this.closeStatementAfterExecution)     this.statement.close();
  }
 catch (  Exception e) {
    this.exception=new DataException(e.getLocalizedMessage());
  }
}
Program: 71006
Project: 71006
Buggy source:
private void setupClassStyles(StyledElementDesign design,ReportElementHandle handle){
  List<StyleHandle> styles=handle.getFactoryElementHandle().getAllFactoryStyles();
  StringBuffer buffer=new StringBuffer();
  for (int i=styles.size() - 1; i >= 0; i--) {
    StyleHandle styleHandle=styles.get(i);
    StyleDeclaration style=createPrivateStyle(styleHandle);
    String name=styleHandle.getName();
    if (!report.getStyles().containsKey(name))     report.addStyle(name,style);
    appendStyleName(buffer,name);
  }
  StyleDeclaration style=createPrivateStyle(handle.getPrivateStyle());
  if (style != null && !style.isEmpty()) {
    appendStyleName(buffer,assignStyleName(style));
  }
  if (buffer.length() > 0)   design.setStyleClass(buffer.toString());
  design.setStyle(createPrivateStyle(handle));
}

Fixed version (ground truth):
private void setupClassStyles(StyledElementDesign design,ReportElementHandle handle){
  List<StyleHandle> styles=handle.getFactoryElementHandle().getAllFactoryStyles();
  StringBuffer buffer=new StringBuffer();
  for (int i=styles.size() - 1; i >= 0; i--) {
    StyleHandle styleHandle=styles.get(i);
    StyleDeclaration style=createPrivateStyle(styleHandle);
    String name=styleHandle.getName();
    if (!report.getStyles().containsKey(name))     report.addStyle(name,style);
    appendStyleName(buffer,name);
  }
  StyleHandle privateStyle=handle.getPrivateStyle();
  if (privateStyle != null) {
    StyleDeclaration style=createPrivateStyle(privateStyle);
    if (style != null && !style.isEmpty()) {
      appendStyleName(buffer,assignStyleName(style));
    }
  }
  if (buffer.length() > 0)   design.setStyleClass(buffer.toString());
  design.setStyle(createPrivateStyle(handle));
}
Program: 71007
Project: 71007
Buggy source:
@Override public void run(){
  try {
    this.statement.execute();
    if (this.closeStatementAfterExecution)     this.statement.close();
  }
 catch (  DataException e) {
    this.exception=e;
  }
  this.close=true;
}

Fixed version (ground truth):
public void run(){
  try {
    this.statement.execute();
    if (this.closeStatementAfterExecution)     this.statement.close();
  }
 catch (  DataException e) {
    this.exception=e;
  }
  this.close=true;
}
Program: 71008
Project: 71008
Buggy source:
private void setAntialiasProperties(Graphics2D g2d){
  g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
  g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_ON);
}

Fixed version (ground truth):
private void setAntialiasProperties(Graphics2D g2d){
  g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
  g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  adjustFractionalMetrics();
}
Program: 71009
Project: 71009
Buggy source:
public final int getDpiResolution(){
  if (iDpiResolution == 0) {
switch (getGraphicsContext().getDeviceConfiguration().getDevice().getType()) {
case GraphicsDevice.TYPE_RASTER_SCREEN:
      iDpiResolution=computeScreenDpi();
    break;
case GraphicsDevice.TYPE_PRINTER:
  iDpiResolution=72;
break;
case GraphicsDevice.TYPE_IMAGE_BUFFER:
if (userResolution == 0) {
iDpiResolution=computeScreenDpi();
}
 else {
iDpiResolution=userResolution;
}
break;
}
if (iDpiResolution >= 192) {
_g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_ON);
}
 else {
_g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
}
}
return iDpiResolution;
}

Fixed version (ground truth):
public final int getDpiResolution(){
  if (iDpiResolution == 0) {
switch (getGraphicsContext().getDeviceConfiguration().getDevice().getType()) {
case GraphicsDevice.TYPE_RASTER_SCREEN:
      iDpiResolution=computeScreenDpi();
    break;
case GraphicsDevice.TYPE_PRINTER:
  iDpiResolution=72;
break;
case GraphicsDevice.TYPE_IMAGE_BUFFER:
if (userResolution == 0) {
iDpiResolution=computeScreenDpi();
}
 else {
iDpiResolution=userResolution;
}
break;
}
adjustFractionalMetrics();
}
return iDpiResolution;
}
Program: 71012
Project: 71012
Buggy source:
public boolean performOk(){
  ViewerPlugin.getDefault().getPluginPreferences().setValue(PREVIEW_MAXROW,txtMaxDataSetRow.getIntValue());
  ViewerPlugin.getDefault().getPluginPreferences().setValue(PREVIEW_MAX_ROW_LEVEL_MEMBER,txtMaxRowLevelMember.getIntValue());
  ViewerPlugin.getDefault().getPluginPreferences().setValue(PREVIEW_MAX_COLUMN_LEVEL_MEMBER,txtMaxColumnLevelMember.getIntValue());
  ViewerPlugin.getDefault().getPluginPreferences().setValue(PREVIEW_MAX_IN_MEMORY_CUBE_SIZE,txtMaxInMemoryCubeSize.getIntValue());
  ViewerPlugin.getDefault().savePluginPreferences();
  return super.performOk();
}

Fixed version (ground truth):
public boolean performOk(){
  int maxRowValue=noLimitBtn.getSelection() ? DATASET_DISPLAY_ALL_ROW : txtMaxDataSetRow.getIntValue();
  ViewerPlugin.getDefault().getPluginPreferences().setValue(PREVIEW_MAXROW,maxRowValue);
  ViewerPlugin.getDefault().getPluginPreferences().setValue(PREVIEW_MAX_ROW_LEVEL_MEMBER,txtMaxRowLevelMember.getIntValue());
  ViewerPlugin.getDefault().getPluginPreferences().setValue(PREVIEW_MAX_COLUMN_LEVEL_MEMBER,txtMaxColumnLevelMember.getIntValue());
  ViewerPlugin.getDefault().getPluginPreferences().setValue(PREVIEW_MAX_IN_MEMORY_CUBE_SIZE,txtMaxInMemoryCubeSize.getIntValue());
  ViewerPlugin.getDefault().savePluginPreferences();
  return super.performOk();
}
Program: 71013
Project: 71013
Buggy source:
private void initControlValues(){
  String defaultMaxRow=ViewerPlugin.getDefault().getPluginPreferences().getString(PREVIEW_MAXROW);
  if (defaultMaxRow == null || defaultMaxRow.trim().length() <= 0) {
    defaultMaxRow=String.valueOf(MAX_DATASET_ROW_DEFAULT);
  }
  txtMaxDataSetRow.setStringValue(defaultMaxRow);
  defaultMaxRow=ViewerPlugin.getDefault().getPluginPreferences().getString(PREVIEW_MAX_ROW_LEVEL_MEMBER);
  if (defaultMaxRow == null || defaultMaxRow.trim().length() <= 0) {
    defaultMaxRow=String.valueOf(MAX_CUBE_ROW_LEVEL_MEMBER_DEFAULT);
  }
  txtMaxRowLevelMember.setStringValue(defaultMaxRow);
  defaultMaxRow=ViewerPlugin.getDefault().getPluginPreferences().getString(PREVIEW_MAX_COLUMN_LEVEL_MEMBER);
  if (defaultMaxRow == null || defaultMaxRow.trim().length() <= 0) {
    defaultMaxRow=String.valueOf(MAX_CUBE_COLUMN_LEVEL_MEMBER_DEFAULT);
  }
  txtMaxColumnLevelMember.setStringValue(defaultMaxRow);
  defaultMaxRow=ViewerPlugin.getDefault().getPluginPreferences().getString(PREVIEW_MAX_IN_MEMORY_CUBE_SIZE);
  if (defaultMaxRow == null || defaultMaxRow.trim().length() <= 0) {
    defaultMaxRow=String.valueOf(MAX_IN_MEMORY_CUBE_SIZE_DEFAULT);
  }
  txtMaxInMemoryCubeSize.setStringValue(defaultMaxRow);
}

Fixed version (ground truth):
private void initControlValues(){
  String defaultMaxRow=ViewerPlugin.getDefault().getPluginPreferences().getString(PREVIEW_MAXROW);
  if (defaultMaxRow == null || defaultMaxRow.trim().length() <= 0) {
    defaultMaxRow=String.valueOf(MAX_DATASET_ROW_DEFAULT);
  }
  boolean previewAllRows=String.valueOf(DATASET_DISPLAY_ALL_ROW).equals(defaultMaxRow.trim());
  noLimitBtn.setSelection(previewAllRows);
  txtMaxDataSetRow.setEnabled(!previewAllRows,noLimitBtn.getParent());
  txtMaxDataSetRow.setStringValue(previewAllRows ? "String_Node_Str" : defaultMaxRow);
  defaultMaxRow=ViewerPlugin.getDefault().getPluginPreferences().getString(PREVIEW_MAX_ROW_LEVEL_MEMBER);
  if (defaultMaxRow == null || defaultMaxRow.trim().length() <= 0) {
    defaultMaxRow=String.valueOf(MAX_CUBE_ROW_LEVEL_MEMBER_DEFAULT);
  }
  txtMaxRowLevelMember.setStringValue(defaultMaxRow);
  defaultMaxRow=ViewerPlugin.getDefault().getPluginPreferences().getString(PREVIEW_MAX_COLUMN_LEVEL_MEMBER);
  if (defaultMaxRow == null || defaultMaxRow.trim().length() <= 0) {
    defaultMaxRow=String.valueOf(MAX_CUBE_COLUMN_LEVEL_MEMBER_DEFAULT);
  }
  txtMaxColumnLevelMember.setStringValue(defaultMaxRow);
  defaultMaxRow=ViewerPlugin.getDefault().getPluginPreferences().getString(PREVIEW_MAX_IN_MEMORY_CUBE_SIZE);
  if (defaultMaxRow == null || defaultMaxRow.trim().length() <= 0) {
    defaultMaxRow=String.valueOf(MAX_IN_MEMORY_CUBE_SIZE_DEFAULT);
  }
  txtMaxInMemoryCubeSize.setStringValue(defaultMaxRow);
}
Program: 71016
Project: 71016
Buggy source:
public HashMap<String,String> getExpressions(){
  if (text == null) {
    return null;
  }
  if (exprs != null) {
    return exprs;
  }
  if (HTML_TEXT.equals(textType) || (AUTO_TEXT.equals(textType) && startsWithIgnoreCase(text,"String_Node_Str"))) {
    exprs=new HashMap<String,String>();
    TextTemplate template=new TemplateParser().parse(text);
    if (template != null && template.getNodes() != null) {
      Iterator itor=template.getNodes().iterator();
      Object obj;
      while (itor.hasNext()) {
        obj=itor.next();
        if (obj instanceof TextTemplate.ValueNode) {
          ValueNode valueNode=(TextTemplate.ValueNode)obj;
          addExpression(valueNode.getValue());
          addExpression(valueNode.getFormatExpression());
        }
 else         if (obj instanceof TextTemplate.ImageNode) {
          addExpression(((TextTemplate.ImageNode)obj).getExpr());
        }
      }
    }
  }
  return exprs;
}

Fixed version (ground truth):
public HashMap<String,String> getExpressions(){
  if (text == null) {
    return null;
  }
  if (exprs != null) {
    return exprs;
  }
  if (HTML_TEXT.equals(textType) || (AUTO_TEXT.equals(textType) && startsWithIgnoreCase(text,"String_Node_Str"))) {
    exprs=new HashMap<String,String>();
    TextTemplate template=null;
    try {
      template=new TemplateParser().parse(text);
    }
 catch (    Throwable ignored) {
    }
    if (template != null && template.getNodes() != null) {
      Iterator itor=template.getNodes().iterator();
      Object obj;
      while (itor.hasNext()) {
        obj=itor.next();
        if (obj instanceof TextTemplate.ValueNode) {
          ValueNode valueNode=(TextTemplate.ValueNode)obj;
          addExpression(valueNode.getValue());
          addExpression(valueNode.getFormatExpression());
        }
 else         if (obj instanceof TextTemplate.ImageNode) {
          addExpression(((TextTemplate.ImageNode)obj).getExpr());
        }
      }
    }
  }
  return exprs;
}
Program: 71017
Project: 71017
Buggy source:
protected TextTemplate parseTemplate(String text) throws BirtException {
  SoftReference templateRef=(SoftReference)templates.get(text);
  TextTemplate template=null;
  if (templateRef != null) {
    template=(TextTemplate)templateRef.get();
    if (template != null) {
      return template;
    }
  }
  try {
    template=new org.eclipse.birt.core.template.TemplateParser().parse(text);
    templateRef=new SoftReference(template);
    templates.put(text,templateRef);
  }
 catch (  Exception ex) {
    throw new EngineException(ex.getLocalizedMessage(),ex);
  }
  return template;
}

Fixed version (ground truth):
protected TextTemplate parseTemplate(String text) throws BirtException {
  SoftReference templateRef=(SoftReference)templates.get(text);
  TextTemplate template=null;
  if (templateRef != null) {
    template=(TextTemplate)templateRef.get();
    if (template != null) {
      return template;
    }
  }
  try {
    template=new org.eclipse.birt.core.template.TemplateParser().parse(text);
    templateRef=new SoftReference(template);
    templates.put(text,templateRef);
  }
 catch (  Throwable ex) {
    throw new EngineException(ex.getLocalizedMessage(),ex);
  }
  return template;
}
Program: 71018
Project: 71018
Buggy source:
/** 
 * @param dataSet
 * @param inputParamBindings
 * @param columnBindings
 * @param boundColumnName
 * @param requestInfo
 * @return
 * @throws BirtException
 */
private IColumnValueIterator getColumnValueIterator(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,String boundColumnName,IRequestInfo requestInfo) throws BirtException {
  ArrayList temp=new ArrayList();
  while (columnBindings != null && columnBindings.hasNext()) {
    temp.add(columnBindings.next());
  }
  if (referToAggregation(temp,boundColumnName))   return new ColumnValueIterator(null,null,null);
  IQueryResults queryResults=getQueryResults(dataSet,inputParamBindings,temp.iterator(),boundColumnName);
  return new ColumnValueIterator(queryResults,boundColumnName,requestInfo);
}

Fixed version (ground truth):
/** 
 * @param dataSet
 * @param inputParamBindings
 * @param columnBindings
 * @param boundColumnName
 * @param requestInfo
 * @return
 * @throws BirtException
 */
private IColumnValueIterator getColumnValueIterator(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,String boundColumnName,IRequestInfo requestInfo) throws BirtException {
  ArrayList temp=new ArrayList();
  while (columnBindings != null && columnBindings.hasNext()) {
    temp.add(columnBindings.next());
  }
  IQueryResults queryResults=getQueryResults(dataSet,inputParamBindings,temp.iterator(),boundColumnName);
  return new ColumnValueIterator(queryResults,boundColumnName,requestInfo);
}
Program: 71019
Project: 71019
Buggy source:
/** 
 * create a new context. Call close to finish using the execution context
 */
public ExecutionContext(EngineTask engineTask){
  if (engineTask != null) {
    task=engineTask;
    engine=(ReportEngine)task.getEngine();
    log=task.getLogger();
  }
 else {
    log=Logger.getLogger(ExecutionContext.class.getName());
  }
  locale=Locale.getDefault();
  timeZone=TimeZone.getDefault();
}

Fixed version (ground truth):
/** 
 * create a new context. Call close to finish using the execution context
 */
public ExecutionContext(EngineTask engineTask){
  if (engineTask != null) {
    task=engineTask;
    engine=(ReportEngine)task.getEngine();
    log=task.getLogger();
  }
 else {
    log=Logger.getLogger(ExecutionContext.class.getName());
  }
  locale=Locale.getDefault();
  timeZone=TimeZone.getDefault();
  eventHandlerManager=new EventHandlerManager();
}
Program: 71020
Project: 71020
Buggy source:
protected static Object getInstance(String className,ExecutionContext context) throws EngineException {
  if (className == null)   return null;
  Object o=null;
  Class c=null;
  try {
    ClassLoader classLoader=context.getApplicationClassLoader();
    c=classLoader.loadClass(className);
    o=c.newInstance();
  }
 catch (  ClassNotFoundException e) {
    throw new EngineException(MessageConstants.SCRIPT_CLASS_NOT_FOUND_ERROR,new Object[]{className},e);
  }
catch (  IllegalAccessException e) {
    throw new EngineException(MessageConstants.SCRIPT_CLASS_ILLEGAL_ACCESS_ERROR,new Object[]{className},e);
  }
catch (  InstantiationException e) {
    throw new EngineException(MessageConstants.SCRIPT_CLASS_INSTANTIATION_ERROR,new Object[]{className},e);
  }
  return o;
}

Fixed version (ground truth):
protected static Object getInstance(ReportItemDesign design,ExecutionContext context) throws EngineException {
  EventHandlerManager eventHandlerManager=context.getEventHandlerManager();
  return eventHandlerManager.getInstance(design,context);
}
Program: 71021
Project: 71021
Buggy source:
/** 
 * Sets the <code>'class'</code> property and stores the style to styleMap object.
 * @param styleName the style name
 */
protected void setStyleName(String styleName,IContent content){
  StringBuffer classBuffer=new StringBuffer();
  if (enableMetadata) {
    String metadataStyleClass=metadataEmitter.getMetadataStyleClass(content);
    if (null != metadataStyleClass) {
      classBuffer.append(metadataStyleClass);
    }
  }
  if (styleName != null) {
    if (outputtedStyles.contains(styleName)) {
      if (classBuffer.length() != 0) {
        classBuffer.append("String_Node_Str");
      }
      if (null != htmlIDNamespace) {
        classBuffer.append(htmlIDNamespace + styleName);
      }
 else {
        classBuffer.append(styleName);
      }
    }
  }
  if (hasCsslinks) {
    Object genBy=content.getGenerateBy();
    if (genBy instanceof StyledElementDesign) {
      DesignElementHandle handle=((StyledElementDesign)genBy).getHandle();
      if (handle != null) {
        String name=handle.getStringProperty(ReportItemHandle.STYLE_PROP);
        if (name != null) {
          if (classBuffer.length() != 0) {
            classBuffer.append("String_Node_Str" + name);
          }
 else {
            classBuffer.append(name);
          }
        }
      }
    }
  }
  if (classBuffer.length() != 0) {
    writer.attribute(HTMLTags.ATTR_CLASS,classBuffer.toString());
  }
}

Fixed version (ground truth):
/** 
 * Sets the <code>'class'</code> property and stores the style to styleMap object.
 * @param styleClass the style name
 */
protected void setStyleName(String styleClass,IContent content){
  StringBuffer classBuffer=new StringBuffer();
  if (enableMetadata) {
    String metadataStyleClass=metadataEmitter.getMetadataStyleClass(content);
    if (null != metadataStyleClass) {
      classBuffer.append(metadataStyleClass);
    }
  }
  if (styleClass != null) {
    if (classBuffer.length() != 0) {
      classBuffer.append("String_Node_Str");
    }
    if (null != htmlIDNamespace) {
      classBuffer.append(getStyleClassWithNameSpace(styleClass));
    }
 else {
      classBuffer.append(styleClass);
    }
  }
  if (hasCsslinks) {
    Object genBy=content.getGenerateBy();
    if (genBy instanceof StyledElementDesign) {
      DesignElementHandle handle=((StyledElementDesign)genBy).getHandle();
      if (handle != null) {
        String name=handle.getStringProperty(ReportItemHandle.STYLE_PROP);
        if (name != null) {
          if (classBuffer.length() != 0) {
            classBuffer.append("String_Node_Str" + name);
          }
 else {
            classBuffer.append(name);
          }
        }
      }
    }
  }
  if (classBuffer.length() != 0) {
    writer.attribute(HTMLTags.ATTR_CLASS,classBuffer.toString());
  }
}
Program: 71022
Project: 71022
Buggy source:
/** 
 * Output instance id and bookmark for a content.
 * @param content
 * @param tag
 * @param styleName
 */
private void startContent(IContent content,String tag){
  String bookmark=content.getBookmark();
  if (bookmark == null) {
    bookmark=idGenerator.generateUniqueID();
  }
  setActiveIDTypeIID(content,bookmark);
  HTMLEmitterUtil.setBookmark(writer,tag,htmlIDNamespace,bookmark);
}

Fixed version (ground truth):
/** 
 * Output instance id and bookmark for a content.
 * @param content
 * @param tag
 */
private void startContent(IContent content,String tag){
  String bookmark=content.getBookmark();
  if (bookmark == null) {
    bookmark=idGenerator.generateUniqueID();
  }
  setActiveIDTypeIID(content,bookmark);
  HTMLEmitterUtil.setBookmark(writer,tag,htmlIDNamespace,bookmark);
}
Program: 71023
Project: 71023
Buggy source:
/** 
 * Test get/setStyle methods set the style then get it to test if they work correctly
 */
public void testBaseStyle(){
  ((StyledElementDesign)element).setStyleName("String_Node_Str");
  assertEquals("String_Node_Str",((StyledElementDesign)element).getStyleName());
}

Fixed version (ground truth):
/** 
 * Test get/setStyle methods set the style then get it to test if they work correctly
 */
public void testBaseStyle(){
  ((StyledElementDesign)element).setStyleClass("String_Node_Str");
  assertEquals("String_Node_Str",((StyledElementDesign)element).getStyleClass());
}
Program: 71024
Project: 71024
Buggy source:
/** 
 * test if the shared style is same. Two element use the same shared style, so those two elements should have same style properties.
 */
public void testSharedStyle(){
  GridItemDesign grid=(GridItemDesign)report.getContent(0);
  IStyle style=report.findStyle(grid.getStyleName());
  assertEquals(style.getColor(),"String_Node_Str");
  assertEquals(style.getBorderBottomStyle(),"String_Node_Str");
  RowDesign row=grid.getRow(0);
  style=report.findStyle(row.getStyleName());
  assertEquals(style.getColor(),"String_Node_Str");
  assertEquals(style.getBorderBottomStyle(),"String_Node_Str");
  CellDesign cell=row.getCell(0);
  style=report.findStyle(cell.getStyleName());
  assertEquals(style.getColor(),"String_Node_Str");
  assertEquals(style.getFontSize(),"String_Node_Str");
  assertEquals(style.getBorderBottomStyle(),"String_Node_Str");
  LabelItemDesign label=(LabelItemDesign)cell.getContent(0);
  assertTrue(label.getStyleName() == null);
}

Fixed version (ground truth):
/** 
 * test if the shared style is same. Two element use the same shared style, so those two elements should have same style properties.
 */
public void testSharedStyle(){
  GridItemDesign grid=(GridItemDesign)report.getContent(0);
  IStyle style=grid.getStyle();
  assertEquals(style.getColor(),"String_Node_Str");
  assertEquals(style.getBorderBottomStyle(),"String_Node_Str");
  RowDesign row=grid.getRow(0);
  style=row.getStyle();
  assertEquals(style.getColor(),"String_Node_Str");
  assertEquals(style.getBorderBottomStyle(),"String_Node_Str");
  CellDesign cell=row.getCell(0);
  style=cell.getStyle();
  assertEquals(style.getColor(),"String_Node_Str");
  assertEquals(style.getFontSize(),"String_Node_Str");
  assertEquals(style.getBorderBottomStyle(),"String_Node_Str");
  LabelItemDesign label=(LabelItemDesign)cell.getContent(0);
  assertTrue(label.getStyleClass() == null);
}
Program: 71025
Project: 71025
Buggy source:
public String getStyleClass(){
  if (styleClass != null) {
    return styleClass;
  }
  if (generateBy instanceof StyledElementDesign) {
    return ((StyledElementDesign)generateBy).getStyleName();
  }
  return null;
}

Fixed version (ground truth):
public String getStyleClass(){
  if (styleClass != null) {
    return styleClass;
  }
  if (generateBy instanceof StyledElementDesign) {
    return ((StyledElementDesign)generateBy).getStyleClass();
  }
  return null;
}
Program: 71026
Project: 71026
Buggy source:
public IStyle getStyle(){
  if (style == null) {
    if (inlineStyle == null) {
      inlineStyle=report.createStyle();
    }
    String styleClass=getStyleClass();
    if (styleClass != null) {
      IStyle classStyle=report.findStyle(styleClass);
      style=new CompositeStyle(classStyle,inlineStyle);
    }
 else {
      style=inlineStyle;
    }
  }
  return new ContentStyle((AbstractStyle)style);
}

Fixed version (ground truth):
public IStyle getStyle(){
  if (style == null) {
    if (inlineStyle == null) {
      inlineStyle=report.createStyle();
    }
    IStyle classStyle=getClassStyle();
    if (classStyle != null) {
      style=new CompositeStyle(classStyle,inlineStyle);
    }
 else {
      style=inlineStyle;
    }
  }
  return new ContentStyle((AbstractStyle)style);
}
Program: 71027
Project: 71027
Buggy source:
public IStyle getStyle(){
  if (style == null) {
    if (inlineStyle == null) {
      inlineStyle=report.createStyle();
    }
    String styleClass=getStyleClass();
    IStyle classStyle=report.findStyle(styleClass);
    style=new CompositeStyle(classStyle,inlineStyle);
  }
  return style;
}

Fixed version (ground truth):
public IStyle getStyle(){
  if (style == null) {
    if (inlineStyle == null) {
      inlineStyle=report.createStyle();
    }
    IStyle classStyle=getClassStyle();
    style=new CompositeStyle(classStyle,inlineStyle);
  }
  return style;
}
Program: 71028
Project: 71028
Buggy source:
public String getStyleClass(){
  if (styleClass != null) {
    return styleClass;
  }
  if (generateBy instanceof ColumnDesign) {
    return ((ColumnDesign)generateBy).getStyleName();
  }
  return null;
}

Fixed version (ground truth):
public String getStyleClass(){
  if (styleClass != null) {
    return styleClass;
  }
  if (generateBy instanceof ColumnDesign) {
    return ((ColumnDesign)generateBy).getStyleClass();
  }
  return null;
}