Program: 75263
Project: 75263
Buggy source:
/** 
 * Initializes a report element with "name" and "extends" property.
 * @param attrs the SAX attributes object
 * @param nameRequired true if this element requires a name, false if the name is optional.
 * @see #initSimpleElement(Attributes)
 */
protected void initElement(Attributes attrs,boolean nameRequired){
  DesignElement element=getElement();
  String name=attrs.getValue(IDesignElementModel.NAME_PROP);
  PropertyDefn propDefn=element.getPropertyDefn(IDesignElementModel.NAME_PROP);
  if (propDefn == null) {
    handler.getErrorHandler().semanticWarning(new NameException(element,name,NameException.DESIGN_EXCEPTION_NAME_FORBIDDEN));
  }
 else {
    boolean isValidName=true;
    try {
      name=(String)propDefn.validateValue(this.handler.getModule(),name);
    }
 catch (    PropertyValueException e) {
      handler.getErrorHandler().semanticError(new NameException(element,name,NameException.DESIGN_EXCEPTION_INVALID_NAME));
      isValidName=false;
      element.setName(name);
    }
    if (isValidName) {
      if (StringUtil.isBlank(name)) {
        if (nameRequired) {
          if (handler.versionNumber <= VersionUtil.VERSION_3_2_12 && element instanceof ExtendedItem) {
            handler.addUnnamedReportItem(element);
          }
        }
      }
 else       element.setName(name);
    }
  }
  String extendsName=attrs.getValue(DesignSchemaConstants.EXTENDS_ATTRIB);
  if (!StringUtil.isBlank(extendsName) && element.getDefn().canExtend()) {
    element.setExtendsName(extendsName);
    resolveExtendsElement();
  }
 else {
    if (!StringUtil.isBlank(attrs.getValue(DesignSchemaConstants.EXTENDS_ATTRIB)))     handler.getErrorHandler().semanticError(new DesignParserException(DesignParserException.DESIGN_EXCEPTION_ILLEGAL_EXTENDS));
  }
  initSimpleElement(attrs);
}

Fixed version (ground truth):
/** 
 * Initializes a report element with "name" and "extends" property.
 * @param attrs the SAX attributes object
 * @param nameRequired true if this element requires a name, false if the name is optional.
 * @see #initSimpleElement(Attributes)
 */
protected void initElement(Attributes attrs,boolean nameRequired){
  DesignElement element=getElement();
  String name=attrs.getValue(IDesignElementModel.NAME_PROP);
  PropertyDefn propDefn=element.getPropertyDefn(IDesignElementModel.NAME_PROP);
  if (!StringUtil.isBlank(name) && propDefn == null) {
    handler.getErrorHandler().semanticWarning(new NameException(element,name,NameException.DESIGN_EXCEPTION_NAME_FORBIDDEN));
  }
 else   if (propDefn != null) {
    boolean isValidName=true;
    try {
      name=(String)propDefn.validateValue(this.handler.getModule(),name);
    }
 catch (    PropertyValueException e) {
      handler.getErrorHandler().semanticError(new NameException(element,name,NameException.DESIGN_EXCEPTION_INVALID_NAME));
      isValidName=false;
      element.setName(name);
    }
    if (isValidName) {
      if (StringUtil.isBlank(name)) {
        if (nameRequired) {
          if (handler.versionNumber <= VersionUtil.VERSION_3_2_12 && element instanceof ExtendedItem) {
            handler.addUnnamedReportItem(element);
          }
        }
      }
 else       element.setName(name);
    }
  }
  String extendsName=attrs.getValue(DesignSchemaConstants.EXTENDS_ATTRIB);
  if (!StringUtil.isBlank(extendsName) && element.getDefn().canExtend()) {
    element.setExtendsName(extendsName);
    resolveExtendsElement();
  }
 else {
    if (!StringUtil.isBlank(attrs.getValue(DesignSchemaConstants.EXTENDS_ATTRIB)))     handler.getErrorHandler().semanticError(new DesignParserException(DesignParserException.DESIGN_EXCEPTION_ILLEGAL_EXTENDS));
  }
  initSimpleElement(attrs);
}