nus-yam/ex-repair huggingface dataset:
Program: 70593
Project: 70593
Buggy source:
public void visitTextDataItem(TextDataHandle handle){
  DynamicTextItemDesign dynamicTextItem=new DynamicTextItemDesign();
  setupReportItem(dynamicTextItem,handle);
  String valueExpr=handle.getValueExpr();
  String contentType=handle.getContentType();
  dynamicTextItem.setContent(createExpression(validateExpression(valueExpr)));
  dynamicTextItem.setContentType(createExpression(contentType));
  setupHighlight(dynamicTextItem,valueExpr);
  setMap(dynamicTextItem,valueExpr);
  setCurrentElement(dynamicTextItem);
}

Fixed version (ground truth):
public void visitTextDataItem(TextDataHandle handle){
  DynamicTextItemDesign dynamicTextItem=new DynamicTextItemDesign();
  setupReportItem(dynamicTextItem,handle);
  String valueExpr=handle.getValueExpr();
  String contentType=handle.getContentType();
  dynamicTextItem.setContent(createExpression(validateExpression(valueExpr)));
  dynamicTextItem.setContentType(createConstant(contentType));
  setupHighlight(dynamicTextItem,valueExpr);
  setMap(dynamicTextItem,valueExpr);
  setCurrentElement(dynamicTextItem);
}
Program: 70594
Project: 70594
Buggy source:
public boolean hasExpression(){
  if (handle instanceof TextItemHandle) {
    TextItemHandle textItem=(TextItemHandle)handle;
    textItem.hasExpression();
  }
  return false;
}

Fixed version (ground truth):
public boolean hasExpression(){
  if (handle instanceof TextItemHandle) {
    TextItemHandle textItem=(TextItemHandle)handle;
    return textItem.hasExpression();
  }
  return true;
}
Program: 70595
Project: 70595
Buggy source:
public void initialize(IEmitterServices service) throws BirtException {
  emitter.initialize(service);
}

Fixed version (ground truth):
public void initialize(IEmitterServices service) throws BirtException {
  emitter.initialize(service);
  ReportDesignHandle designHandle=(ReportDesignHandle)service.getReportRunnable().getDesignHandle();
  if (designHandle != null) {
    String reportLayoutPreference=designHandle.getLayoutPreference();
    context.setFixedLayout(DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(reportLayoutPreference));
  }
}
Program: 70596
Project: 70596
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();
    }
  }
  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();
    }
  }
  if (height > parent.getSpecifiedHeight()) {
    height=parent.getSpecifiedHeight();
    setNeedClip(true);
  }
  parent.update(this);
  finished=true;
}
Program: 70597
Project: 70597
Buggy source:
/** 
 * 1) Creates row wrapper. 2) For the null cell in the row wrapper, fills the relevant position with dummy cell or empty cell. 3) Updates the height of the row and the cells in the row.
 * @param rowArea current rowArea.
 */
private void updateRow(RowArea rowArea){
  RowArea lastRow=(RowArea)rows.getCurrent();
  int height=rowArea.getSpecifiedHeight();
  for (int i=startCol; i <= endCol; i++) {
    CellArea upperCell=null;
    if (lastRow != null) {
      upperCell=lastRow.getCell(i);
    }
    if (upperCell != null && (upperCell.getRowSpan() > 1)) {
      DummyCell dummyCell=createDummyCell(upperCell);
      rowArea.setCell(dummyCell);
      int delta=dummyCell.getDelta();
      if (dummyCell.getRowSpan() == 1) {
        height=Math.max(height,dummyCell.getCell().getHeight() - delta);
      }
      i=i + upperCell.getColSpan() - 1;
    }
 else {
      CellArea cell=rowArea.getCell(i);
      if (cell != null && cell.getRowSpan() == 1) {
        height=Math.max(height,cell.getHeight());
        i=i + cell.getColSpan() - 1;
      }
    }
  }
  updateRowHeight(rowArea,height);
}

Fixed version (ground truth):
/** 
 * 1) Creates row wrapper. 2) For the null cell in the row wrapper, fills the relevant position with dummy cell or empty cell. 3) Updates the height of the row and the cells in the row.
 * @param rowArea current rowArea.
 */
