nus-yam/ex-repair huggingface dataset:
Program: 77586
Project: 77586
Buggy source:
/** 
 * Returns data source handles that are visible to this modules.
 * @return data source handles that are visible to this modules.
 */
public List getVisibleDataSources(){
  IModuleNameSpace namescope=module.getModuleNameSpace(Module.DATA_SOURCE_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameSpace.NATIVE_LEVEL);
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns data source handles that are visible to this modules.
 * @return data source handles that are visible to this modules.
 */
public List getVisibleDataSources(){
  IModuleNameScope namescope=module.getModuleNameSpace(Module.DATA_SOURCE_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameScope.NATIVE_LEVEL);
  return generateHandleList(elementList);
}
Program: 77587
Project: 77587
Buggy source:
/** 
 * Returns all style element handles that this modules and the included modules contain.
 * @return all style element handles that this modules and the includedmodules contain.
 */
public List getAllStyles(){
  List elementList=module.getModuleNameSpace(Module.STYLE_NAME_SPACE).getElements(IModuleNameSpace.ARBITARY_LEVEL);
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns all style element handles that this modules and the included modules contain.
 * @return all style element handles that this modules and the includedmodules contain.
 */
public List getAllStyles(){
  List elementList=module.getModuleNameSpace(Module.STYLE_NAME_SPACE).getElements(IModuleNameScope.ARBITARY_LEVEL);
  return generateHandleList(elementList);
}
Program: 77588
Project: 77588
Buggy source:
/** 
 * Returns the libraries this report design includes directly or indirectly. Each in the returned list is the instance of <code>LibraryHandle</code>.
 * @return the libraries this report design includes directly or indirectly.
 */
public List getAllLibraries(){
  return getLibraries(IModuleNameSpace.ARBITARY_LEVEL);
}

Fixed version (ground truth):
/** 
 * Returns the libraries this report design includes directly or indirectly. Each in the returned list is the instance of <code>LibraryHandle</code>.
 * @return the libraries this report design includes directly or indirectly.
 */
public List getAllLibraries(){
  return getLibraries(IModuleNameScope.ARBITARY_LEVEL);
}
Program: 77590
Project: 77590
Buggy source:
/** 
 * @return Returns the imageUri.
 */
public String getImageUri(){
}

Fixed version (ground truth):
/** 
 * @return Returns the imageUri.
 */
public String getImageUri(){
  return imageUri;
}
Program: 77591
Project: 77591
Buggy source:
/** 
 * Notice the return value of this function is IResultObject. The null value indicates the cursor exceeds the end of result set.
 * @return next result data
 * @throws DataException
 */
public IResultObject next() throws DataException {
  IResultObject ro=this.rowResultSet.next();
  if (ro == null)   return null;
  Object[] objs=new Object[this.resultClass.getFieldCount()];
  int roFieldCount=ro.getResultClass().getFieldCount();
  for (int i=0; i < objs.length; i++) {
    if (i + 1 <= roFieldCount)     objs[i]=ro.getFieldValue(i + 1);
 else     objs[i]=null;
  }
  return new ResultObject(resultClass,objs);
}

Fixed version (ground truth):
/** 
 * Notice the return value of this function is IResultObject. The null value indicates the cursor exceeds the end of result set.
 * @return next result data
 * @throws DataException
 */
public IResultObject next() throws DataException {
  IResultObject ro=this.rowResultSet.next();
  if (ro == null)   return null;
  Object[] objs=new Object[this.resultClass.getFieldCount()];
  if (objs.length > 0) {
    int roFieldCount=ro.getResultClass().getFieldCount();
    for (int i=0; i < objs.length; i++) {
      if (i + 1 <= roFieldCount)       objs[i]=ro.getFieldValue(i + 1);
 else       objs[i]=null;
    }
  }
  return new ResultObject(resultClass,objs);
}
Program: 77594
Project: 77594
Buggy source:
/** 
 * set script editor page active
 */
public static void setScriptActivityEditor(){
  if (UIUtil.getActiveReportEditor().findPage("String_Node_Str") != null) {
    UIUtil.getActiveReportEditor().setActivePage("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * set script editor page active The id must be same with ReportScriptFormPage.ID
 */
public static void setScriptActivityEditor(){
  final String SCRIPT_EDITOR_ID="String_Node_Str";
  if (UIUtil.getActiveReportEditor().findPage(SCRIPT_EDITOR_ID) != null) {
    UIUtil.getActiveReportEditor().setActivePage(SCRIPT_EDITOR_ID);
  }
}
Program: 77595
Project: 77595
Buggy source:
protected void createRoot(){
  super.createRoot();
  removeBoxProperty(root.getStyle());
}

Fixed version (ground truth):
protected void createRoot(){
  super.createRoot();
  IStyle style=root.getStyle();
  removeBoxProperty(root.getStyle());
  style.setProperty(StyleConstants.STYLE_BACKGROUND_IMAGE,IStyle.NONE_VALUE);
  style.setProperty(StyleConstants.STYLE_BACKGROUND_COLOR,IStyle.AUTO_VALUE);
}
Program: 77596
Project: 77596
Buggy source:
TextArea(ITextContent textContent,String text,FontInfo fi){
  super(textContent);
  this.text=text;
  this.fi=fi;
  style.setMarginBottom(CSSConstants.CSS_NONE_VALUE);
  style.setMarginTop(CSSConstants.CSS_NONE_VALUE);
  style.setMarginLeft(CSSConstants.CSS_NONE_VALUE);
  style.setMarginRight(CSSConstants.CSS_NONE_VALUE);
  style.setBorderBottom(CSSConstants.CSS_NONE_VALUE);
  style.setBorderTop(CSSConstants.CSS_NONE_VALUE);
  style.setBorderLeft(CSSConstants.CSS_NONE_VALUE);
  style.setBorderRight(CSSConstants.CSS_NONE_VALUE);
  style.setPaddingBottom(CSSConstants.CSS_NONE_VALUE);
  style.setPaddingTop(CSSConstants.CSS_NONE_VALUE);
  style.setPaddingLeft(CSSConstants.CSS_NONE_VALUE);
  style.setPaddingRight(CSSConstants.CSS_NONE_VALUE);
}

Fixed version (ground truth):
TextArea(ITextContent textContent,String text,FontInfo fi){
  super(textContent);
  this.text=text;
  this.fi=fi;
  removePadding();
  removeBorder();
  removeMargin();
}
Program: 77597
Project: 77597
Buggy source:
protected boolean needPageBreakBefore(){
  if (content == null) {
    return false;
  }
  boolean ret=hasMasterPageChanged();
  IStyle style=content.getStyle();
  String pageBreak=style.getPageBreakBefore();
  if (IStyle.CSS_ALWAYS_VALUE == pageBreak || IStyle.CSS_LEFT_VALUE == pageBreak || IStyle.CSS_RIGHT_VALUE == pageBreak || IStyle.BIRT_SOFT_VALUE == pageBreak) {
    style.setPageBreakBefore(IStyle.CSS_AUTO_VALUE);
    return true;
  }
  return ret;
}

Fixed version (ground truth):
protected boolean needPageBreakBefore(){
  if (content == null) {
    return false;
  }
  boolean ret=hasMasterPageChanged();
  IStyle style=content.getStyle();
  String pageBreak=style.getPageBreakBefore();
  if (IStyle.CSS_ALWAYS_VALUE == pageBreak || IStyle.CSS_LEFT_VALUE == pageBreak || IStyle.CSS_RIGHT_VALUE == pageBreak || IStyle.BIRT_SOFT_VALUE == pageBreak) {
    return true;
  }
  return ret;
}
Program: 77598
Project: 77598
Buggy source:
protected boolean needPageBreakAfter(){
  if (content == null) {
    return false;
  }
  IStyle style=content.getStyle();
  String pageBreak=style.getPageBreakAfter();
  if (IStyle.CSS_ALWAYS_VALUE == pageBreak || IStyle.CSS_LEFT_VALUE == pageBreak || IStyle.CSS_RIGHT_VALUE == pageBreak) {
    style.setPageBreakAfter(IStyle.CSS_AUTO_VALUE);
    return true;
  }
  return false;
}

Fixed version (ground truth):
protected boolean needPageBreakAfter(){
  if (content == null) {
    return false;
  }
  IStyle style=content.getStyle();
  String pageBreak=style.getPageBreakAfter();
  if (IStyle.CSS_ALWAYS_VALUE == pageBreak || IStyle.CSS_LEFT_VALUE == pageBreak || IStyle.CSS_RIGHT_VALUE == pageBreak) {
    return true;
  }
  return false;
}
Program: 77599
Project: 77599
Buggy source:
protected boolean needPageBreakBefore(){
  if (content == null) {
    return false;
  }
  boolean ret=hasMasterPageChanged();
  IStyle style=content.getStyle();
  String pageBreak=style.getPageBreakBefore();
  if (IStyle.CSS_ALWAYS_VALUE == pageBreak || IStyle.CSS_LEFT_VALUE == pageBreak || IStyle.CSS_RIGHT_VALUE == pageBreak || IStyle.BIRT_SOFT_VALUE == pageBreak) {
    style.setPageBreakBefore(IStyle.CSS_AUTO_VALUE);
    return true;
  }
  return ret;
}

Fixed version (ground truth):
protected boolean needPageBreakBefore(){
  if (content == null) {
    return false;
  }
  boolean ret=hasMasterPageChanged();
  IStyle style=content.getStyle();
  String pageBreak=style.getPageBreakBefore();
  if (IStyle.CSS_ALWAYS_VALUE == pageBreak || IStyle.CSS_LEFT_VALUE == pageBreak || IStyle.CSS_RIGHT_VALUE == pageBreak || IStyle.BIRT_SOFT_VALUE == pageBreak) {
    return true;
  }
  return ret;
}
Program: 77600
Project: 77600
Buggy source:
protected boolean needPageBreakAfter(){
  if (content == null) {
    return false;
  }
  IStyle style=content.getStyle();
  String pageBreak=style.getPageBreakAfter();
  if (IStyle.CSS_ALWAYS_VALUE == pageBreak || IStyle.CSS_LEFT_VALUE == pageBreak || IStyle.CSS_RIGHT_VALUE == pageBreak) {
    style.setPageBreakAfter(IStyle.CSS_AUTO_VALUE);
    return true;
  }
  return false;
}

Fixed version (ground truth):
protected boolean needPageBreakAfter(){
  if (content == null) {
    return false;
  }
  IStyle style=content.getStyle();
  String pageBreak=style.getPageBreakAfter();
  if (IStyle.CSS_ALWAYS_VALUE == pageBreak || IStyle.CSS_LEFT_VALUE == pageBreak || IStyle.CSS_RIGHT_VALUE == pageBreak) {
    return true;
  }
  return false;
}
Program: 77602
Project: 77602
Buggy source:
private void initList(){
  for (Iterator itor=getModuleHandle().imagesIterator(); itor.hasNext(); ) {
    EmbeddedImageHandle handle=(EmbeddedImageHandle)itor.next();
    embeddedImageList.add(handle.getQualifiedName());
  }
  int index=-1;
  if (DesignChoiceConstants.IMAGE_REF_TYPE_EMBED.equals(inputImage.getSource())) {
    String imageName=inputImage.getImageName();
    if (imageName != null) {
      index=embeddedImageList.indexOf(imageName);
    }
  }
  if (index != -1) {
    embeddedImageList.select(index);
    preview();
  }
 else {
    clearPreview();
  }
  updateButtons();
}

Fixed version (ground truth):
private void initList(){
  for (Iterator itor=getModuleHandle().getAllImages().iterator(); itor.hasNext(); ) {
    EmbeddedImageHandle handle=(EmbeddedImageHandle)itor.next();
    embeddedImageList.add(handle.getQualifiedName());
  }
  int index=-1;
  if (DesignChoiceConstants.IMAGE_REF_TYPE_EMBED.equals(inputImage.getSource())) {
    String imageName=inputImage.getImageName();
    if (imageName != null) {
      index=embeddedImageList.indexOf(imageName);
    }
  }
  if (index != -1) {
    embeddedImageList.select(index);
    preview();
  }
 else {
    clearPreview();
  }
  updateButtons();
}
Program: 77603
Project: 77603
Buggy source:
protected void verticalAlign(CellArea cell){
  IContent content=cell.getContent();
  if (content == null) {
    return;
  }
  String verticalAlign=content.getComputedStyle().getVerticalAlign();
  if (CSSConstants.CSS_BOTTOM_VALUE.equals(verticalAlign) || CSSConstants.CSS_MIDDLE_VALUE.equals(verticalAlign)) {
    int totalHeight=0;
    Iterator iter=cell.getChildren();
    while (iter.hasNext()) {
      AbstractArea child=(AbstractArea)iter.next();
      totalHeight+=child.getAllocatedHeight();
    }
    int offset=cell.getContentHeight() - totalHeight;
    if (offset > 0) {
      if (CSSConstants.CSS_BOTTOM_VALUE.equals(verticalAlign)) {
        iter=cell.getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setAllocatedPosition(child.getAllocatedX(),child.getAllocatedY() + offset);
        }
      }
 else       if (CSSConstants.CSS_MIDDLE_VALUE.equals(verticalAlign)) {
        iter=cell.getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setAllocatedPosition(child.getAllocatedX(),child.getAllocatedY() + offset / 2);
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void verticalAlign(CellArea cell){
  IContent content=cell.getContent();
  if (content == null) {
    return;
  }
  CSSValue verticalAlign=content.getComputedStyle().getProperty(IStyle.STYLE_VERTICAL_ALIGN);
  if (IStyle.BOTTOM_VALUE.equals(verticalAlign) || IStyle.MIDDLE_VALUE.equals(verticalAlign)) {
    int totalHeight=0;
    Iterator iter=cell.getChildren();
    while (iter.hasNext()) {
      AbstractArea child=(AbstractArea)iter.next();
      totalHeight+=child.getAllocatedHeight();
    }
    int offset=cell.getContentHeight() - totalHeight;
    if (offset > 0) {
      if (IStyle.BOTTOM_VALUE.equals(verticalAlign)) {
        iter=cell.getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setAllocatedPosition(child.getAllocatedX(),child.getAllocatedY() + offset);
        }
      }
 else       if (IStyle.MIDDLE_VALUE.equals(verticalAlign)) {
        iter=cell.getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setAllocatedPosition(child.getAllocatedX(),child.getAllocatedY() + offset / 2);
        }
      }
    }
  }
  CSSValue align=content.getComputedStyle().getProperty(IStyle.STYLE_TEXT_ALIGN);
  if ((IStyle.RIGHT_VALUE.equals(align) || IStyle.CENTER_VALUE.equals(align))) {
    Iterator iter=cell.getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      int spacing=cell.getContentWidth() - area.getAllocatedWidth();
      if (spacing > 0) {
        if (IStyle.RIGHT_VALUE.equals(align)) {
          area.setAllocatedPosition(spacing + area.getAllocatedX(),area.getAllocatedY());
        }
 else         if (IStyle.CENTER_VALUE.equals(align)) {
          area.setAllocatedPosition(spacing / 2 + area.getAllocatedX(),area.getAllocatedY());
        }
      }
    }
  }
}
Program: 77604
Project: 77604
Buggy source:
private boolean matchDataType(ResultSetColumnHandle column){
  String type=getSelectedDataType();
  if (type.equals(DesignChoiceConstants.PARAM_TYPE_STRING) || DesignChoiceConstants.COLUMN_DATA_TYPE_ANY.equals(column.getDataType())) {
    return true;
  }
  if (DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME.equals(column.getDataType())) {
    return type.equals(DesignChoiceConstants.PARAM_TYPE_DATETIME);
  }
 else   if (DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL.equals(column.getDataType())) {
    return type.equals(DesignChoiceConstants.PARAM_TYPE_DECIMAL);
  }
 else   if (DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT.equals(column.getDataType())) {
    return type.equals(DesignChoiceConstants.PARAM_TYPE_FLOAT);
  }
 else   if (DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER.equals(column.getDataType())) {
    return type.equals(DesignChoiceConstants.PARAM_TYPE_FLOAT) || type.equals(DesignChoiceConstants.PARAM_TYPE_DECIMAL);
  }
  return false;
}

Fixed version (ground truth):
private boolean matchDataType(ResultSetColumnHandle column){
  String type=getSelectedDataType();
  if (type.equals(DesignChoiceConstants.PARAM_TYPE_STRING) || DesignChoiceConstants.COLUMN_DATA_TYPE_ANY.equals(column.getDataType())) {
    return true;
  }
  if (DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME.equals(column.getDataType())) {
    return type.equals(DesignChoiceConstants.PARAM_TYPE_DATETIME);
  }
 else   if (DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL.equals(column.getDataType())) {
    return type.equals(DesignChoiceConstants.PARAM_TYPE_DECIMAL);
  }
 else   if (DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT.equals(column.getDataType())) {
    return type.equals(DesignChoiceConstants.PARAM_TYPE_FLOAT);
  }
 else   if (DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER.equals(column.getDataType())) {
    return type.equals(DesignChoiceConstants.PARAM_TYPE_INTEGER);
  }
  return false;
}
Program: 77605
Project: 77605
Buggy source:
/** 
 * Sets the image uri property. The source type is <code>IMAGE_REF_TYPE_URL</code>, and will automatically set in this method.
 * @param uri the uri to be set.
 * @throws SemanticException if the property is locked.
 */
public void setURI(String uri) throws SemanticException {
  String source=DesignChoiceConstants.IMAGE_REF_TYPE_URL;
  setURIProperty(uri,source);
}

Fixed version (ground truth):
/** 
 * Sets the image uri property. The source type is <code>IMAGE_REF_TYPE_URL</code>, and will automatically set in this method.
 * @param uri the uri to be set.
 * @throws SemanticException if the property is locked.
 * @deprecated should use {@link #setFile(String)} or{@link #setURL(String)}.
 */
public void setURI(String uri) throws SemanticException {
  setURL(uri);
}
Program: 77606
Project: 77606
Buggy source:
public void end() throws SAXException {
  Module module=handler.getModule();
  checkImageType();
  String refType=image.getStringProperty(module,ImageItem.SOURCE_PROP);
  if (DesignChoiceConstants.IMAGE_REF_TYPE_EXPR.equalsIgnoreCase(refType)) {
    String valueExpr=image.getStringProperty(module,ImageItem.VALUE_EXPR_PROP);
    if (StringUtil.isEmpty(valueExpr)) {
      handler.getErrorHandler().semanticError(new DesignParserException(DesignParserException.DESIGN_EXCEPTION_INVALID_IMAGEREF_EXPR_VALUE));
    }
  }
 else   if (DesignChoiceConstants.IMAGE_REF_TYPE_URL.equalsIgnoreCase(refType) || DesignChoiceConstants.IMAGE_REF_TYPE_FILE.equalsIgnoreCase(refType)) {
    String uri=image.getStringProperty(module,ImageItem.URI_PROP);
    if (StringUtil.isEmpty(uri)) {
      handler.getErrorHandler().semanticError(new DesignParserException(DesignParserException.DESIGN_EXCEPTION_INVALID_IMAGE_URL_VALUE));
    }
  }
 else   if (DesignChoiceConstants.IMAGE_REF_TYPE_EMBED.equalsIgnoreCase(refType)) {
    String name=image.getStringProperty(module,ImageItem.IMAGE_NAME_PROP);
    if (StringUtil.isEmpty(name)) {
      handler.getErrorHandler().semanticError(new DesignParserException(DesignParserException.DESIGN_EXCEPTION_INVALID_IMAGE_NAME_VALUE));
    }
  }
  super.end();
}

Fixed version (ground truth):
public void end() throws SAXException {
  Module module=handler.getModule();
  if (image.getLocalProperty(module,ImageItem.SOURCE_PROP) == null && StringUtil.compareVersion(handler.getVersion(),"String_Node_Str") < 1)   checkImageType();
  String refType=image.getStringProperty(module,ImageItem.SOURCE_PROP);
  if (DesignChoiceConstants.IMAGE_REF_TYPE_EXPR.equalsIgnoreCase(refType)) {
    String valueExpr=image.getStringProperty(module,ImageItem.VALUE_EXPR_PROP);
    if (StringUtil.isEmpty(valueExpr)) {
      handler.getErrorHandler().semanticError(new DesignParserException(DesignParserException.DESIGN_EXCEPTION_INVALID_IMAGEREF_EXPR_VALUE));
    }
  }
 else   if (DesignChoiceConstants.IMAGE_REF_TYPE_URL.equalsIgnoreCase(refType) || DesignChoiceConstants.IMAGE_REF_TYPE_FILE.equalsIgnoreCase(refType)) {
    String uri=image.getStringProperty(module,ImageItem.URI_PROP);
    if (StringUtil.isEmpty(uri)) {
      handler.getErrorHandler().semanticError(new DesignParserException(DesignParserException.DESIGN_EXCEPTION_INVALID_IMAGE_URL_VALUE));
    }
  }
 else   if (DesignChoiceConstants.IMAGE_REF_TYPE_EMBED.equalsIgnoreCase(refType)) {
    String name=image.getStringProperty(module,ImageItem.IMAGE_NAME_PROP);
    if (StringUtil.isEmpty(name)) {
      handler.getErrorHandler().semanticError(new DesignParserException(DesignParserException.DESIGN_EXCEPTION_INVALID_IMAGE_NAME_VALUE));
    }
  }
  super.end();
}
Program: 77607
Project: 77607
Buggy source:
/** 
 * Check whether the source type conflicts, and set the proper source type.
 */
private void checkImageType(){
  int type=0;
  Module module=handler.getModule();
  String uri=(String)image.getLocalProperty(module,ImageItem.URI_PROP);
  if (!StringUtil.isEmpty(uri)) {
    setProperty(ImageItem.SOURCE_PROP,DesignChoiceConstants.IMAGE_REF_TYPE_URL);
    type++;
  }
  StructRefValue imageName=(StructRefValue)image.getLocalProperty(module,ImageItem.IMAGE_NAME_PROP);
  if (imageName != null) {
    setProperty(ImageItem.SOURCE_PROP,DesignChoiceConstants.IMAGE_REF_TYPE_EMBED);
    type++;
  }
  String typeExpr=(String)image.getLocalProperty(module,ImageItem.TYPE_EXPR_PROP);
  String valueExpr=(String)image.getLocalProperty(module,ImageItem.VALUE_EXPR_PROP);
  if (!StringUtil.isEmpty(typeExpr) || !StringUtil.isEmpty(valueExpr)) {
    setProperty(ImageItem.SOURCE_PROP,DesignChoiceConstants.IMAGE_REF_TYPE_EXPR);
    type++;
  }
  if (type > 1)   handler.getErrorHandler().semanticError(new DesignParserException(DesignParserException.DESIGN_EXCEPTION_IMAGE_REF_CONFLICT));
}

Fixed version (ground truth):
/** 
 * Check whether the source type conflicts, and set the proper source type.
 */
private void checkImageType(){
  int type=0;
  Module module=handler.getModule();
  String uri=(String)image.getLocalProperty(module,ImageItem.URI_PROP);
  if (!StringUtil.isEmpty(uri)) {
    uri=StringUtil.trimQuotes(uri);
    try {
      URL url=new URL(uri);
      setProperty(ImageItem.SOURCE_PROP,DesignChoiceConstants.IMAGE_REF_TYPE_URL);
    }
 catch (    MalformedURLException e) {
      setProperty(ImageItem.SOURCE_PROP,DesignChoiceConstants.IMAGE_REF_TYPE_FILE);
    }
    type++;
  }
  StructRefValue imageName=(StructRefValue)image.getLocalProperty(module,ImageItem.IMAGE_NAME_PROP);
  if (imageName != null) {
    setProperty(ImageItem.SOURCE_PROP,DesignChoiceConstants.IMAGE_REF_TYPE_EMBED);
    type++;
  }
  String typeExpr=(String)image.getLocalProperty(module,ImageItem.TYPE_EXPR_PROP);
  String valueExpr=(String)image.getLocalProperty(module,ImageItem.VALUE_EXPR_PROP);
  if (!StringUtil.isEmpty(typeExpr) || !StringUtil.isEmpty(valueExpr)) {
    setProperty(ImageItem.SOURCE_PROP,DesignChoiceConstants.IMAGE_REF_TYPE_EXPR);
    type++;
  }
  if (type > 1)   handler.getErrorHandler().semanticError(new DesignParserException(DesignParserException.DESIGN_EXCEPTION_IMAGE_REF_CONFLICT));
}
Program: 77608
Project: 77608
Buggy source:
public void visitImage(ImageItem obj){
  boundColumnsMgr.dealImage(obj,getModule());
  writer.startElement(DesignSchemaConstants.IMAGE_TAG);
  super.visitImage(obj);
  property(obj,ImageItem.SIZE_PROP);
  property(obj,ImageItem.SCALE_PROP);
  String source=(String)obj.getLocalProperty(getModule(),ImageItem.SOURCE_PROP);
  if (DesignChoiceConstants.IMAGE_REF_TYPE_URL.equalsIgnoreCase(source) || DesignChoiceConstants.IMAGE_REF_TYPE_FILE.equalsIgnoreCase(source)) {
    property(obj,ImageItem.URI_PROP);
  }
 else   if (DesignChoiceConstants.IMAGE_REF_TYPE_EMBED.equalsIgnoreCase(source)) {
    property(obj,ImageItem.IMAGE_NAME_PROP);
  }
 else   if (DesignChoiceConstants.IMAGE_REF_TYPE_EXPR.equalsIgnoreCase(source)) {
    property(obj,ImageItem.TYPE_EXPR_PROP);
    property(obj,ImageItem.VALUE_EXPR_PROP);
  }
  resourceKey(obj,ImageItem.ALT_TEXT_KEY_PROP,ImageItem.ALT_TEXT_PROP);
  resourceKey(obj,ImageItem.HELP_TEXT_ID_PROP,ImageItem.HELP_TEXT_PROP);
  writeAction(obj,ImageItem.ACTION_PROP);
  writer.endElement();
}

Fixed version (ground truth):
public void visitImage(ImageItem obj){
  boundColumnsMgr.dealImage(obj,getModule());
  writer.startElement(DesignSchemaConstants.IMAGE_TAG);
  super.visitImage(obj);
  property(obj,ImageItem.SIZE_PROP);
  property(obj,ImageItem.SCALE_PROP);
  property(obj,ImageItem.SOURCE_PROP);
  String source=(String)obj.getLocalProperty(getModule(),ImageItem.SOURCE_PROP);
  if (DesignChoiceConstants.IMAGE_REF_TYPE_URL.equalsIgnoreCase(source) || DesignChoiceConstants.IMAGE_REF_TYPE_FILE.equalsIgnoreCase(source)) {
    property(obj,ImageItem.URI_PROP);
  }
 else   if (DesignChoiceConstants.IMAGE_REF_TYPE_EMBED.equalsIgnoreCase(source)) {
    property(obj,ImageItem.IMAGE_NAME_PROP);
  }
 else   if (DesignChoiceConstants.IMAGE_REF_TYPE_EXPR.equalsIgnoreCase(source)) {
    property(obj,ImageItem.TYPE_EXPR_PROP);
    property(obj,ImageItem.VALUE_EXPR_PROP);
  }
  resourceKey(obj,ImageItem.ALT_TEXT_KEY_PROP,ImageItem.ALT_TEXT_PROP);
  resourceKey(obj,ImageItem.HELP_TEXT_ID_PROP,ImageItem.HELP_TEXT_PROP);
  writeAction(obj,ImageItem.ACTION_PROP);
  writer.endElement();
}
Program: 77609
Project: 77609
Buggy source:
/** 
 * Returns the overridden value of the specified property given its internal name.
 * @param propName the name of the property to get. Can be a system-defined or user-defined property name.
 * @return the property binding, or null if the overridden value is not set
 */
public String getPropertyBinding(String propName){
  PropertyBinding propBinding=module.findPropertyBinding(getElement(),propName);
  if (propBinding == null)   return null;
  return propBinding.getValue();
}

Fixed version (ground truth):
/** 
 * Returns the overridden value of the specified property given its internal name.
 * @param propName the name of the property to get. Can be a system-defined or user-defined property name.
 * @return the property binding, or null if the overridden value is not set
 */
public String getPropertyBinding(String propName){
  if (propName == null)   return null;
  DesignElement element=getElement();
  while (element != null && element.getRoot() != null) {
    PropertyBinding propBinding=element.getRoot().findPropertyBinding(element,propName);
    if (propBinding != null)     return propBinding.getValue();
    if (element.isVirtualElement()) {
      element=element.getVirtualParent();
    }
 else {
      element=element.getExtendsElement();
    }
  }
  return null;
}
Program: 77610
Project: 77610
Buggy source:
private boolean matchDataType(ScalarParameterHandle handle,ResultSetColumnHandle columnHandle){
  String type=handle.getDataType();
  if (handle == selectedParameter) {
    type=getSelectedDataType();
  }
  if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type) || DesignChoiceConstants.COLUMN_DATA_TYPE_ANY.equals(columnHandle.getDataType())) {
    return true;
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equals(type)) {
    return DesignChoiceConstants.COLUMN_DATA_TYPE_ANY.equals(columnHandle.getDataType());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
    return DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME.equals(columnHandle.getDataType());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type)) {
    return DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL.equals(columnHandle.getDataType());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type)) {
    return DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT.equals(columnHandle.getDataType());
  }
  return false;
}

Fixed version (ground truth):
private boolean matchDataType(ScalarParameterHandle handle,ResultSetColumnHandle columnHandle){
  String type=handle.getDataType();
  if (handle == selectedParameter) {
    type=getSelectedDataType();
  }
  if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type) || DesignChoiceConstants.COLUMN_DATA_TYPE_ANY.equals(columnHandle.getDataType())) {
    return true;
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equals(type)) {
    return DesignChoiceConstants.COLUMN_DATA_TYPE_ANY.equals(columnHandle.getDataType());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
    return DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME.equals(columnHandle.getDataType());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type)) {
    return DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL.equals(columnHandle.getDataType());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type)) {
    return DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT.equals(columnHandle.getDataType());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(type)) {
    return DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER.equals(columnHandle.getDataType());
  }
  return false;
}
Program: 77611
Project: 77611
Buggy source:
private void doPreview(String pattern){
  String type=getSelectedDataType();
  String formatStr="String_Node_Str";
  if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) {
    formatStr=new StringFormatter(pattern,ULocale.getDefault()).format(DEFAULT_PREVIEW_STRING);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
    formatStr=new DateFormatter(pattern).format(new Date());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type) || DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type)) {
    formatStr=new NumberFormatter(pattern).format(DEFAULT_PREVIEW_NUMBER);
  }
  previewLable.setText(formatStr);
}

