Program: 64913
Project: 64913
Buggy source:
public SchemaTypeInfo addClass(JavaClass javaClass){
  if (javaClass == null) {
    return null;
  }
 else   if (helper.isAnnotationPresent(javaClass,XmlTransient.class)) {
    return null;
  }
  if (typeInfo == null) {
    this.typeInfoClasses=new ArrayList<JavaClass>();
    this.typeInfo=new HashMap<String,TypeInfo>();
    this.typeQNames=new ArrayList<QName>();
    this.userDefinedSchemaTypes=new HashMap<String,QName>();
    this.packageToPackageInfoMappings=new HashMap<String,PackageInfo>();
    this.namespaceResolver=new NamespaceResolver();
  }
  JavaClass[] jClasses=new JavaClass[]{javaClass};
  buildNewTypeInfo(jClasses);
  TypeInfo info=typeInfo.get(javaClass.getQualifiedName());
  PackageInfo packageInfo;
  String packageName=javaClass.getPackageName();
  packageInfo=this.packageToPackageInfoMappings.get(packageName);
  SchemaTypeInfo schemaInfo=new SchemaTypeInfo();
  schemaInfo.setSchemaTypeName(new QName(info.getClassNamespace(),info.getSchemaTypeName()));
  if (info.isSetXmlRootElement()) {
    org.eclipse.persistence.jaxb.xmlmodel.XmlRootElement xmlRE=info.getXmlRootElement();
    String elementName=xmlRE.getName();
    if (elementName.equals(XMLProcessor.DEFAULT) || elementName.equals(EMPTY_STRING)) {
      try {
        elementName=info.getXmlNameTransformer().transformRootElementName(javaClass.getName());
      }
 catch (      Exception ex) {
        throw org.eclipse.persistence.exceptions.JAXBException.exceptionDuringNameTransformation(javaClass.getName(),info.getXmlNameTransformer().getClass().getName(),ex);
      }
    }
    String rootNamespace=xmlRE.getNamespace();
    QName rootElemName=null;
    if (rootNamespace.equals(XMLProcessor.DEFAULT)) {
      rootElemName=new QName(packageInfo.getNamespace(),elementName);
    }
 else {
      rootElemName=new QName(rootNamespace,elementName);
    }
    schemaInfo.getGlobalElementDeclarations().add(rootElemName);
    ElementDeclaration declaration=new ElementDeclaration(rootElemName,javaClass,javaClass.getRawName(),false);
    addGlobalElement(rootElemName,declaration);
  }
  return schemaInfo;
}

Fixed version (ground truth):
public SchemaTypeInfo addClass(JavaClass javaClass){
  if (javaClass == null) {
    return null;
  }
 else   if (helper.isAnnotationPresent(javaClass,XmlTransient.class)) {
    return null;
  }
  if (typeInfo == null) {
    this.typeInfoClasses=new ArrayList<JavaClass>();
    this.typeInfo=new HashMap<String,TypeInfo>();
    this.typeQNames=new ArrayList<QName>();
    this.userDefinedSchemaTypes=new HashMap<String,QName>();
    this.packageToPackageInfoMappings=new HashMap<String,PackageInfo>();
  }
  JavaClass[] jClasses=new JavaClass[]{javaClass};
  buildNewTypeInfo(jClasses);
  TypeInfo info=typeInfo.get(javaClass.getQualifiedName());
  PackageInfo packageInfo;
  String packageName=javaClass.getPackageName();
  packageInfo=this.packageToPackageInfoMappings.get(packageName);
  SchemaTypeInfo schemaInfo=new SchemaTypeInfo();
  schemaInfo.setSchemaTypeName(new QName(info.getClassNamespace(),info.getSchemaTypeName()));
  if (info.isSetXmlRootElement()) {
    org.eclipse.persistence.jaxb.xmlmodel.XmlRootElement xmlRE=info.getXmlRootElement();
    String elementName=xmlRE.getName();
    if (elementName.equals(XMLProcessor.DEFAULT) || elementName.equals(EMPTY_STRING)) {
      try {
        elementName=info.getXmlNameTransformer().transformRootElementName(javaClass.getName());
      }
 catch (      Exception ex) {
        throw org.eclipse.persistence.exceptions.JAXBException.exceptionDuringNameTransformation(javaClass.getName(),info.getXmlNameTransformer().getClass().getName(),ex);
      }
    }
    String rootNamespace=xmlRE.getNamespace();
    QName rootElemName=null;
    if (rootNamespace.equals(XMLProcessor.DEFAULT)) {
      rootElemName=new QName(packageInfo.getNamespace(),elementName);
    }
 else {
      rootElemName=new QName(rootNamespace,elementName);
    }
    schemaInfo.getGlobalElementDeclarations().add(rootElemName);
    ElementDeclaration declaration=new ElementDeclaration(rootElemName,javaClass,javaClass.getRawName(),false);
    addGlobalElement(rootElemName,declaration);
  }
  return schemaInfo;
}