private void updateRow(RowArea rowArea){
  RowArea lastRow=(RowArea)rows.getCurrent();
  int height=rowArea.getSpecifiedHeight();
  if (!rowArea.context.isFixedLayout()) {
    for (int i=startCol; i <= endCol; i++) {
      CellArea upperCell=null;
      if (lastRow != null) {
        upperCell=lastRow.getCell(i);
      }
      if (upperCell != null && (upperCell.getRowSpan() > 1)) {
        DummyCell dummyCell=createDummyCell(upperCell);
        rowArea.setCell(dummyCell);
        int delta=dummyCell.getDelta();
        if (dummyCell.getRowSpan() == 1) {
          height=Math.max(height,dummyCell.getCell().getHeight() - delta);
        }
        i=i + upperCell.getColSpan() - 1;
      }
 else {
        CellArea cell=rowArea.getCell(i);
        if (cell != null && cell.getRowSpan() == 1) {
          height=Math.max(height,cell.getHeight());
          i=i + cell.getColSpan() - 1;
        }
      }
    }
  }
  updateRowHeight(rowArea,height);
}
Program: 70598
Project: 70598
Buggy source:
public void testMultiBasic(){
  assertEquals(1,dynamicText.getX().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals(2,dynamicText.getY().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals(3,dynamicText.getWidth().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals(4,dynamicText.getHeight().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals("String_Node_Str",dynamicText.getName());
  assertEquals(Expression.newExpression("String_Node_Str"),dynamicText.getContent());
  assertEquals(Expression.newExpression("String_Node_Str"),dynamicText.getContentType());
}

Fixed version (ground truth):
public void testMultiBasic(){
  assertEquals(1,dynamicText.getX().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals(2,dynamicText.getY().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals(3,dynamicText.getWidth().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals(4,dynamicText.getHeight().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals("String_Node_Str",dynamicText.getName());
  assertEquals(Expression.newExpression("String_Node_Str"),dynamicText.getContent());
  assertEquals(Expression.newConstant("String_Node_Str"),dynamicText.getContentType());
}
Program: 70599
Project: 70599
Buggy source:
/** 
 * create the class loader used by the design. the method should be synchronized as the class loader of a document may be used by multiple tasks.
 */
protected synchronized void createDesignClassLoader(){
  if (designClassLoader != null) {
    return;
  }
  ArrayList<URL> urls=new ArrayList<URL>();
  if (runnable != null) {
    ModuleHandle module=(ModuleHandle)runnable.getDesignHandle();
    Iterator iter=module.scriptLibsIterator();
    while (iter.hasNext()) {
      ScriptLibHandle lib=(ScriptLibHandle)iter.next();
      String libPath=lib.getName();
      URL url=module.findResource(libPath,IResourceLocator.LIBRARY);
      if (url != null) {
        urls.add(url);
      }
 else {
        if (executionContext != null) {
          executionContext.addException(new EngineException(MessageConstants.JAR_NOT_FOUND_ERROR,libPath));
        }
        logger.log(Level.SEVERE,"String_Node_Str" + libPath);
      }
    }
  }
  URL[] jarUrls=(URL[])urls.toArray(new URL[]{});
  designClassLoader=new URLClassLoader(jarUrls,engine.getEngineClassLoader());
}

Fixed version (ground truth):
/** 
 * create the class loader used by the design. the method should be synchronized as the class loader of a document may be used by multiple tasks.
 */
protected synchronized void createDesignClassLoader(){
  if (designClassLoader != null) {
    return;
  }
  ArrayList<URL> urls=new ArrayList<URL>();
  if (runnable != null) {
    ModuleHandle module=(ModuleHandle)runnable.getDesignHandle();
    Iterator iter=module.scriptLibsIterator();
    while (iter.hasNext()) {
      ScriptLibHandle lib=(ScriptLibHandle)iter.next();
      String libPath=lib.getName();
      URL url=module.findResource(libPath,IResourceLocator.LIBRARY);
      if (url != null) {
        urls.add(url);
      }
 else {
        if (executionContext != null) {
          executionContext.addException(new EngineException(MessageConstants.JAR_NOT_FOUND_ERROR,libPath));
        }
        logger.log(Level.SEVERE,"String_Node_Str" + libPath);
      }
    }
  }
  URL[] jarUrls=(URL[])urls.toArray(new URL[]{});
  if (engine != null) {
    designClassLoader=new URLClassLoader(jarUrls,engine.getEngineClassLoader());
  }
 else {
    designClassLoader=new URLClassLoader(jarUrls);
  }
}
Program: 70601
Project: 70601
Buggy source:
protected ActionDesign readAction(DataInputStream in) throws IOException {
  ActionDesign action=new ActionDesign();
  int actionType=IOUtil.readInt(in);
switch (actionType) {
case ActionDesign.ACTION_BOOKMARK:
    Expression<String> bookmark=readStringExpression(in);
  action.setBookmark(bookmark);
break;
case ActionDesign.ACTION_DRILLTHROUGH:
DrillThroughActionDesign drillThrough=readDrillThrough(in);
action.setDrillThrough(drillThrough);
break;
case ActionDesign.ACTION_HYPERLINK:
Expression<String> hyperlink=readStringExpression(in);
action.setHyperlink(hyperlink);
break;
default :
throw new IOException("String_Node_Str" + actionType);
}
if (version == ENGINE_IR_VERSION_0) {
IOUtil.readBool(in);
}
Expression<String> targetWindow=readStringExpression(in);
action.setTargetWindow(targetWindow);
return action;
}

Fixed version (ground truth):
protected ActionDesign readAction(DataInputStream in) throws IOException {
  ActionDesign action=new ActionDesign();
  int actionType=IOUtil.readInt(in);
switch (actionType) {
case ActionDesign.ACTION_BOOKMARK:
    Expression<String> bookmark=readStringExpression(in);
  action.setBookmark(bookmark);
break;
case ActionDesign.ACTION_DRILLTHROUGH:
DrillThroughActionDesign drillThrough=readDrillThrough(in);
action.setDrillThrough(drillThrough);
break;
case ActionDesign.ACTION_HYPERLINK:
Expression<String> hyperlink=readStringExpression(in);
action.setHyperlink(hyperlink);
break;
default :
throw new IOException("String_Node_Str" + actionType);
}
if (version == ENGINE_IR_VERSION_0) {
IOUtil.readBool(in);
}
Expression<String> targetWindow=readStringConstant(in);
action.setTargetWindow(targetWindow);
return action;
}
Program: 70603
Project: 70603
Buggy source:
public SplitResult splitLines(int lineCount) throws BirtException {
  return SplitResult.SUCCEED_WITH_NULL;
}

Fixed version (ground truth):
public SplitResult splitLines(int lineCount) throws BirtException {
  if (isPageBreakBeforeAvoid()) {
    return SplitResult.BEFORE_AVOID_WITH_NULL;
  }
  return SplitResult.SUCCEED_WITH_NULL;
}
Program: 70604
Project: 70604
Buggy source:
/** 
 * @throws IOException
 * @throws DesignFileException
 * @throws SemanticException 
 */
public void test_regression_117978() throws IOException, DesignFileException, SemanticException {
  DesignEngine engine=new DesignEngine(new DesignConfig());
  SessionHandle session=engine.newSessionHandle(ULocale.ENGLISH);
  ReportDesignHandle designHandle=session.createDesign();
  ElementFactory factory=designHandle.getElementFactory();
  LabelHandle label=factory.newLabel("String_Node_Str");
  designHandle.getBody().add(label);
  UserPropertyDefn expr2=new UserPropertyDefn();
  expr2.setName("String_Node_Str");
  expr2.setType(new ExpressionPropertyType());
  expr2.setDefault("String_Node_Str");
  label.addUserPropertyDefn(expr2);
  label.setStringProperty("String_Node_Str","String_Node_Str");
  String TempFile=this.genOutputFile(OUTPUT);
  designHandle.saveAs(TempFile);
  designHandle=session.openDesign(TempFile);
  LabelHandle labelHandle=(LabelHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(labelHandle);
  List userProperties=labelHandle.getUserProperties();
  assertEquals(1,userProperties.size());
  UserPropertyDefn prop=(UserPropertyDefn)userProperties.get(0);
  assertEquals("String_Node_Str",prop.getName());
  assertEquals("String_Node_Str",prop.getDefault());
  assertEquals("String_Node_Str",labelHandle.getStringProperty("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * @throws IOException
 * @throws DesignFileException
 * @throws SemanticException 
 */
public void test_regression_117978() throws IOException, DesignFileException, SemanticException {
  DesignEngine engine=new DesignEngine(new DesignConfig());
  SessionHandle session=engine.newSessionHandle(ULocale.ENGLISH);
  ReportDesignHandle designHandle=session.createDesign();
  ElementFactory factory=designHandle.getElementFactory();
  LabelHandle label=factory.newLabel("String_Node_Str");
  designHandle.getBody().add(label);
  UserPropertyDefn expr2=new UserPropertyDefn();
  expr2.setName("String_Node_Str");
  expr2.setType(new ExpressionPropertyType());
  expr2.setDefault("String_Node_Str");
  label.addUserPropertyDefn(expr2);
  label.setStringProperty("String_Node_Str","String_Node_Str");
  String TempFile=this.genOutputFile(OUTPUT);
  designHandle.saveAs(TempFile);
  designHandle=session.openDesign(TempFile);
  LabelHandle labelHandle=(LabelHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(labelHandle);
  List userProperties=labelHandle.getUserProperties();
  assertEquals(1,userProperties.size());
  UserPropertyDefn prop=(UserPropertyDefn)userProperties.get(0);
  assertEquals("String_Node_Str",prop.getName());
  assertEquals("String_Node_Str",prop.getDefault().toString());
  assertEquals("String_Node_Str",labelHandle.getStringProperty("String_Node_Str"));
}
Program: 70605
Project: 70605
Buggy source:
/** 
 */
protected void setUp() throws Exception {
  super.setUp();
  removeResource();
  copyInputToFile(INPUT_FOLDER + "String_Node_Str" + filename);
}

Fixed version (ground truth):
/** 
 */
protected void setUp() throws Exception {
  super.setUp();
  removeResource();
  copyInputToFile(INPUT_FOLDER + "String_Node_Str" + filename);
  copyInputToFile(INPUT_FOLDER + "String_Node_Str" + filename_lib);
}
Program: 70606
Project: 70606
Buggy source:
public void visitList(ListHandle handle){
  ListItemDesign listItem=new ListItemDesign();
  setupListingItem(listItem,handle);
  SlotHandle headerSlot=handle.getHeader();
  if (headerSlot.getCount() > 0) {
    ListBandDesign header=createListBand(headerSlot);
    header.setBandType(ListBandDesign.BAND_HEADER);
    listItem.setHeader(header);
    Expression<Boolean> headerValue=createConstant(handle.repeatHeader());
    listItem.setRepeatHeader(headerValue);
  }
  SlotHandle groupsSlot=handle.getGroups();
  for (int i=0; i < groupsSlot.getCount(); i++) {
    apply(groupsSlot.get(i));
    if (currentElement != null) {
      GroupDesign group=(GroupDesign)currentElement;
      group.setGroupLevel(i);
      listItem.addGroup(group);
    }
  }
  SlotHandle detailSlot=handle.getDetail();
  if (detailSlot.getCount() > 0) {
    ListBandDesign detail=createListBand(detailSlot);
    detail.setBandType(ListBandDesign.BAND_DETAIL);
    listItem.setDetail(detail);
  }
  SlotHandle footerSlot=handle.getFooter();
  if (footerSlot.getCount() > 0) {
    ListBandDesign footer=createListBand(footerSlot);
    footer.setBandType(ListBandDesign.BAND_FOOTER);
    listItem.setFooter(footer);
  }
  setCurrentElement(listItem);
}

Fixed version (ground truth):
public void visitList(ListHandle handle){
  ListItemDesign listItem=new ListItemDesign();
  setupListingItem(listItem,handle);
  SlotHandle headerSlot=handle.getHeader();
  if (headerSlot.getCount() > 0) {
    ListBandDesign header=createListBand(headerSlot);
    header.setBandType(ListBandDesign.BAND_HEADER);
    listItem.setHeader(header);
  }
  Expression<Boolean> headerValue=createConstant(handle.repeatHeader());
  listItem.setRepeatHeader(headerValue);
  SlotHandle groupsSlot=handle.getGroups();
  for (int i=0; i < groupsSlot.getCount(); i++) {
    apply(groupsSlot.get(i));
    if (currentElement != null) {
      GroupDesign group=(GroupDesign)currentElement;
      group.setGroupLevel(i);
      listItem.addGroup(group);
    }
  }
  SlotHandle detailSlot=handle.getDetail();
  if (detailSlot.getCount() > 0) {
    ListBandDesign detail=createListBand(detailSlot);
    detail.setBandType(ListBandDesign.BAND_DETAIL);
    listItem.setDetail(detail);
  }
  SlotHandle footerSlot=handle.getFooter();
  if (footerSlot.getCount() > 0) {
    ListBandDesign footer=createListBand(footerSlot);
    footer.setBandType(ListBandDesign.BAND_FOOTER);
    listItem.setFooter(footer);
  }
  setCurrentElement(listItem);
}
Program: 70607
Project: 70607
Buggy source:
public void startCell(ICellContent cell){
  rowFilledFlag=true;
  context.startCell();
  int columnId=cell.getColumn();
  List<SpanInfo> spans=context.getSpans(columnId);
  if (spans != null) {
    for (int i=0; i < spans.size(); i++) {
      wordWriter.writeSpanCell(spans.get(i));
    }
  }
  int columnSpan=cell.getColSpan();
  int rowSpan=cell.getRowSpan();
  int cellWidth=context.getCellWidth(columnId,columnSpan);
  IStyle style=computeStyle(cell.getComputedStyle());
  if (rowSpan > 1) {
    context.addSpan(columnId,columnSpan,cellWidth,rowSpan,style);
  }
  SpanInfo info=null;
  if (columnSpan > 1 || rowSpan > 1) {
    info=new SpanInfo(columnId,columnSpan,cellWidth,true,style);
  }
  wordWriter.startTableCell(cellWidth,style,info);
  context.addWidth(getCellWidth(cellWidth,style));
  writeTableToc();
}

Fixed version (ground truth):
public void startCell(ICellContent cell){
  rowFilledFlag=true;
  context.startCell();
  int columnId=cell.getColumn();
  List<SpanInfo> spans=context.getSpans(columnId);
  if (spans != null) {
    for (int i=0; i < spans.size(); i++) {
      wordWriter.writeSpanCell(spans.get(i));
    }
  }
  int columnSpan=cell.getColSpan();
  int rowSpan=cell.getRowSpan();
  int cellWidth=context.getCellWidth(columnId,columnSpan);
  IStyle style=computeStyle(cell.getComputedStyle());
  if (rowSpan > 1) {
    context.addSpan(columnId,columnSpan,cellWidth,rowSpan,style);
  }
  SpanInfo info=null;
  if (columnSpan > 1 || rowSpan > 1) {
    info=new SpanInfo(columnId,columnSpan,cellWidth,true,style);
  }
  wordWriter.startTableCell(cellWidth,style,info);
  context.addWidth(getCellWidth(cellWidth,style));
  writeTableToc();
  if (cell.getDiagonalNumber() != 0 || cell.getAntidiagonalNumber() != 0) {
    drawDiagonalLine(cell,WordUtil.twipToPt(cellWidth));
  }
}
Program: 70608
Project: 70608
Buggy source:
public static String parseImageBorderStyle(String style){
  if (CSSConstants.CSS_DOTTED_VALUE.equalsIgnoreCase(style)) {
    return "String_Node_Str";
  }
  if (CSSConstants.CSS_DASHED_VALUE.equalsIgnoreCase(style)) {
    return "String_Node_Str";
  }
  if (CSSConstants.CSS_SOLID_VALUE.equalsIgnoreCase(style)) {
    return "String_Node_Str";
  }
  return style;
}

Fixed version (ground truth):
public static String parseImageBorderStyle(String style){
  if (CSSConstants.CSS_DOTTED_VALUE.equalsIgnoreCase(style)) {
    return LINESTYLE_DOT;
  }
  if (CSSConstants.CSS_DASHED_VALUE.equalsIgnoreCase(style)) {
    return LINESTYLE_DASH;
  }
  if (CSSConstants.CSS_SOLID_VALUE.equalsIgnoreCase(style)) {
    return LINESTYLE_SINGLE;
  }
  return style;
}
Program: 70609
Project: 70609
Buggy source:
public static String parseBorderStyle(String style){
  if (CSSConstants.CSS_SOLID_VALUE.equalsIgnoreCase(style)) {
    return "String_Node_Str";
  }
  return style;
}

Fixed version (ground truth):
public static String parseBorderStyle(String style){
  if (CSSConstants.CSS_SOLID_VALUE.equalsIgnoreCase(style)) {
    return LINESTYLE_SINGLE;
  }
  return style;
}
Program: 70610
Project: 70610
Buggy source:
public void update(AbstractArea area) throws BirtException {
  int aHeight=area.getAllocatedHeight();
  currentBP+=aHeight;
  height+=aHeight;
}

Fixed version (ground truth):
protected void update() throws BirtException {
  if (parent != null) {
    if (!isInInlineStacking && context.isAutoPageBreak()) {
      int aHeight=getAllocatedHeight();
      while (aHeight + parent.getAbsoluteBP() >= context.getMaxBP()) {
        parent.autoPageBreak();
        aHeight=getAllocatedHeight();
      }
    }
    parent.update(this);
  }
}
Program: 70611
Project: 70611
Buggy source:
public void close() throws BirtException {
  if (hasStyle) {
    int height=currentBP + localProperties.getPaddingTop() + boxStyle.getTopBorderWidth()+ localProperties.getPaddingBottom()+ boxStyle.getBottomBorderWidth();
    if (specifiedHeight > height) {
      if (IStyle.BOTTOM_VALUE.equals(vAlign)) {
        int offset=specifiedHeight - height;
        Iterator<IArea> iter=getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setY(offset + child.getY());
        }
      }
 else       if (IStyle.MIDDLE_VALUE.equals(vAlign)) {
        int offset=(specifiedHeight - height) / 2;
        Iterator iter=getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setY(child.getY() + offset);
        }
      }
      height=specifiedHeight;
    }
    this.height=height;
  }
 else {
    if (specifiedHeight > currentBP) {
      height=specifiedHeight;
    }
 else {
      height=currentBP;
    }
  }
  if (parent != null) {
    if (!isInInlineStacking && context.isAutoPageBreak()) {
      int aHeight=getAllocatedHeight();
      while (aHeight + parent.getAbsoluteBP() >= context.getMaxBP()) {
        parent.autoPageBreak();
        aHeight=getAllocatedHeight();
      }
    }
    parent.update(this);
  }
  finished=true;
}

Fixed version (ground truth):
public void close() throws BirtException {
  if (hasStyle) {
    int height=currentBP + localProperties.getPaddingTop() + boxStyle.getTopBorderWidth()+ localProperties.getPaddingBottom()+ boxStyle.getBottomBorderWidth();
    if (specifiedHeight > height) {
      if (IStyle.BOTTOM_VALUE.equals(vAlign)) {
        int offset=specifiedHeight - height;
        Iterator<IArea> iter=getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setY(offset + child.getY());
        }
      }
 else       if (IStyle.MIDDLE_VALUE.equals(vAlign)) {
        int offset=(specifiedHeight - height) / 2;
        Iterator iter=getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setY(child.getY() + offset);
        }
      }
      height=specifiedHeight;
    }
    this.height=height;
  }
 else {
    if (specifiedHeight > currentBP) {
      height=specifiedHeight;
    }
 else {
      height=currentBP;
    }
  }
  update();
  finished=true;
}
Program: 70613
Project: 70613
Buggy source:
public SplitResult split(int height,boolean force) throws BirtException {
  if (force) {
    TextLineArea newArea=cloneArea();
    newArea.children.addAll(children);
    children.clear();
    this.height=0;
    return new SplitResult(newArea,SplitResult.SPLIT_SUCCEED_WITH_PART);
  }
  return SplitResult.SUCCEED_WITH_NULL;
}

Fixed version (ground truth):
public SplitResult split(int height,boolean force) throws BirtException {
  if (force) {
    TextLineArea newArea=cloneArea();
    newArea.children.addAll(children);
    children.clear();
    this.height=0;
    return new SplitResult(newArea,SplitResult.SPLIT_SUCCEED_WITH_PART);
  }
  if (pageBreakBefore == IStyle.AVOID_VALUE) {
    return SplitResult.BEFORE_AVOID_WITH_NULL;
  }
  return SplitResult.SUCCEED_WITH_NULL;
}
Program: 70614
Project: 70614
Buggy source:
/** 
 * execute the html text.
 * @param design
 * @param emitter
 */
protected IContent executeHtmlText(){
  TextItemDesign textDesign=(TextItemDesign)getDesign();
  IForeignContent textContent=report.createForeignContent();
  setContent(textContent);
  executeQuery();
  initializeContent(textDesign,textContent);
  processAction(textDesign,textContent);
  processBookmark(textDesign,textContent);
  processStyle(textDesign,textContent);
  processVisibility(textDesign,textContent);
  String text=evaluate(textDesign.getText());
  String textType=evaluate(textDesign.getTextType());
  HashMap exprs=TextItemDesign.extractExpression(text,textType);
  if (exprs != null && !exprs.isEmpty()) {
    HashMap results=new HashMap();
    Iterator iter=exprs.entrySet().iterator();
    while (iter.hasNext()) {
      Map.Entry entry=(Map.Entry)iter.next();
      String expr=(String)entry.getValue();
      try {
        Object value=evaluate(expr);
        results.put(entry.getKey(),value);
      }
 catch (      BirtException ex) {
        context.addException(ex);
      }
    }
    Object[] value=new Object[2];
    value[0]=null;
    value[1]=results;
    textContent.setRawValue(value);
  }
 else {
    textContent.setRawValue(new Object[]{null,null});
  }
  textContent.setRawType(IForeignContent.TEMPLATE_TYPE);
  if (context.isInFactory()) {
    handleOnCreate(textContent);
  }
  startTOCEntry(content);
  return textContent;
}

Fixed version (ground truth):
/** 
 * execute the html text.
 * @param design
 * @param emitter
 */
protected IContent executeHtmlText(){
  TextItemDesign textDesign=(TextItemDesign)getDesign();
  IForeignContent textContent=report.createForeignContent();
  setContent(textContent);
  executeQuery();
  initializeContent(textDesign,textContent);
  processAction(textDesign,textContent);
  processBookmark(textDesign,textContent);
  processStyle(textDesign,textContent);
  processVisibility(textDesign,textContent);
  String text=evaluate(textDesign.getText());
  String textType=evaluate(textDesign.getTextType());
  HashMap<String,String> exprs=null;
  if (textDesign.hasExpression()) {
    exprs=TextItemDesign.extractExpression(text,textType);
  }
  if (exprs != null && !exprs.isEmpty()) {
    HashMap<String,Object> results=new HashMap<String,Object>();
    Iterator<Entry<String,String>> iter=exprs.entrySet().iterator();
    while (iter.hasNext()) {
      Entry<String,String> entry=(Entry<String,String>)iter.next();
      String expr=(String)entry.getValue();
      try {
        Object value=evaluate(expr);
        results.put(entry.getKey(),value);
      }
 catch (      BirtException ex) {
        context.addException(ex);
      }
    }
    Object[] value=new Object[2];
    value[0]=null;
    value[1]=results;
    textContent.setRawValue(value);
  }
 else {
    textContent.setRawValue(new Object[]{null,null});
  }
  textContent.setRawType(IForeignContent.TEMPLATE_TYPE);
  if (context.isInFactory()) {
    handleOnCreate(textContent);
  }
  startTOCEntry(content);
  return textContent;
}
Program: 70615
Project: 70615
Buggy source:
public HashMap<String,String> getExpressions(){
  if (text == null) {
    return null;
  }
  if (exprs != null) {
    return exprs;
  }
  if (text.isExpression() || textType.isExpression()) {
    return null;
  }
  exprs=extractExpression(text.getValue(),textType.getValue());
  return exprs;
}

Fixed version (ground truth):
public HashMap<String,String> getExpressions(){
  if (text == null) {
    return null;
  }
  if (exprs != null) {
    return exprs;
  }
  if (text.isExpression() || textType.isExpression()) {
    return null;
  }
  if (!hasExpression()) {
    return null;
  }
  exprs=extractExpression(text.getValue(),textType.getValue());
  return exprs;
}
Program: 70620
Project: 70620
Buggy source:
public boolean isHeaderRepeat(){
  if (headerRepeat != null) {
    return headerRepeat.booleanValue();
  }
  if (generateBy instanceof TableItemDesign) {
    return getConstantValue(((TableItemDesign)generateBy).isRepeatHeader());
  }
  return false;
}

Fixed version (ground truth):
public boolean isHeaderRepeat(){
  if (headerRepeat != null) {
    return headerRepeat.booleanValue();
  }
  if (generateBy instanceof TableItemDesign) {
    Boolean constantValue=getConstantValue(((TableItemDesign)generateBy).isRepeatHeader());
    return constantValue == null ? false : constantValue;
  }
  return false;
}
Program: 70621
Project: 70621
Buggy source:
/** 
 * Gets the style from the original design object, calculates the highlight style, merges the teo styles and then sets them on the corresponding content object.
 * @param content the target content object.
 * @param design the original design object.
 */
protected void processStyle(ReportItemDesign design,IContent content){
  HighlightDesign highlight=design.getHighlight();
  if (highlight != null) {
    StyleDeclaration inlineStyle=createHighlightStyle(design.getHighlight());
    if (inlineStyle != null) {
      content.setInlineStyle(inlineStyle);
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets the style from the original design object, calculates the highlight style, merges the teo styles and then sets them on the corresponding content object.
 * @param content the target content object.
 * @param design the original design object.
 */
protected void processStyle(ReportItemDesign design,IContent content){
  HighlightDesign highlight=design.getHighlight();
  StyleDeclaration inlineStyle=null;
  if (highlight != null) {
    inlineStyle=createHighlightStyle(design.getHighlight());
  }
  Map<Integer,Expression<String>> expressionStyles=design.getExpressionStyles();
  if (expressionStyles != null) {
    if (inlineStyle == null) {
      inlineStyle=(StyleDeclaration)report.createStyle();
    }
    populateExpressionStyles(inlineStyle,expressionStyles);
  }
  if (inlineStyle != null) {
    content.setInlineStyle(inlineStyle);
  }
}
Program: 70622
Project: 70622
Buggy source:
public void update(AbstractArea area) throws BirtException {
  super.update(area);
  if (currentIP + area.getAllocatedWidth() > getContentWidth()) {
    setNeedClip(true);
  }
 else   if (currentBP > maxAvaHeight) {
    setNeedClip(true);
  }
}

Fixed version (ground truth):
public void update(AbstractArea area) throws BirtException {
  super.update(area);
  if (currentIP + area.getAllocatedWidth() > getContentWidth()) {
    setNeedClip(true);
  }
}
Program: 70623
Project: 70623
Buggy source:
public int getMaxAvaHeight(){
  return maxAvaHeight;
}

Fixed version (ground truth):
public int getMaxAvaHeight(){
  if (parent != null) {
    return getContentHeight(parent.getMaxAvaHeight());
  }
 else {
    return context.getMaxBP();
  }
}
Program: 70624
Project: 70624
Buggy source:
protected void init() throws BirtException {
  if (PropertyUtil.isInlineElement(image)) {
    root=new ImageInlineContainer(parent,context,image);
  }
 else {
    root=new ImageBlockContainer(parent,context,image);
  }
  root.initialize();
  root.setAllocatedWidth(parent.getCurrentMaxContentWidth());
  Dimension contentDimension=getSpecifiedDimension(image,root.getContentWidth(),true);
  ImageArea imageArea=createImageArea(image);
  imageArea.setWidth(contentDimension.getWidth());
  imageArea.setHeight(contentDimension.getHeight());
  root.addChild(imageArea);
  imageArea.setPosition(root.getContentX(),root.getContentY());
  root.setContentWidth(imageArea.getWidth());
  root.setContentHeight(imageArea.getHeight());
  processChartLegend(image,imageArea);
}

Fixed version (ground truth):
protected void init() throws BirtException {
  if (PropertyUtil.isInlineElement(image)) {
    root=new ImageInlineContainer(parent,context,image);
  }
 else {
    root=new ImageBlockContainer(parent,context,image);
  }
  root.initialize();
  root.setAllocatedWidth(parent.getCurrentMaxContentWidth());
  root.setMaxAvaWidth(root.getContentWidth());
  Dimension contentDimension=getSpecifiedDimension(image,root.getContentWidth(),true);
  ImageArea imageArea=createImageArea(image);
  int actualHeight=contentDimension.getHeight();
  int actualWidth=contentDimension.getWidth();
  if (fitToContainer) {
    int maxHeight=root.getMaxAvaHeight();
    int maxWidth=root.getMaxAvaWidth();
    int cHeight=contentDimension.getHeight();
    int cWidth=contentDimension.getWidth();
    if (cHeight > maxHeight || cWidth > maxWidth) {
      float rh=((float)maxHeight) / cHeight;
      float rw=((float)maxWidth) / cWidth;
      if (rh > rw) {
        actualHeight=(int)(rw * maxHeight);
        actualWidth=maxWidth;
      }
 else {
        actualHeight=maxHeight;
        actualWidth=(int)(rh * maxWidth);
      }
    }
  }
  imageArea.setWidth(actualWidth);
  imageArea.setHeight(actualHeight);
  root.addChild(imageArea);
  imageArea.setPosition(root.getContentX(),root.getContentY());
  root.setContentWidth(imageArea.getWidth());
  root.setContentHeight(imageArea.getHeight());
  processChartLegend(image,imageArea);
  root.finished=true;
}
Program: 70625
Project: 70625
Buggy source:
protected void updateChildrenPosition() throws BirtException {
  if (repeatList != null && repeatList.size() > 0) {
    if (!isInHeaderBand()) {
      for (int i=0; i < repeatList.size(); i++) {
        ContainerArea row=(ContainerArea)repeatList.get(i);
        ContainerArea cloneRow=row.deepClone();
        children.add(i,cloneRow);
        update(cloneRow);
      }
    }
  }
  super.updateChildrenPosition();
}

Fixed version (ground truth):
protected void updateChildrenPosition() throws BirtException {
  if (repeatList != null && repeatList.size() > 0) {
    if (!isInHeaderBand()) {
      if (getRepeatedHeight() < getMaxAvaHeight()) {
        for (int i=0; i < repeatList.size(); i++) {
          ContainerArea row=(ContainerArea)repeatList.get(i);
          ContainerArea cloneRow=row.deepClone();
          children.add(i,cloneRow);
          cloneRow.setParent(this);
          update(cloneRow);
        }
      }
    }
  }
  super.updateChildrenPosition();
}
Program: 70626
Project: 70626
Buggy source:
public void add(AbstractArea area){
  addChild(area);
  CellArea cArea=(CellArea)area;
  int columnID=cArea.getColumnID();
  int colSpan=cArea.getColSpan();
  if (colSpan > 1 && content.isRTL()) {
    columnID+=colSpan - 1;
  }
  cArea.setPosition(table.getXPos(columnID),0);
}

Fixed version (ground truth):
public void add(AbstractArea area){
  addChild(area);
  CellArea cArea=(CellArea)area;
  int columnID=cArea.getColumnID();
  int colSpan=cArea.getColSpan();
  if (colSpan > 1 && content.isRTL()) {
    columnID+=colSpan - 1;
  }
  cArea.setPosition(getTableArea().getXPos(columnID),0);
}
Program: 70627
Project: 70627
Buggy source:
public boolean isPageBreakInsideAvoid(){
  if (table.isGridDesign()) {
    return super.isPageBreakInsideAvoid();
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
public boolean isPageBreakInsideAvoid(){
  if (getTableArea().isGridDesign()) {
    return super.isPageBreakInsideAvoid();
  }
 else {
    return true;
  }
}
Program: 70628
Project: 70628
Buggy source:
public void update(AbstractArea area) throws BirtException {
  CellArea cArea=(CellArea)area;
  int columnID=cArea.getColumnID();
  int colSpan=cArea.getColSpan();
  if (colSpan > 1 && content.isRTL()) {
    columnID+=colSpan - 1;
  }
  cArea.setPosition(table.getXPos(columnID),0);
}

Fixed version (ground truth):
public void update(AbstractArea area) throws BirtException {
  CellArea cArea=(CellArea)area;
  int columnID=cArea.getColumnID();
  int colSpan=cArea.getColSpan();
  if (colSpan > 1 && content.isRTL()) {
    columnID+=colSpan - 1;
  }
  cArea.setPosition(getTableArea().getXPos(columnID),0);
}
Program: 70629
Project: 70629
Buggy source:
public int getColumnCount(){
  if (table != null) {
    return table.getColumnCount();
  }
  if (cells != null) {
    return cells.length;
  }
  return 0;
}

Fixed version (ground truth):
public int getColumnCount(){
  TableArea table=getTableArea();
  if (table != null) {
    return table.getColumnCount();
  }
  if (cells != null) {
    return cells.length;
  }
  return 0;
}
Program: 70630
Project: 70630
Buggy source:
public void close() throws BirtException {
  table.addRow(this);
  if (!isInInlineStacking && context.isAutoPageBreak()) {
    int aHeight=getAllocatedHeight();
    while (aHeight + parent.getAbsoluteBP() >= context.getMaxBP()) {
      parent.autoPageBreak();
      aHeight=getAllocatedHeight();
    }
  }
  parent.update(this);
  finished=true;
}

Fixed version (ground truth):
public void close() throws BirtException {
  getTableArea().addRow(this);
  if (!isInInlineStacking && context.isAutoPageBreak()) {
    int aHeight=getAllocatedHeight();
    while (aHeight + parent.getAbsoluteBP() >= context.getMaxBP()) {
      parent.autoPageBreak();
      aHeight=getAllocatedHeight();
    }
  }
  parent.update(this);
  finished=true;
}
Program: 70631
Project: 70631
Buggy source:
/** 
 * Tests the local style property values.
 */
public void testStyleLocalPropertyValues() throws Exception {
  openDesign("String_Node_Str");
  DesignElementHandle label1=designHandle.findElement("String_Node_Str");
  assertTrue(label1.hasLocalProperties());
  DesignElementHandle label2=designHandle.findElement("String_Node_Str");
  assertFalse(label2.hasLocalProperties());
}

Fixed version (ground truth):
/** 
 * Tests the local style property values.
 */
public void testStyleLocalPropertyValues() throws Exception {
  openDesign("String_Node_Str");
  DesignElementHandle label1=designHandle.findElement("String_Node_Str");
  assertTrue(label1.hasLocalProperties());
  DesignElementHandle label2=designHandle.findElement("String_Node_Str");
  assertFalse(label2.hasLocalProperties());
  DesignElementHandle extendedItem=designHandle.findElement("String_Node_Str");
  assertTrue(extendedItem.hasLocalProperties());
  extendedItem=designHandle.findElement("String_Node_Str");
  assertFalse(extendedItem.hasLocalProperties());
}
Program: 70632
Project: 70632
Buggy source:
protected boolean isValidResult(List result){
  if (repeatList != null) {
    return result.size() > repeatList.size();
  }
  return super.isValidResult(result);
}

Fixed version (ground truth):
protected boolean isValidResult(List result){
  if (repeatList != null && !isFirst) {
    return result.size() > repeatList.size();
  }
  return super.isValidResult(result);
}
Program: 70633
Project: 70633
Buggy source:
protected void updateChildrenPosition() throws BirtException {
  if (repeatList != null && repeatList.size() > 0) {
    if (!isInHeaderBand()) {
      if (getRepeatedHeight() < getMaxAvaHeight()) {
        for (int i=0; i < repeatList.size(); i++) {
          ContainerArea row=(ContainerArea)repeatList.get(i);
          ContainerArea cloneRow=row.deepClone();
          children.add(i,cloneRow);
          cloneRow.setParent(this);
          update(cloneRow);
        }
      }
    }
  }
  super.updateChildrenPosition();
}

Fixed version (ground truth):
protected void updateChildrenPosition() throws BirtException {
  if (repeatList != null && repeatList.size() > 0) {
    if (!isInHeaderBand()) {
      if (getRepeatedHeight() < getMaxAvaHeight()) {
        for (int i=0; i < repeatList.size(); i++) {
          ContainerArea row=(ContainerArea)repeatList.get(i);
          ContainerArea cloneRow=row.deepClone();
          children.add(i,cloneRow);
          cloneRow.setParent(this);
          update(cloneRow);
          cloneRow.setAllocatedY(currentBP);
        }
      }
 else {
        repeatList=null;
      }
    }
    isFirst=false;
  }
  super.updateChildrenPosition();
}
Program: 70634
Project: 70634
Buggy source:
protected int getRepeatedHeight(){
  if (repeatList != null) {
    AbstractArea area=(AbstractArea)repeatList.get(repeatList.size() - 1);
    return area.getY() + area.getAllocatedHeight();
  }
  return 0;
}

Fixed version (ground truth):
protected int getRepeatedHeight(){
  if (repeatList != null && repeatHeight == 0) {
    for (int i=0; i < repeatList.size(); i++) {
      AbstractArea area=(AbstractArea)repeatList.get(i);
      repeatHeight+=area.getAllocatedHeight();
    }
  }
  return repeatHeight;
}
Program: 70635
Project: 70635
Buggy source:
protected Object getValue(Object[] args) throws BirtException {
  Duration duration1, duration2;
  try {
    duration1=DatatypeFactory.newInstance().newDuration(args[0].toString());
    duration2=DatatypeFactory.newInstance().newDuration(args[1].toString());
  }
 catch (  DatatypeConfigurationException e) {
    throw new IllegalArgumentException(Messages.getFormattedString("String_Node_Str",new Object[]{args[0].toString()}));
  }
  return Boolean.valueOf(duration1.isShorterThan(duration2));
}

Fixed version (ground truth):
protected Object getValue(Object[] args) throws BirtException {
  Duration duration1, duration2;
  try {
    duration1=DatatypeFactory.newInstance().newDuration(args[0].toString());
    duration2=DatatypeFactory.newInstance().newDuration(args[1].toString());
  }
 catch (  DatatypeConfigurationException e) {
    throw new IllegalArgumentException(Messages.getFormattedString("String_Node_Str",args));
  }
  return Boolean.valueOf(duration1.isShorterThan(duration2));
}
Program: 70636
Project: 70636
Buggy source:
public static boolean isHeritable(int id){
  for (int i=0; i < UNHERITABLE.length; i++) {
    if (id == UNHERITABLE[i]) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
public static boolean isHeritable(int id){
  if (id >= StyleConstant.BORDER_BOTTOM_COLOR_PROP && id <= StyleConstant.BORDER_RIGHT_WIDTH_PROP)   return false;
  return true;
}
Program: 70637
Project: 70637
Buggy source:
private void declareStyles(Map<StyleEntry,Integer> style2id){
  writer.openTag("String_Node_Str");
  Set<Entry<StyleEntry,Integer>> entrySet=style2id.entrySet();
  for (  Map.Entry<StyleEntry,Integer> entry : entrySet) {
    declareStyle(entry.getKey(),entry.getValue());
  }
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void declareStyles(Map<StyleEntry,Integer> style2id){
  writer.openTag("String_Node_Str");
  declareHyperlinkStyle();
  Set<Entry<StyleEntry,Integer>> entrySet=style2id.entrySet();
  for (  Map.Entry<StyleEntry,Integer> entry : entrySet) {
    declareStyle(entry.getKey(),entry.getValue());
  }
  writer.closeTag("String_Node_Str");
}
Program: 70640
Project: 70640
Buggy source:
protected void writeObject(Object object) throws IOException {
}

Fixed version (ground truth):
protected void writeObject(Object object) throws IOException {
  if (object == null) {
    randomAccessFile.writeShort(NULL_VALUE);
    return;
  }
  IStructure cachedObject=(IStructure)object;
  Object[] objects=cachedObject.getFieldValues();
  randomAccessFile.writeShort((short)objects.length);
  if (fieldWriters == null) {
    createReadersAndWriters(objects.length);
  }
  for (int i=0; i < objects.length; i++) {
    fieldWriters[i].write(randomAccessFile,objects[i]);
  }
}
Program: 70641
Project: 70641
Buggy source:
public void startContent(IContent content) throws BirtException {
  boolean isInline=PropertyUtil.isInlineElement(content);
  if (isInline) {
    if (current.isInlineStacking()) {
    }
 else {
      setContainer(af.createLineArea(current,context));
    }
  }
 else {
    if (current.isInlineStacking()) {
      while (current.isInlineStacking()) {
        closeContainer();
      }
    }
  }
  ILayout layout=af.createLayout(current,context,content);
  layout.layout();
}

Fixed version (ground truth):
public void startContent(IContent content) throws BirtException {
  boolean isInline=PropertyUtil.isInlineElement(content);
  if (isInline) {
    if (current.isInlineStacking()) {
    }
 else {
      setContainer(af.createLineArea(current,context));
    }
  }
 else {
    if (current.isInlineStacking()) {
      while (current.isInlineStacking()) {
        closeContainer();
      }
    }
  }
  ILayout layout=af.createLayout(current,context,content);
  if (layout != null) {
    layout.layout();
  }
}
Program: 70642
Project: 70642
Buggy source:
public void endCell(ICellContent cell) throws BirtException {
  endContainer(cell);
}

Fixed version (ground truth):
public void endCell(ICellContent cell) throws BirtException {
  _endCell(cell);
}
Program: 70643
Project: 70643
Buggy source:
protected AbstractArea createNewArea(ContainerArea parent,LayoutContext context,IContent content){
switch (content.getContentType()) {
case IContent.CELL_CONTENT:
    return new CellArea(parent,context,content);
case IContent.CONTAINER_CONTENT:
case IContent.LIST_CONTENT:
  if (PropertyUtil.isInlineElement(content)) {
    return new InlineContainerArea(parent,context,content);
  }
 else {
    return new BlockContainerArea(parent,context,content);
  }
case IContent.DATA_CONTENT:
case IContent.LABEL_CONTENT:
case IContent.TEXT_CONTENT:
break;
case IContent.FOREIGN_CONTENT:
if (PropertyUtil.isInlineElement(content)) {
return new BlockContainerArea(parent,context,content);
}
 else {
return new BlockContainerArea(parent,context,content);
}
case IContent.IMAGE_CONTENT:
break;
case IContent.PAGE_CONTENT:
return new RootArea(context,content,emitter);
case IContent.ROW_CONTENT:
return new RowArea(parent,context,content);
case IContent.TABLE_BAND_CONTENT:
break;
case IContent.TABLE_CONTENT:
return new TableArea(parent,context,content);
case IContent.AUTOTEXT_CONTENT:
break;
case IContent.LIST_BAND_CONTENT:
break;
case IContent.LIST_GROUP_CONTENT:
return new ListGroupArea(parent,context,content);
case IContent.TABLE_GROUP_CONTENT:
return new TableGroupArea(parent,context,content);
default :
break;
}
return null;
}

Fixed version (ground truth):
protected AbstractArea createNewArea(ContainerArea parent,LayoutContext context,IContent content){
switch (content.getContentType()) {
case IContent.CELL_CONTENT:
    return new CellArea(parent,context,content);
case IContent.CONTAINER_CONTENT:
  if (PropertyUtil.isInlineElement(content)) {
    return new InlineContainerArea(parent,context,content);
  }
 else {
    return new BlockContainerArea(parent,context,content);
  }
case IContent.LIST_CONTENT:
if (PropertyUtil.isInlineElement(content)) {
  return new ListArea(parent,context,content);
}
 else {
  return new ListArea(parent,context,content);
}
case IContent.DATA_CONTENT:
case IContent.LABEL_CONTENT:
case IContent.TEXT_CONTENT:
break;
case IContent.FOREIGN_CONTENT:
if (PropertyUtil.isInlineElement(content)) {
return new InlineContainerArea(parent,context,content);
}
 else {
return new BlockContainerArea(parent,context,content);
}
case IContent.IMAGE_CONTENT:
break;
case IContent.PAGE_CONTENT:
return new RootArea(context,content,emitter);
case IContent.ROW_CONTENT:
return new RowArea(parent,context,content);
case IContent.TABLE_BAND_CONTENT:
break;
case IContent.TABLE_CONTENT:
return new TableArea(parent,context,content);
case IContent.AUTOTEXT_CONTENT:
break;
case IContent.LIST_BAND_CONTENT:
break;
case IContent.LIST_GROUP_CONTENT:
return new ListGroupArea(parent,context,content);
case IContent.TABLE_GROUP_CONTENT:
return new TableGroupArea(parent,context,content);
default :
break;
}
return null;
}
Program: 70646
Project: 70646
Buggy source:
public void initialize() throws BirtException {
  IPageContent pageContent=(IPageContent)content;
  if (context.isAutoPageBreak()) {
    pageContent=createPageContent(pageContent);
    context.setPageNumber(context.getPageNumber() + 1);
  }
  createNewPage(pageContent);
  maxAvaWidth=page.getBody().getWidth();
  width=maxAvaWidth;
}

Fixed version (ground truth):
public void initialize() throws BirtException {
  IPageContent pageContent=(IPageContent)content;
  if (context.isAutoPageBreak()) {
    context.setPageNumber(context.getPageNumber() + 1);
    pageContent=createPageContent(pageContent);
  }
  createNewPage(pageContent);
  maxAvaWidth=page.getBody().getWidth();
  width=maxAvaWidth;
}
Program: 70647
Project: 70647
Buggy source:
public Control createDialogArea(Composite parent){
  setParentShell(parent.getShell());
  Control dialogArea=super.createDialogArea(parent);
  getSQLBuilder().addContentChangeListener(this);
  SQLQueryUtility.setSystemHelp(dialogArea,IHelpConstants.CONEXT_ID_DATASET_DIALOG_SQLBUILDER);
  return dialogArea;
}

Fixed version (ground truth):
public Control createDialogArea(Composite parent){
  setParentShell(parent.getShell());
  Control dialogArea=super.createDialogArea(parent);
  getSQLBuilder().addContentChangeListener(this);
  return dialogArea;
}