Fixed version (ground truth):
private void doPreview(String pattern){
  String type=getSelectedDataType();
  String formatStr="String_Node_Str";
  if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) {
    formatStr=new StringFormatter(pattern,ULocale.getDefault()).format(DEFAULT_PREVIEW_STRING);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
    formatStr=new DateFormatter(pattern).format(new Date());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type) || DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type) || DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(type)) {
    formatStr=new NumberFormatter(pattern).format(DEFAULT_PREVIEW_NUMBER);
  }
  previewLable.setText(formatStr);
}
Program: 77612
Project: 77612
Buggy source:
private void initFormatField(String selectedDataType){
  IChoiceSet choiceSet=getFormatChoiceSet(selectedDataType);
  if (choiceSet == null) {
    formatCategroy=formatPattern=null;
  }
 else {
    if (!loading || (selectedParameter.getCategory() == null && selectedParameter.getPattern() == null)) {
      if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(selectedDataType)) {
        formatCategroy=choiceSet.findChoice(DesignChoiceConstants.STRING_FORMAT_TYPE_UNFORMATTED).getName();
      }
 else       if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(selectedDataType)) {
        formatCategroy=choiceSet.findChoice(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED).getName();
      }
 else       if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(selectedDataType) || DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(selectedDataType)) {
        formatCategroy=choiceSet.findChoice(DesignChoiceConstants.NUMBER_FORMAT_TYPE_UNFORMATTED).getName();
      }
      formatPattern=null;
    }
 else {
      formatCategroy=selectedParameter.getCategory();
      if (formatCategroy == null) {
        formatCategroy=DesignChoiceConstants.STRING_FORMAT_TYPE_UNFORMATTED;
      }
      formatPattern=selectedParameter.getPattern();
    }
  }
  updateFormatField();
}

