Program: 67404
Project: 67404
Buggy source:
public TypeInfo createTypeInfoFor(JavaClass javaClass){
  if (javaClass == null) {
    return null;
  }
  if (typeInfo.containsKey(javaClass.getQualifiedName())) {
    return typeInfo.get(javaClass.getQualifiedName());
  }
  TypeInfo info=null;
  if (javaClass.isEnum()) {
    info=new EnumTypeInfo(helper);
  }
 else {
    info=new TypeInfo(helper);
  }
  if (helper.isAnnotationPresent(javaClass,XmlTransient.class)) {
    info.setTransient(true);
  }
  JavaMethod factoryMethod=this.factoryMethods.get(javaClass.getRawName());
  if (factoryMethod != null) {
    info.setFactoryMethodName(factoryMethod.getName());
    info.setObjectFactoryClassName(factoryMethod.getOwningClass().getRawName());
    JavaClass[] paramTypes=factoryMethod.getParameterTypes();
    if (paramTypes != null && paramTypes.length > 0) {
      String[] paramTypeNames=new String[paramTypes.length];
      for (int i=0; i < paramTypes.length; i++) {
        paramTypeNames[i]=paramTypes[i].getRawName();
      }
      info.setFactoryMethodParamTypes(paramTypeNames);
    }
  }
  JavaPackage pack=javaClass.getPackage();
  if (helper.isAnnotationPresent(pack,XmlJavaTypeAdapters.class)) {
    XmlJavaTypeAdapters adapters=(XmlJavaTypeAdapters)helper.getAnnotation(pack,XmlJavaTypeAdapters.class);
    XmlJavaTypeAdapter[] adapterArray=adapters.value();
    for (    XmlJavaTypeAdapter next : adapterArray) {
      JavaClass adapterClass=helper.getJavaClass(next.value());
      JavaClass boundType=helper.getJavaClass(next.type());
      if (boundType != null) {
        info.addAdapterClass(adapterClass,boundType);
      }
 else {
      }
    }
  }
  if (helper.isAnnotationPresent(javaClass,XmlJavaTypeAdapters.class)) {
    XmlJavaTypeAdapters adapters=(XmlJavaTypeAdapters)helper.getAnnotation(javaClass,XmlJavaTypeAdapters.class);
    XmlJavaTypeAdapter[] adapterArray=adapters.value();
    for (    XmlJavaTypeAdapter next : adapterArray) {
      JavaClass adapterClass=helper.getJavaClass(next.value());
      JavaClass boundType=helper.getJavaClass(next.type());
      if (boundType != null) {
        info.addAdapterClass(adapterClass,boundType);
      }
    }
  }
  NamespaceInfo packageNamespace=getNamespaceInfoForPackage(pack);
  if (helper.isAnnotationPresent(pack,XmlSchemaTypes.class)) {
    XmlSchemaTypes types=(XmlSchemaTypes)helper.getAnnotation(pack,XmlSchemaTypes.class);
    XmlSchemaType[] typeArray=types.value();
    for (    XmlSchemaType next : typeArray) {
      processSchemaType(next);
    }
  }
 else   if (helper.isAnnotationPresent(pack,XmlSchemaType.class)) {
    processSchemaType((XmlSchemaType)helper.getAnnotation(pack,XmlSchemaType.class));
  }
  String[] propOrder=new String[]{"String_Node_Str"};
  String typeName="String_Node_Str";
  if (helper.isAnnotationPresent(javaClass,XmlType.class)) {
    XmlType typeAnnotation=(XmlType)helper.getAnnotation(javaClass,XmlType.class);
    typeName=typeAnnotation.name();
    if (typeName.equals("String_Node_Str")) {
      typeName=getSchemaTypeNameForClassName(javaClass.getName());
    }
    propOrder=typeAnnotation.propOrder();
    if (!typeAnnotation.namespace().equals("String_Node_Str")) {
      info.setClassNamespace(typeAnnotation.namespace());
    }
 else {
      info.setClassNamespace(packageNamespace.getNamespace());
    }
    Class factoryClass=typeAnnotation.factoryClass();
    if (factoryClass != DEFAULT.class) {
      String factoryMethodName=typeAnnotation.factoryMethod();
      if (factoryMethodName == null || factoryMethodName.equals("String_Node_Str")) {
        throw org.eclipse.persistence.exceptions.JAXBException.factoryClassWithoutFactoryMethod(javaClass.getName());
      }
      info.setFactoryMethodName(factoryMethodName);
      info.setObjectFactoryClassName(factoryClass.getCanonicalName());
    }
 else {
      String factoryMethodName=typeAnnotation.factoryMethod();
      if (factoryMethodName != null && !factoryMethodName.equals("String_Node_Str")) {
        JavaMethod method=javaClass.getDeclaredMethod(factoryMethodName,new JavaClass[]{});
        if (method == null) {
          throw org.eclipse.persistence.exceptions.JAXBException.factoryMethodNotDeclared(factoryMethodName,javaClass.getName());
        }
        info.setFactoryMethodName(factoryMethodName);
        info.setObjectFactoryClassName(javaClass.getRawName());
      }
    }
  }
 else {
    typeName=getSchemaTypeNameForClassName(javaClass.getName());
    info.setClassNamespace(packageNamespace.getNamespace());
  }
  info.setPropOrder(propOrder);
  info.setSchemaTypeName(typeName);
  if (info.isEnumerationType()) {
    addEnumTypeInfo(javaClass,((EnumTypeInfo)info));
    return info;
  }
  typeInfoClasses.add(javaClass);
  typeInfo.put(javaClass.getQualifiedName(),info);
  if (typeName != null && !("String_Node_Str".equals(typeName))) {
    QName typeQName=new QName(packageNamespace.getNamespace(),typeName);
    boolean containsQName=typeQNames.contains(typeQName);
    if (containsQName) {
      throw JAXBException.nameCollision(typeQName.getNamespaceURI(),typeQName.getLocalPart());
    }
 else {
      typeQNames.add(typeQName);
    }
  }
  if (helper.isAnnotationPresent(javaClass,XmlAccessorType.class)) {
    XmlAccessorType accessorType=(XmlAccessorType)helper.getAnnotation(javaClass,XmlAccessorType.class);
    info.setAccessType(accessorType.value());
  }
 else {
    info.setAccessType(packageNamespace.getAccessType());
  }
  JavaClass superClass=(JavaClass)javaClass.getSuperclass();
  if (shouldGenerateTypeInfo(superClass)) {
    createTypeInfoFor(superClass);
  }
  info.setProperties(getPropertiesForClass(javaClass,info));
  XmlAccessorOrder order=null;
  if (helper.isAnnotationPresent(pack,XmlAccessorOrder.class)) {
    order=(XmlAccessorOrder)helper.getAnnotation(pack,XmlAccessorOrder.class);
  }
  if (helper.isAnnotationPresent(javaClass,XmlAccessorOrder.class)) {
    order=(XmlAccessorOrder)helper.getAnnotation(javaClass,XmlAccessorOrder.class);
  }
  if (order != null) {
    info.orderProperties(order.value());
  }
  ArrayList<Property> properties=info.getPropertyList();
  for (  Property property : properties) {
    JavaClass propertyType=property.getType();
    if (this.isCollectionType(property)) {
      JavaClass gType=property.getGenericType();
      if (gType != null) {
        if (gType.hasActualTypeArguments()) {
          propertyType=helper.getJavaClass(gType.getRawName());
        }
 else         if (gType instanceof JavaClass) {
          propertyType=(JavaClass)gType;
        }
      }
    }
 else     if (propertyType.isArray()) {
      propertyType=(JavaClass)propertyType.getComponentType();
    }
    if (helper.isAnnotationPresent(property.getElement(),XmlElement.class)) {
      XmlElement element=(XmlElement)helper.getAnnotation(property.getElement(),XmlElement.class);
      if (element.type() != XmlElement.DEFAULT.class) {
        propertyType=helper.getJavaClass(element.type());
        property.setType(propertyType);
      }
      if (!element.defaultValue().equals("String_Node_Str")) {
        property.setDefaultValue(element.defaultValue());
      }
      validateElementIsInPropOrder(info,property.getPropertyName());
    }
    if (helper.isAnnotationPresent(property.getElement(),XmlID.class)) {
      if (!areEquals(property.getType(),String.class)) {
        throw JAXBException.invalidId(property.getPropertyName());
      }
      if (info.isIDSet()) {
      }
      info.setIDProperty(property);
    }
    if (helper.isAnnotationPresent(property.getElement(),XmlIDREF.class)) {
      xmlIdRefProps.add(property);
    }
    if (helper.isAnnotationPresent(property.getElement(),XmlJavaTypeAdapter.class)) {
      property.setAdapterClass(((XmlJavaTypeAdapter)helper.getAnnotation(property.getElement(),XmlJavaTypeAdapter.class)).value());
    }
    if (shouldGenerateTypeInfo(propertyType)) {
      createTypeInfoFor(propertyType);
    }
  }
  if (info.getFactoryMethodName() == null && info.getObjectFactoryClassName() == null) {
    JavaConstructor zeroArgConstructor=javaClass.getDeclaredConstructor(new JavaClass[]{});
    if (zeroArgConstructor == null) {
      throw org.eclipse.persistence.exceptions.JAXBException.factoryMethodOrConstructorRequired(javaClass.getName());
    }
  }
  validatePropOrderForInfo(info);
  return info;
}

