Program: 67202
Project: 67202
Buggy source:
public void processGlobalElements(Project project){
  if (this.globalElements == null) {
    return;
  }
  Iterator<QName> keys=this.globalElements.keySet().iterator();
  while (keys.hasNext()) {
    QName next=keys.next();
    ElementDeclaration nextElement=this.globalElements.get(next);
    String nextClassName=nextElement.getJavaTypeName();
    TypeInfo type=this.typeInfo.get(nextClassName);
    if (helper.isBuiltInJavaType(nextElement.getJavaType()) || (type != null && type.isEnumerationType())) {
      String namespaceUri=next.getNamespaceURI();
      if (namespaceUri == null || namespaceUri.equals("String_Node_Str")) {
        namespaceUri="String_Node_Str";
      }
      String attributeTypeName=nextClassName;
      if (nextElement.getAdaptedJavaTypeName() != null) {
        attributeTypeName=nextElement.getAdaptedJavaTypeName();
      }
      Class generatedClass=this.generateWrapperClass(WRAPPER_CLASS + wrapperCounter++,attributeTypeName,nextElement.isList(),next);
      this.qNamesToGeneratedClasses.put(next,generatedClass);
      try {
        Class declaredClass=PrivilegedAccessHelper.getClassForName(nextClassName,false,helper.getClassLoader());
        this.qNamesToDeclaredClasses.put(next,declaredClass);
      }
 catch (      Exception e) {
      }
      XMLDescriptor desc=new XMLDescriptor();
      desc.setJavaClass(generatedClass);
      if (nextElement.isList()) {
        XMLCompositeDirectCollectionMapping mapping=new XMLCompositeDirectCollectionMapping();
        mapping.setAttributeName("String_Node_Str");
        mapping.setXPath("String_Node_Str");
        mapping.setUsesSingleNode(true);
        if (type != null && type.isEnumerationType()) {
          mapping.setValueConverter(buildJAXBEnumTypeConverter(mapping,(EnumTypeInfo)type));
        }
 else {
          try {
            Class fieldElementClass=PrivilegedAccessHelper.getClassForName(nextClassName,false,helper.getClassLoader());
            mapping.setFieldElementClass(fieldElementClass);
          }
 catch (          ClassNotFoundException e) {
          }
        }
        if (nextClassName.equals("String_Node_Str") || nextClassName.equals("String_Node_Str")) {
          ((XMLField)mapping.getField()).setSchemaType(XMLConstants.BASE_64_BINARY_QNAME);
        }
 else         if (nextClassName.equals("String_Node_Str")) {
          ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
        }
        desc.addMapping(mapping);
      }
 else {
        if (nextElement.getJavaTypeName().equals(OBJECT_CLASS_NAME)) {
          XMLCompositeObjectMapping mapping=new XMLCompositeObjectMapping();
          mapping.setAttributeName("String_Node_Str");
          mapping.setSetMethodName("String_Node_Str");
          mapping.setGetMethodName("String_Node_Str");
          mapping.getNullPolicy().setNullRepresentedByXsiNil(true);
          mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
          mapping.setXPath("String_Node_Str");
          ((XMLField)mapping.getField()).setIsTypedTextField(true);
          ((XMLField)mapping.getField()).setSchemaType(XMLConstants.ANY_TYPE_QNAME);
          desc.addMapping(mapping);
        }
 else {
          XMLDirectMapping mapping=new XMLDirectMapping();
          mapping.setAttributeName("String_Node_Str");
          mapping.setXPath("String_Node_Str");
          mapping.setSetMethodName("String_Node_Str");
          mapping.setGetMethodName("String_Node_Str");
          if (helper.isBuiltInJavaType(nextElement.getJavaType())) {
            Class attributeClassification=org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(attributeTypeName,getClass().getClassLoader());
            mapping.setAttributeClassification(attributeClassification);
          }
          IsSetNullPolicy nullPolicy=new IsSetNullPolicy("String_Node_Str",false,true,XMLNullRepresentationType.ABSENT_NODE);
          nullPolicy.setNullRepresentedByEmptyNode(true);
          mapping.setNullPolicy(nullPolicy);
          if (type != null && type.isEnumerationType()) {
            mapping.setConverter(buildJAXBEnumTypeConverter(mapping,(EnumTypeInfo)type));
          }
          if (nextClassName.equals("String_Node_Str") || nextClassName.equals("String_Node_Str")) {
            ((XMLField)mapping.getField()).setSchemaType(XMLConstants.BASE_64_BINARY_QNAME);
          }
 else           if (nextClassName.equals("String_Node_Str")) {
            ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
          }
          if (nextElement.getJavaTypeAdapterClass() != null) {
            mapping.setConverter(new XMLJavaTypeConverter(nextElement.getJavaTypeAdapterClass()));
          }
          desc.addMapping(mapping);
        }
      }
      NamespaceInfo info=getNamespaceInfoForURI(namespaceUri);
      if (info != null) {
        NamespaceResolver resolver=info.getNamespaceResolver();
        String prefix=resolver.resolveNamespaceURI(namespaceUri);
        desc.setNamespaceResolver(resolver);
        desc.setDefaultRootElement("String_Node_Str");
        desc.addRootElement(prefix + "String_Node_Str" + next.getLocalPart());
      }
 else {
        if (namespaceUri.equals("String_Node_Str")) {
          desc.setDefaultRootElement(next.getLocalPart());
        }
 else {
          NamespaceResolver resolver=new NamespaceResolver();
          String prefix=resolver.generatePrefix();
          resolver.put(prefix,namespaceUri);
          desc.setNamespaceResolver(resolver);
          desc.setDefaultRootElement("String_Node_Str");
          desc.addRootElement(prefix + "String_Node_Str" + next.getLocalPart());
        }
      }
      project.addDescriptor(desc);
    }
 else     if (type != null && !type.isTransient()) {
      if (next.getNamespaceURI() == null || next.getNamespaceURI().equals("String_Node_Str")) {
        type.getDescriptor().addRootElement(next.getLocalPart());
      }
 else {
        XMLDescriptor descriptor=type.getDescriptor();
        String uri=next.getNamespaceURI();
        String prefix=descriptor.getNamespaceResolver().resolveNamespaceURI(uri);
        if (prefix == null) {
          prefix=descriptor.getNamespaceResolver().generatePrefix();
          descriptor.getNamespaceResolver().put(prefix,uri);
        }
        descriptor.addRootElement(prefix + "String_Node_Str" + next.getLocalPart());
      }
    }
  }
}