Fixed version (ground truth):
private void initFormatField(String selectedDataType){
  IChoiceSet choiceSet=getFormatChoiceSet(selectedDataType);
  if (choiceSet == null) {
    formatCategroy=formatPattern=null;
  }
 else {
    if (!loading || (selectedParameter.getCategory() == null && selectedParameter.getPattern() == null)) {
      if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(selectedDataType)) {
        formatCategroy=choiceSet.findChoice(DesignChoiceConstants.STRING_FORMAT_TYPE_UNFORMATTED).getName();
      }
 else       if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(selectedDataType)) {
        formatCategroy=choiceSet.findChoice(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED).getName();
      }
 else       if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(selectedDataType) || DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(selectedDataType) || DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(selectedDataType)) {
        formatCategroy=choiceSet.findChoice(DesignChoiceConstants.NUMBER_FORMAT_TYPE_UNFORMATTED).getName();
      }
      formatPattern=null;
    }
 else {
      formatCategroy=selectedParameter.getCategory();
      if (formatCategroy == null) {
        formatCategroy=DesignChoiceConstants.STRING_FORMAT_TYPE_UNFORMATTED;
      }
      formatPattern=selectedParameter.getPattern();
    }
  }
  updateFormatField();
}
Program: 77613
Project: 77613
Buggy source:
private boolean isEqual(String value1,String value2){
  Object v1=null;
  Object v2=null;
  try {
    v1=getValue(value1);
    v2=getValue(value2);
  }
 catch (  BirtException e) {
  }
  if (v1 == null) {
    return v2 == null;
  }
  if (v1 instanceof Double && v2 instanceof Double) {
    return ((Double)v1).compareTo(v2) == 0;
  }
  if (v1 instanceof BigDecimal && v2 instanceof BigDecimal) {
    return ((BigDecimal)v1).compareTo(v2) == 0;
  }
  return v1.equals(v2);
}