Fixed version (ground truth):
public TypeInfo createTypeInfoFor(JavaClass javaClass){
  if (javaClass == null) {
    return null;
  }
  if (typeInfo.containsKey(javaClass.getQualifiedName())) {
    return typeInfo.get(javaClass.getQualifiedName());
  }
  TypeInfo info=null;
  if (javaClass.isEnum()) {
    info=new EnumTypeInfo(helper);
  }
 else {
    info=new TypeInfo(helper);
  }
  if (helper.isAnnotationPresent(javaClass,XmlTransient.class)) {
    info.setTransient(true);
  }
  JavaMethod factoryMethod=this.factoryMethods.get(javaClass.getRawName());
  if (factoryMethod != null) {
    info.setFactoryMethodName(factoryMethod.getName());
    info.setObjectFactoryClassName(factoryMethod.getOwningClass().getRawName());
    JavaClass[] paramTypes=factoryMethod.getParameterTypes();
    if (paramTypes != null && paramTypes.length > 0) {
      String[] paramTypeNames=new String[paramTypes.length];
      for (int i=0; i < paramTypes.length; i++) {
        paramTypeNames[i]=paramTypes[i].getRawName();
      }
      info.setFactoryMethodParamTypes(paramTypeNames);
    }
  }
  JavaPackage pack=javaClass.getPackage();
  if (helper.isAnnotationPresent(pack,XmlJavaTypeAdapters.class)) {
    XmlJavaTypeAdapters adapters=(XmlJavaTypeAdapters)helper.getAnnotation(pack,XmlJavaTypeAdapters.class);
    XmlJavaTypeAdapter[] adapterArray=adapters.value();
    for (    XmlJavaTypeAdapter next : adapterArray) {
      JavaClass adapterClass=helper.getJavaClass(next.value());
      JavaClass boundType=helper.getJavaClass(next.type());
      if (boundType != null) {
        info.addAdapterClass(adapterClass,boundType);
      }
 else {
      }
    }
  }
  if (helper.isAnnotationPresent(javaClass,XmlJavaTypeAdapters.class)) {
    XmlJavaTypeAdapters adapters=(XmlJavaTypeAdapters)helper.getAnnotation(javaClass,XmlJavaTypeAdapters.class);
    XmlJavaTypeAdapter[] adapterArray=adapters.value();
    for (    XmlJavaTypeAdapter next : adapterArray) {
      JavaClass adapterClass=helper.getJavaClass(next.value());
      JavaClass boundType=helper.getJavaClass(next.type());
      if (boundType != null) {
        info.addAdapterClass(adapterClass,boundType);
      }
    }
  }
  NamespaceInfo packageNamespace=getNamespaceInfoForPackage(pack);
  if (helper.isAnnotationPresent(pack,XmlSchemaTypes.class)) {
    XmlSchemaTypes types=(XmlSchemaTypes)helper.getAnnotation(pack,XmlSchemaTypes.class);
    XmlSchemaType[] typeArray=types.value();
    for (    XmlSchemaType next : typeArray) {
      processSchemaType(next);
    }
  }
 else   if (helper.isAnnotationPresent(pack,XmlSchemaType.class)) {
    processSchemaType((XmlSchemaType)helper.getAnnotation(pack,XmlSchemaType.class));
  }
  String[] propOrder=new String[]{"String_Node_Str"};
  String typeName="String_Node_Str";
  if (helper.isAnnotationPresent(javaClass,XmlType.class)) {
    XmlType typeAnnotation=(XmlType)helper.getAnnotation(javaClass,XmlType.class);
    typeName=typeAnnotation.name();
    if (typeName.equals("String_Node_Str")) {
      typeName=getSchemaTypeNameForClassName(javaClass.getName());
    }
    propOrder=typeAnnotation.propOrder();
    if (!typeAnnotation.namespace().equals("String_Node_Str")) {
      info.setClassNamespace(typeAnnotation.namespace());
    }
 else {
      info.setClassNamespace(packageNamespace.getNamespace());
    }
    Class factoryClass=typeAnnotation.factoryClass();
    if (factoryClass != DEFAULT.class) {
      String factoryMethodName=typeAnnotation.factoryMethod();
      if (factoryMethodName == null || factoryMethodName.equals("String_Node_Str")) {
        throw org.eclipse.persistence.exceptions.JAXBException.factoryClassWithoutFactoryMethod(javaClass.getName());
      }
      info.setFactoryMethodName(factoryMethodName);
      info.setObjectFactoryClassName(factoryClass.getCanonicalName());
    }
 else {
      String factoryMethodName=typeAnnotation.factoryMethod();
      if (factoryMethodName != null && !factoryMethodName.equals("String_Node_Str")) {
        JavaMethod method=javaClass.getDeclaredMethod(factoryMethodName,new JavaClass[]{});
        if (method == null) {
          throw org.eclipse.persistence.exceptions.JAXBException.factoryMethodNotDeclared(factoryMethodName,javaClass.getName());
        }
        info.setFactoryMethodName(factoryMethodName);
        info.setObjectFactoryClassName(javaClass.getRawName());
      }
    }
  }
 else {
    typeName=getSchemaTypeNameForClassName(javaClass.getName());
    info.setClassNamespace(packageNamespace.getNamespace());
  }
  info.setPropOrder(propOrder);
  info.setSchemaTypeName(typeName);
  if (info.isEnumerationType()) {
    addEnumTypeInfo(javaClass,((EnumTypeInfo)info));
    return info;
  }
  typeInfoClasses.add(javaClass);
  typeInfo.put(javaClass.getQualifiedName(),info);
  if (typeName != null && !("String_Node_Str".equals(typeName))) {
    QName typeQName=new QName(packageNamespace.getNamespace(),typeName);
    boolean containsQName=typeQNames.contains(typeQName);
    if (containsQName) {
      throw JAXBException.nameCollision(typeQName.getNamespaceURI(),typeQName.getLocalPart());
    }
 else {
      typeQNames.add(typeQName);
    }
  }
  if (helper.isAnnotationPresent(javaClass,XmlAccessorType.class)) {
    XmlAccessorType accessorType=(XmlAccessorType)helper.getAnnotation(javaClass,XmlAccessorType.class);
    info.setAccessType(accessorType.value());
  }
 else {
    info.setAccessType(packageNamespace.getAccessType());
  }
  JavaClass superClass=(JavaClass)javaClass.getSuperclass();
  if (shouldGenerateTypeInfo(superClass)) {
    createTypeInfoFor(superClass);
  }
  info.setProperties(getPropertiesForClass(javaClass,info));
  XmlAccessorOrder order=null;
  if (helper.isAnnotationPresent(pack,XmlAccessorOrder.class)) {
    order=(XmlAccessorOrder)helper.getAnnotation(pack,XmlAccessorOrder.class);
  }
  if (helper.isAnnotationPresent(javaClass,XmlAccessorOrder.class)) {
    order=(XmlAccessorOrder)helper.getAnnotation(javaClass,XmlAccessorOrder.class);
  }
  if (order != null) {
    info.orderProperties(order.value());
  }
  ArrayList<Property> properties=info.getPropertyList();
  for (  Property property : properties) {
    JavaClass propertyType=property.getType();
    if (this.isCollectionType(property)) {
      JavaClass gType=property.getGenericType();
      if (gType != null) {
        if (gType.hasActualTypeArguments()) {
          propertyType=helper.getJavaClass(gType.getRawName());
        }
 else         if (gType instanceof JavaClass) {
          propertyType=(JavaClass)gType;
        }
      }
    }
 else     if (propertyType.isArray()) {
      propertyType=(JavaClass)propertyType.getComponentType();
    }
    if (helper.isAnnotationPresent(property.getElement(),XmlElement.class)) {
      XmlElement element=(XmlElement)helper.getAnnotation(property.getElement(),XmlElement.class);
      if (element.type() != XmlElement.DEFAULT.class) {
        propertyType=helper.getJavaClass(element.type());
        property.setType(propertyType);
      }
      if (!element.defaultValue().equals("String_Node_Str")) {
        property.setDefaultValue(element.defaultValue());
      }
      validateElementIsInPropOrder(info,property.getPropertyName());
    }
    if (helper.isAnnotationPresent(property.getElement(),XmlID.class)) {
      if (!areEquals(property.getType(),String.class)) {
        throw JAXBException.invalidId(property.getPropertyName());
      }
      if (info.isIDSet()) {
      }
      info.setIDProperty(property);
    }
    if (helper.isAnnotationPresent(property.getElement(),XmlIDREF.class)) {
      xmlIdRefProps.add(property);
    }
    if (helper.isAnnotationPresent(property.getElement(),XmlJavaTypeAdapter.class)) {
      XmlJavaTypeAdapter adapter=(XmlJavaTypeAdapter)helper.getAnnotation(property.getElement(),XmlJavaTypeAdapter.class);
      JavaClass adapterClass=helper.getJavaClass(adapter.value());
      property.setAdapterClass(adapterClass);
      propertyType=property.getValueType();
    }
    if (shouldGenerateTypeInfo(propertyType)) {
      createTypeInfoFor(propertyType);
    }
  }
  if (info.getFactoryMethodName() == null && info.getObjectFactoryClassName() == null) {
    JavaConstructor zeroArgConstructor=javaClass.getDeclaredConstructor(new JavaClass[]{});
    if (zeroArgConstructor == null) {
      throw org.eclipse.persistence.exceptions.JAXBException.factoryMethodOrConstructorRequired(javaClass.getName());
    }
  }
  validatePropOrderForInfo(info);
  return info;
}