Fixed version (ground truth):
public void processGlobalElements(Project project){
  if (this.globalElements == null) {
    return;
  }
  Iterator<QName> keys=this.globalElements.keySet().iterator();
  while (keys.hasNext()) {
    QName next=keys.next();
    ElementDeclaration nextElement=this.globalElements.get(next);
    String nextClassName=nextElement.getJavaTypeName();
    TypeInfo type=this.typeInfo.get(nextClassName);
    if (helper.isBuiltInJavaType(nextElement.getJavaType()) || (type != null && type.isEnumerationType())) {
      String namespaceUri=next.getNamespaceURI();
      if (namespaceUri == null || namespaceUri.equals("String_Node_Str")) {
        namespaceUri="String_Node_Str";
      }
      String attributeTypeName=nextClassName;
      if (nextElement.getAdaptedJavaTypeName() != null) {
        attributeTypeName=nextElement.getAdaptedJavaTypeName();
      }
      Class generatedClass=this.generateWrapperClass(WRAPPER_CLASS + wrapperCounter++,attributeTypeName,nextElement.isList(),next);
      this.qNamesToGeneratedClasses.put(next,generatedClass);
      try {
        Class declaredClass=PrivilegedAccessHelper.getClassForName(nextClassName,false,helper.getClassLoader());
        this.qNamesToDeclaredClasses.put(next,declaredClass);
      }
 catch (      Exception e) {
      }
      XMLDescriptor desc=new XMLDescriptor();
      desc.setJavaClass(generatedClass);
      if (nextElement.isList()) {
        XMLCompositeDirectCollectionMapping mapping=new XMLCompositeDirectCollectionMapping();
        mapping.setAttributeName("String_Node_Str");
        mapping.setXPath("String_Node_Str");
        mapping.setUsesSingleNode(true);
        if (type != null && type.isEnumerationType()) {
          mapping.setValueConverter(buildJAXBEnumTypeConverter(mapping,(EnumTypeInfo)type));
        }
 else {
          try {
            Class fieldElementClass=PrivilegedAccessHelper.getClassForName(nextClassName,false,helper.getClassLoader());
            mapping.setFieldElementClass(fieldElementClass);
          }
 catch (          ClassNotFoundException e) {
          }
        }
        if (nextClassName.equals("String_Node_Str") || nextClassName.equals("String_Node_Str")) {
          ((XMLField)mapping.getField()).setSchemaType(XMLConstants.BASE_64_BINARY_QNAME);
        }
 else         if (nextClassName.equals("String_Node_Str")) {
          ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
        }
        desc.addMapping(mapping);
      }
 else {
        if (nextElement.getJavaTypeName().equals(OBJECT_CLASS_NAME)) {
          XMLCompositeObjectMapping mapping=new XMLCompositeObjectMapping();
          mapping.setAttributeName("String_Node_Str");
          mapping.setSetMethodName("String_Node_Str");
          mapping.setGetMethodName("String_Node_Str");
          mapping.getNullPolicy().setNullRepresentedByXsiNil(true);
          mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
          mapping.setXPath("String_Node_Str");
          ((XMLField)mapping.getField()).setIsTypedTextField(true);
          ((XMLField)mapping.getField()).setSchemaType(XMLConstants.ANY_TYPE_QNAME);
          desc.addMapping(mapping);
        }
 else {
          XMLDirectMapping mapping=new XMLDirectMapping();
          mapping.setAttributeName("String_Node_Str");
          mapping.setXPath("String_Node_Str");
          mapping.setSetMethodName("String_Node_Str");
          mapping.setGetMethodName("String_Node_Str");
          if (nextElement.getDefaultValue() != null) {
            mapping.setNullValue(nextElement.getDefaultValue());
          }
          if (helper.isBuiltInJavaType(nextElement.getJavaType())) {
            Class attributeClassification=org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(attributeTypeName,getClass().getClassLoader());
            mapping.setAttributeClassification(attributeClassification);
          }
          IsSetNullPolicy nullPolicy=new IsSetNullPolicy("String_Node_Str",false,true,XMLNullRepresentationType.ABSENT_NODE);
          mapping.setNullPolicy(nullPolicy);
          if (type != null && type.isEnumerationType()) {
            mapping.setConverter(buildJAXBEnumTypeConverter(mapping,(EnumTypeInfo)type));
          }
          if (nextClassName.equals("String_Node_Str") || nextClassName.equals("String_Node_Str")) {
            ((XMLField)mapping.getField()).setSchemaType(XMLConstants.BASE_64_BINARY_QNAME);
          }
 else           if (nextClassName.equals("String_Node_Str")) {
            ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
          }
          if (nextElement.getJavaTypeAdapterClass() != null) {
            mapping.setConverter(new XMLJavaTypeConverter(nextElement.getJavaTypeAdapterClass()));
          }
          desc.addMapping(mapping);
        }
      }
      NamespaceInfo info=getNamespaceInfoForURI(namespaceUri);
      if (info != null) {
        NamespaceResolver resolver=info.getNamespaceResolver();
        String prefix=resolver.resolveNamespaceURI(namespaceUri);
        desc.setNamespaceResolver(resolver);
        desc.setDefaultRootElement("String_Node_Str");
        desc.addRootElement(prefix + "String_Node_Str" + next.getLocalPart());
      }
 else {
        if (namespaceUri.equals("String_Node_Str")) {
          desc.setDefaultRootElement(next.getLocalPart());
        }
 else {
          NamespaceResolver resolver=new NamespaceResolver();
          String prefix=resolver.generatePrefix();
          resolver.put(prefix,namespaceUri);
          desc.setNamespaceResolver(resolver);
          desc.setDefaultRootElement("String_Node_Str");
          desc.addRootElement(prefix + "String_Node_Str" + next.getLocalPart());
        }
      }
      project.addDescriptor(desc);
    }
 else     if (type != null && !type.isTransient()) {
      if (next.getNamespaceURI() == null || next.getNamespaceURI().equals("String_Node_Str")) {
        type.getDescriptor().addRootElement(next.getLocalPart());
      }
 else {
        XMLDescriptor descriptor=type.getDescriptor();
        String uri=next.getNamespaceURI();
        String prefix=descriptor.getNamespaceResolver().resolveNamespaceURI(uri);
        if (prefix == null) {
          prefix=descriptor.getNamespaceResolver().generatePrefix();
          descriptor.getNamespaceResolver().put(prefix,uri);
        }
        descriptor.addRootElement(prefix + "String_Node_Str" + next.getLocalPart());
      }
    }
  }
}