Fixed version (ground truth):
private boolean isEqual(String value1,String value2){
  Object v1=null;
  Object v2=null;
  try {
    v1=getValue(value1);
    v2=getValue(value2);
  }
 catch (  BirtException e) {
  }
  if (v1 == null) {
    return v2 == null;
  }
  if (v1 instanceof Double && v2 instanceof Double) {
    return ((Double)v1).compareTo(v2) == 0;
  }
  if (v1 instanceof BigDecimal && v2 instanceof BigDecimal) {
    return ((BigDecimal)v1).compareTo(v2) == 0;
  }
  if (v1 instanceof Integer && v2 instanceof Integer) {
    return ((Integer)v1).compareTo(v2) == 0;
  }
  return v1.equals(v2);
}
Program: 77615
Project: 77615
Buggy source:
private Object getValue(String value) throws BirtException {
  if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equals(getSelectedDataType())) {
    return DataTypeUtil.toBoolean(value);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(getSelectedDataType())) {
    return DataTypeUtil.toBigDecimal(value);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(getSelectedDataType())) {
    return DataTypeUtil.toDate(value,ULocale.US);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(getSelectedDataType())) {
    return DataTypeUtil.toDouble(value);
  }
  return value;
}

Fixed version (ground truth):
private Object getValue(String value) throws BirtException {
  if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equals(getSelectedDataType())) {
    return DataTypeUtil.toBoolean(value);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(getSelectedDataType())) {
    return DataTypeUtil.toBigDecimal(value);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(getSelectedDataType())) {
    return DataTypeUtil.toDate(value,ULocale.US);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(getSelectedDataType())) {
    return DataTypeUtil.toDouble(value);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(getSelectedDataType())) {
    return DataTypeUtil.toInteger(value);
  }
  return value;
}
Program: 77616
Project: 77616
Buggy source:
protected void createRoot(){
  root=AreaFactory.createCellArea(cellContent);
  tableLM.resolveBorderConflict((CellArea)root);
  root.setWidth(columnWidth);
  if (!isFirst) {
    IStyle areaStyle=root.getStyle();
    areaStyle.setProperty(IStyle.STYLE_BORDER_TOP_WIDTH,IStyle.NUMBER_0);
    areaStyle.setProperty(IStyle.STYLE_PADDING_TOP,IStyle.NUMBER_0);
    areaStyle.setProperty(IStyle.STYLE_MARGIN_TOP,IStyle.NUMBER_0);
  }
}

Fixed version (ground truth):
protected void createRoot(){
  if (!isFirst) {
    int startColumn=cellContent.getColumn();
    int endColumn=startColumn + cellContent.getColSpan();
    columnWidth=tableLM.getCellWidth(startColumn,endColumn);
  }
  root=AreaFactory.createCellArea(cellContent);
  tableLM.resolveBorderConflict((CellArea)root);
  root.setWidth(columnWidth);
  if (!isFirst) {
    IStyle areaStyle=root.getStyle();
    areaStyle.setProperty(IStyle.STYLE_BORDER_TOP_WIDTH,IStyle.NUMBER_0);
    areaStyle.setProperty(IStyle.STYLE_PADDING_TOP,IStyle.NUMBER_0);
    areaStyle.setProperty(IStyle.STYLE_MARGIN_TOP,IStyle.NUMBER_0);
  }
}
Program: 77617
Project: 77617
Buggy source:
public void contextDestroyed(ServletContextEvent event){
  ParameterAccessor.reset();
}

Fixed version (ground truth):
public void contextDestroyed(ServletContextEvent event){
  Platform.shutdown();
  ReportEngineService.shutdown();
  ParameterAccessor.reset();
}
Program: 77619
Project: 77619
Buggy source:
public void contextDestroyed(ServletContextEvent event){
  Platform.shutdown();
}

Fixed version (ground truth):
public void contextDestroyed(ServletContextEvent event){
  ParameterAccessor.reset();
}
Program: 77620
Project: 77620
Buggy source:
/** 
 * @param list
 * @param expression
 * @throws DataException
 */
private static void populateColumnList(List list,IScriptExpression expression) throws DataException {
  if (expression != null) {
    List l;
    try {
      l=ExpressionUtil.extractColumnExpressions(expression.getText());
    }
 catch (    BirtException e) {
      throw DataException.wrap(e);
    }
    for (int i=0; i < l.size(); i++) {
      IColumnBinding cb=(IColumnBinding)l.get(i);
      if (!list.contains(cb.getResultSetColumnName()))       list.add(cb.getResultSetColumnName());
    }
  }
}

Fixed version (ground truth):
/** 
 * @param list
 * @param expression
 * @throws DataException
 */
private static void populateColumnList(List list,IScriptExpression expression) throws DataException {
  if (expression != null) {
    List l;
    try {
      l=ExpressionUtil.extractColumnExpressions(expression.getText());
    }
 catch (    BirtException e) {
      throw DataException.wrap(e);
    }
    for (int i=0; i < l.size(); i++) {
      IColumnBinding cb=(IColumnBinding)l.get(i);
      if (!list.contains(cb.getResultSetColumnName()) && cb.getOuterLevel() == 0)       list.add(cb.getResultSetColumnName());
    }
  }
}
Program: 77621
Project: 77621
Buggy source:
public void prepare(String command) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str" + command + "String_Node_Str");
  try {
    if (command == null) {
      logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
      throw new OdaException("String_Node_Str");
    }
    procedureName=getProcedureName(command);
    this.callStat=conn.prepareCall(formatQueryText(command));
    paramUtil=new SPParameterPositionUtil(formatQueryText(command),'@');
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.STATEMENT_CANNOT_PREPARE,e);
  }
}

Fixed version (ground truth):
public void prepare(String command) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str" + command + "String_Node_Str");
  try {
    if (command == null) {
      logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
      throw new OdaException("String_Node_Str");
    }
    procedureName=getProcedureName(command);
    String queryText=SQLFormatter.formatQueryText(command);
    this.callStat=conn.prepareCall(queryText);
    paramUtil=new SPParameterPositionUtil(queryText,'@');
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.STATEMENT_CANNOT_PREPARE,e);
  }
}
Program: 77622
Project: 77622
Buggy source:
public void prepare(String command) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str" + command + "String_Node_Str");
  try {
    if (command == null) {
      logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
      throw new OdaException("String_Node_Str");
    }
    this.cachedResultMetaData=null;
    this.cachedResultSet=null;
    this.preStat=conn.prepareStatement(formatQueryText(command));
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.STATEMENT_CANNOT_PREPARE,e);
  }
}

Fixed version (ground truth):
public void prepare(String command) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str" + command + "String_Node_Str");
  try {
    if (command == null) {
      logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
      throw new OdaException("String_Node_Str");
    }
    this.cachedResultMetaData=null;
    this.cachedResultSet=null;
    this.preStat=conn.prepareStatement(SQLFormatter.formatQueryText(command));
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.STATEMENT_CANNOT_PREPARE,e);
  }
}
Program: 77623
Project: 77623
Buggy source:
public String getLocalizedMessage(){
  if (infoCode == CONVERT_FOR_COLUMN_BINDING) {
    return ModelMessages.getMessage(CONVERT_INFO_MSG,new String[]{COLUMN_BINDING_FROM_VERSION,COLUMN_BINDING_FEATURE});
  }
  return ModelMessages.getMessage(INVALID_DESIGN_FILE_MSG);
}

Fixed version (ground truth):
public String getLocalizedMessage(){
  if (infoCode == CONVERT_FOR_COLUMN_BINDING) {
    return ModelMessages.getMessage(CONVERT_INFO_MSG);
  }
  return ModelMessages.getMessage(INVALID_DESIGN_FILE_MSG);
}
Program: 77624
Project: 77624
Buggy source:
protected void execute(IReportItemExecutor executor,IContent content){
  while (executor.hasNextChild()) {
    IReportItemExecutor childExecutor=executor.getNextChild();
    if (childExecutor != null) {
      IContent childContent=childExecutor.execute();
      removePageBreak(childContent);
      content.getChildren().add(childContent);
      execute(childExecutor,childContent);
      childExecutor.close();
    }
  }
}

Fixed version (ground truth):
protected void execute(IReportItemExecutor executor,IContent content){
  while (executor.hasNextChild()) {
    IReportItemExecutor childExecutor=executor.getNextChild();
    if (childExecutor != null) {
      IContent childContent=childExecutor.execute();
      content.getChildren().add(childContent);
      execute(childExecutor,childContent);
      childExecutor.close();
    }
  }
}
Program: 77625
Project: 77625
Buggy source:
public boolean hasNextChild(){
  if (!needUpdate) {
    return hasNext;
  }
  if (currentRunIn != null) {
    if (currentRunIn.hasNextChild()) {
      hasNext=true;
      needUpdate=false;
      return hasNext;
    }
 else {
      currentRunIn.close();
    }
  }
  currentRunIn=null;
  while (executor.hasNextChild()) {
    IReportItemExecutor next=executor.getNextChild();
    IContent nextContent=next.execute();
    if (nextContent instanceof IListBandContent) {
      IListBandContent band=(IListBandContent)nextContent;
      if (repeat && (band.getBandType() == IBandContent.BAND_HEADER || band.getBandType() == IBandContent.BAND_GROUP_HEADER)) {
        execute(next,nextContent);
        next.close();
        next=new DOMReportItemExecutor(nextContent);
        next.execute();
        nextContent.getParent().getChildren().add(nextContent);
      }
      if (next.hasNextChild()) {
        currentRunIn=next;
        break;
      }
    }
 else {
      childExecutor=next;
      childContent=nextContent;
      break;
    }
  }
  if (currentRunIn != null || childContent != null) {
    hasNext=true;
  }
 else {
    hasNext=false;
  }
  needUpdate=false;
  return hasNext;
}

Fixed version (ground truth):
public boolean hasNextChild(){
  if (!needUpdate) {
    return hasNext;
  }
  if (currentRunIn != null) {
    if (currentRunIn.hasNextChild()) {
      hasNext=true;
      needUpdate=false;
      return hasNext;
    }
 else {
      currentRunIn.close();
    }
  }
  currentRunIn=null;
  while (executor.hasNextChild()) {
    IReportItemExecutor next=executor.getNextChild();
    IContent nextContent=next.execute();
    if (nextContent instanceof IListBandContent) {
      IListBandContent band=(IListBandContent)nextContent;
      if (repeat && (band.getBandType() == IBandContent.BAND_HEADER || band.getBandType() == IBandContent.BAND_GROUP_HEADER)) {
        executeHeader(next,nextContent);
        next.close();
        next=new DOMReportItemExecutor(nextContent);
        next.execute();
        nextContent.getParent().getChildren().add(nextContent);
      }
      if (next.hasNextChild()) {
        currentRunIn=next;
        break;
      }
    }
 else {
      childExecutor=next;
      childContent=nextContent;
      break;
    }
  }
  if (currentRunIn != null || childContent != null) {
    hasNext=true;
  }
 else {
    hasNext=false;
  }
  needUpdate=false;
  return hasNext;
}
Program: 77626
Project: 77626
Buggy source:
/** 
 * Makes a unqiue name for the given element.
 * @param element the element to make a unique name
 */
void makeUniqueName(DesignElement element);

Fixed version (ground truth):
/** 
 * Makes a unique name for the given element.
 * @param element the element to make a unique name
 */
void makeUniqueName(DesignElement element);
Program: 77627
Project: 77627
Buggy source:
/** 
 * Returns copied cells with the column number.
 * @param columnNumber the column number
 * @return new cell instances
 */
abstract protected List getCellsUnderColumn(int columnNumber);

Fixed version (ground truth):
/** 
 * Returns copied cells with the column number regardless whether the current position is where the cell element begins to span.
 * @param columnNumber the column number
 * @param mustBeStartPosition <code>true</code> if it is. Otherwise <code>false</code>.
 * @return the matched cell
 */
abstract protected List getCellsUnderColumn(int columnNumber,boolean mustBeStartPosition);
Program: 77628
Project: 77628
Buggy source:
/** 
 * Returns a copied cell with the given row and column number.
 * @param row the row
 * @param columnIndex the column number
 * @return a new cell instance
 */
private CellHandle getCellsInRow(RowHandle row,int columnIndex){
  SlotHandle cells=row.getCells();
  for (int i=0; i < cells.getCount(); i++) {
    CellHandle cell=(CellHandle)cells.get(i);
    int cellColumnIndex=getCellPosition(cell);
    if (cellColumnIndex == columnIndex)     return cell;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns a copied cell with the given row and column number.
 * @param row the row
 * @param columnIndex the column number
 * @param mustBeStartPosition <code>true</code> if it is. Otherwise <code>false</code>.
 * @return a new cell instance
 */
private CellHandle getCellsInRow(RowHandle row,int columnIndex,boolean mustBeStartPosition){
  SlotHandle cells=row.getCells();
  for (int i=0; i < cells.getCount(); i++) {
    CellHandle cell=(CellHandle)cells.get(i);
    int cellColumnIndex=getCellPosition(cell);
    if (cellColumnIndex == columnIndex)     return cell;
    if (!mustBeStartPosition && cellColumnIndex < columnIndex && cellColumnIndex + cell.getColumnSpan() >= columnIndex)     return cell;
  }
  return null;
}
Program: 77629
Project: 77629
Buggy source:
/** 
 * Returns copied cells with the given slot and column number.
 * @param handle the slot
 * @param columnIndex the column number
 * @return new cell instances
 */
protected List getCellsInSlot(SlotHandle handle,int columnIndex){
  List retValue=new ArrayList();
  for (int i=0; i < handle.getCount(); i++) {
    RowHandle row=(RowHandle)handle.get(i);
    CellHandle cell=getCellsInRow(row,columnIndex);
    if (cell != null)     retValue.add(cell);
  }
  return retValue;
}

Fixed version (ground truth):
/** 
 * Returns copied cells with the given slot and column number.
 * @param handle the slot
 * @param columnIndex the column number
 * @param mustBeStartPosition <code>true</code> if it is. Otherwise <code>false</code>.
 * @return new cell instances
 */
protected List getCellsInSlot(SlotHandle handle,int columnIndex,boolean mustBeStartPosition){
  List retValue=new ArrayList();
  for (int i=0; i < handle.getCount(); i++) {
    RowHandle row=(RowHandle)handle.get(i);
    CellHandle cell=getCellsInRow(row,columnIndex,mustBeStartPosition);
    if (cell != null)     retValue.add(cell);
  }
  return retValue;
}