Program: 66754
Project: 66754
Buggy source:
public void addToSchemaType(TypeInfo ownerTypeInfo,java.util.List<Property> properties,TypeDefParticle compositor,ComplexType type,Schema schema){
  Property xmlValueProperty=ownerTypeInfo.getXmlValueProperty();
  for (  Property next : properties) {
    if (next == null) {
      continue;
    }
    TypeDefParticle parentCompositor=compositor;
    boolean isChoice=(parentCompositor instanceof Choice);
    ComplexType parentType=type;
    if (!helper.isAnnotationPresent(next.getElement(),XmlTransient.class)) {
      if (!isChoice && next.isSetXmlElementWrapper()) {
        XmlElementWrapper wrapper=next.getXmlElementWrapper();
        Element wrapperElement=new Element();
        String name=wrapper.getName();
        if (name.equals("String_Node_Str")) {
          name=next.getPropertyName();
        }
        wrapperElement.setNillable(wrapper.isNillable());
        String wrapperNS=wrapper.getNamespace();
        if (!wrapperNS.equals("String_Node_Str") && !wrapperNS.equals(schema.getTargetNamespace())) {
          wrapperElement.setMinOccurs(Occurs.ONE);
          wrapperElement.setMaxOccurs(Occurs.ONE);
          String prefix=getOrGeneratePrefixForNamespace(wrapperNS,schema);
          wrapperElement.setRef(prefix + "String_Node_Str" + name);
          compositor.addElement(wrapperElement);
          continue;
        }
 else {
          wrapperElement.setName(name);
          if (wrapper.isRequired()) {
            wrapperElement.setMinOccurs(Occurs.ONE);
          }
 else {
            wrapperElement.setMinOccurs(Occurs.ZERO);
          }
          compositor.addElement(wrapperElement);
          ComplexType wrapperType=new ComplexType();
          Sequence wrapperSequence=new Sequence();
          wrapperType.setSequence(wrapperSequence);
          wrapperElement.setComplexType(wrapperType);
          parentType=wrapperType;
          parentCompositor=wrapperSequence;
        }
      }
      if (next.isAttribute() && !next.isAnyAttribute()) {
        Attribute attribute=new Attribute();
        QName attributeName=next.getSchemaName();
        attribute.setName(attributeName.getLocalPart());
        if (next.isRequired()) {
          attribute.setUse(Attribute.REQUIRED);
        }
        JavaClass javaType=next.getType();
        if (next.getGenericType() != null) {
          javaType=(JavaClass)next.getGenericType();
        }
        TypeInfo info=(TypeInfo)typeInfo.get(next.getType().getQualifiedName());
        String typeName=null;
        if (next.isXmlId()) {
          typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
        }
 else         if (next.isXmlIdRef()) {
          typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
        }
 else         if (info != null && !info.isComplexType()) {
          typeName=info.getSimpleType().getName();
        }
 else {
          QName schemaType=next.getSchemaType();
          if (schemaType == null) {
            schemaType=getSchemaTypeFor(javaType);
          }
          if (schemaType != null) {
            if (schemaType.getNamespaceURI() == null) {
              typeName=schemaType.getLocalPart();
            }
 else {
              String prefix=getOrGeneratePrefixForNamespace(schemaType.getNamespaceURI(),schema);
              typeName=prefix + "String_Node_Str" + schemaType.getLocalPart();
            }
          }
 else {
            typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
          }
        }
        if (isCollectionType(next)) {
          SimpleType localType=new SimpleType();
          org.eclipse.persistence.internal.oxm.schema.model.List list=new org.eclipse.persistence.internal.oxm.schema.model.List();
          list.setItemType(typeName);
          localType.setList(list);
          attribute.setSimpleType(localType);
        }
 else {
          if (typeName != null && !typeName.contains("String_Node_Str")) {
            if (info.getSchema() == schema) {
              String prefix=getPrefixForNamespace(schema.getTargetNamespace(),schema.getNamespaceResolver());
              if (prefix != null) {
                typeName=prefix + "String_Node_Str" + typeName;
              }
            }
          }
          attribute.setType(typeName);
        }
        String lookupNamespace=schema.getTargetNamespace();
        if (lookupNamespace == null) {
          lookupNamespace="String_Node_Str";
        }
        NamespaceInfo namespaceInfo=getNamespaceInfoForNamespace(lookupNamespace);
        boolean isAttributeFormQualified=true;
        if (namespaceInfo != null) {
          isAttributeFormQualified=namespaceInfo.isAttributeFormQualified();
        }
        if ((isAttributeFormQualified && !attributeName.getNamespaceURI().equals(lookupNamespace)) || (!namespaceInfo.isAttributeFormQualified() && !attributeName.getNamespaceURI().equals("String_Node_Str"))) {
          Schema attributeSchema=this.getSchemaForNamespace(attributeName.getNamespaceURI());
          if (attributeSchema != null && attributeSchema.getTopLevelAttributes().get(attribute.getName()) == null) {
            attributeSchema.getTopLevelAttributes().put(attribute.getName(),attribute);
          }
          addImportIfRequired(schema,attributeSchema,attributeName.getNamespaceURI());
          Attribute reference=new Attribute();
          String prefix=getPrefixForNamespace(attributeName.getNamespaceURI(),schema.getNamespaceResolver());
          if (prefix == null) {
            reference.setRef(attribute.getName());
          }
 else {
            reference.setRef(prefix + "String_Node_Str" + attribute.getName());
          }
          if (parentType.getSimpleContent() != null) {
            parentType.getSimpleContent().getExtension().getOrderedAttributes().add(reference);
          }
 else {
            parentType.getOrderedAttributes().add(reference);
          }
        }
 else {
          if (parentType.getSimpleContent() != null) {
            parentType.getSimpleContent().getExtension().getOrderedAttributes().add(attribute);
          }
 else           if (parentType.getComplexContent() != null) {
            parentType.getComplexContent().getExtension().getOrderedAttributes().add(attribute);
          }
 else {
            parentType.getOrderedAttributes().add(attribute);
          }
        }
      }
 else       if (next.isAnyAttribute()) {
        AnyAttribute anyAttribute=new AnyAttribute();
        anyAttribute.setProcessContents("String_Node_Str");
        anyAttribute.setNamespace("String_Node_Str");
        if (type.getSimpleContent() != null) {
          SimpleContent content=type.getSimpleContent();
          content.getRestriction().setAnyAttribute(anyAttribute);
        }
 else {
          type.setAnyAttribute(anyAttribute);
        }
      }
 else       if (next.isChoice()) {
        Choice choice=new Choice();
        ArrayList<Property> choiceProperties=(ArrayList<Property>)((ChoiceProperty)next).getChoiceProperties();
        addToSchemaType(ownerTypeInfo,choiceProperties,choice,parentType,schema);
        if (next.getGenericType() != null) {
          choice.setMaxOccurs(Occurs.UNBOUNDED);
        }
        if (parentCompositor instanceof Sequence) {
          ((Sequence)parentCompositor).addChoice(choice);
        }
 else         if (parentCompositor instanceof Choice) {
          ((Choice)parentCompositor).addChoice(choice);
        }
      }
 else       if (next.isAny()) {
        Any any=new Any();
        any.setNamespace("String_Node_Str");
        if (next.isLax()) {
          any.setProcessContents(Any.LAX);
        }
 else {
          any.setProcessContents("String_Node_Str");
        }
        if (isCollectionType(next)) {
          any.setMinOccurs(Occurs.ZERO);
          any.setMaxOccurs(Occurs.UNBOUNDED);
        }
        if (parentCompositor instanceof Sequence) {
          ((Sequence)parentCompositor).addAny(any);
        }
 else         if (parentCompositor instanceof Choice) {
          ((Choice)parentCompositor).addAny(any);
        }
      }
 else       if (next.isReference()) {
        ReferenceProperty refProp=(ReferenceProperty)next;
        java.util.List<ElementDeclaration> referencedElements=refProp.getReferencedElements();
        if (referencedElements.size() == 1) {
          Element element=new Element();
          ElementDeclaration decl=referencedElements.get(0);
          String localName=decl.getElementName().getLocalPart();
          Schema referencedSchema=this.getSchemaForNamespace(decl.getElementName().getNamespaceURI());
          addImportIfRequired(schema,referencedSchema,decl.getElementName().getNamespaceURI());
          String prefix=this.getPrefixForNamespace(decl.getElementName().getNamespaceURI(),schema.getNamespaceResolver());
          if (prefix == null || prefix.equals("String_Node_Str")) {
            element.setRef(localName);
          }
 else {
            element.setRef(prefix + "String_Node_Str" + localName);
          }
          if (next.getGenericType() != null) {
            element.setMinOccurs(Occurs.ZERO);
            element.setMaxOccurs(Occurs.UNBOUNDED);
          }
          parentCompositor.addElement(element);
        }
 else {
          Choice choice=new Choice();
          if (next.getGenericType() != null) {
            choice.setMaxOccurs(Occurs.UNBOUNDED);
          }
          for (          ElementDeclaration elementDecl : referencedElements) {
            Element element=new Element();
            String localName=elementDecl.getElementName().getLocalPart();
            Schema referencedSchema=this.getSchemaForNamespace(elementDecl.getElementName().getNamespaceURI());
            addImportIfRequired(schema,referencedSchema,elementDecl.getElementName().getNamespaceURI());
            String prefix=this.getPrefixForNamespace(elementDecl.getElementName().getNamespaceURI(),schema.getNamespaceResolver());
            if (prefix == null || prefix.equals("String_Node_Str")) {
              element.setRef(localName);
            }
 else {
              element.setRef(prefix + "String_Node_Str" + localName);
            }
            choice.addElement(element);
          }
          if (parentCompositor instanceof Sequence) {
            ((Sequence)parentCompositor).addChoice(choice);
          }
 else           if (parentCompositor instanceof Choice) {
            ((Choice)parentCompositor).addChoice(choice);
          }
        }
      }
 else       if (!(xmlValueProperty != null && xmlValueProperty == next)) {
        Element element=new Element();
        if (!(parentCompositor instanceof All)) {
          element.setMinOccurs(next.isRequired() ? Occurs.ONE : Occurs.ZERO);
        }
        element.setNillable(next.isNillable());
        if (next.isSetDefaultValue()) {
          element.setDefaultValue(next.getDefaultValue());
        }
        if (next.getMimeType() != null) {
          element.getAttributesMap().put(XMLConstants.EXPECTED_CONTENT_TYPES_QNAME,next.getMimeType());
        }
        QName elementName=next.getSchemaName();
        JavaClass javaType=next.getActualType();
        boolean isComplexType=false;
        element.setName(elementName.getLocalPart());
        String typeName=null;
        if (next.isXmlId()) {
          typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
        }
 else         if (next.isXmlIdRef()) {
          typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
        }
 else {
          TypeInfo info=(TypeInfo)typeInfo.get(javaType.getQualifiedName());
          if (info != null) {
            isComplexType=info.isComplexType();
            if (isComplexType) {
              typeName=info.getComplexType().getName();
            }
 else             if (info.getSimpleType() != null) {
              typeName=info.getSimpleType().getName();
            }
 else {
              typeName=info.getSchemaTypeName();
            }
            if (typeName == null) {
              if (!info.hasRootElement()) {
                if (info.isComplexType()) {
                  element.setComplexType(info.getComplexType());
                }
 else {
                  element.setSimpleType(info.getSimpleType());
                }
              }
            }
            if (addImportIfRequired(schema,info.getSchema(),info.getClassNamespace())) {
              String prefix=schema.getNamespaceResolver().resolveNamespaceURI(info.getClassNamespace());
              if (prefix != null && !typeName.equals("String_Node_Str")) {
                typeName=prefix + "String_Node_Str" + typeName;
              }
            }
          }
 else           if (!next.isMap()) {
            QName schemaType=next.getSchemaType();
            if (schemaType == null) {
              schemaType=getSchemaTypeFor(javaType);
            }
            if (schemaType != null) {
              if (schemaType.getNamespaceURI() == null) {
                typeName=schemaType.getLocalPart();
              }
 else {
                String prefix=getOrGeneratePrefixForNamespace(schemaType.getNamespaceURI(),schema);
                typeName=prefix + "String_Node_Str" + schemaType.getLocalPart();
              }
            }
          }
          if (typeName != null && !typeName.contains("String_Node_Str")) {
            String prefix=getPrefixForNamespace(info.getSchema().getTargetNamespace(),schema.getNamespaceResolver());
            if (prefix != null) {
              typeName=prefix + "String_Node_Str" + typeName;
            }
          }
        }
        if (next.getGenericType() != null) {
          if (next.isXmlList()) {
            if (isComplexType) {
            }
            SimpleType localSimpleType=new SimpleType();
            org.eclipse.persistence.internal.oxm.schema.model.List list=new org.eclipse.persistence.internal.oxm.schema.model.List();
            list.setItemType(typeName);
            localSimpleType.setList(list);
            element.setSimpleType(localSimpleType);
          }
 else {
            element.setMaxOccurs(Occurs.UNBOUNDED);
            element.setType(typeName);
          }
        }
 else         if (next.isMap()) {
          ComplexType entryComplexType=new ComplexType();
          Sequence entrySequence=new Sequence();
          Element keyElement=new Element();
          keyElement.setName(Property.DEFAULT_KEY_NAME);
          keyElement.setMinOccurs(Occurs.ZERO);
          JavaClass keyType=next.getKeyType();
          JavaClass valueType=next.getValueType();
          if (keyType == null) {
            keyType=helper.getJavaClass(Object.class);
          }
          if (valueType == null) {
            valueType=helper.getJavaClass(Object.class);
          }
          QName keySchemaType=getSchemaTypeFor(keyType);
          if (keySchemaType != null) {
            TypeInfo targetInfo=this.typeInfo.get(keyType.getQualifiedName());
            if (targetInfo != null) {
              Schema keyElementSchema=this.getSchemaForNamespace(keySchemaType.getNamespaceURI());
              addImportIfRequired(schema,keyElementSchema,keySchemaType.getNamespaceURI());
            }
            String prefix;
            if (keySchemaType.getNamespaceURI().equals(XMLConstants.SCHEMA_URL)) {
              prefix=XMLConstants.SCHEMA_PREFIX;
            }
 else {
              prefix=getPrefixForNamespace(keySchemaType.getNamespaceURI(),schema.getNamespaceResolver());
            }
            if (prefix != null && !prefix.equals("String_Node_Str")) {
              typeName=prefix + "String_Node_Str" + keySchemaType.getLocalPart();
            }
 else {
              typeName=keySchemaType.getLocalPart();
            }
            keyElement.setType(typeName);
          }
          entrySequence.addElement(keyElement);
          Element valueElement=new Element();
          valueElement.setName(Property.DEFAULT_VALUE_NAME);
          valueElement.setMinOccurs(Occurs.ZERO);
          QName valueSchemaType=getSchemaTypeFor(valueType);
          if (valueSchemaType != null) {
            TypeInfo targetInfo=this.typeInfo.get(valueType.getQualifiedName());
            if (targetInfo != null) {
              Schema valueElementSchema=this.getSchemaForNamespace(valueSchemaType.getNamespaceURI());
              addImportIfRequired(schema,valueElementSchema,valueSchemaType.getNamespaceURI());
            }
            String prefix;
            if (valueSchemaType.getNamespaceURI().equals(XMLConstants.SCHEMA_URL)) {
              prefix=XMLConstants.SCHEMA_PREFIX;
            }
 else {
              prefix=getPrefixForNamespace(valueSchemaType.getNamespaceURI(),schema.getNamespaceResolver());
            }
            if (prefix != null && !prefix.equals("String_Node_Str")) {
              typeName=prefix + "String_Node_Str" + valueSchemaType.getLocalPart();
            }
 else {
              typeName=valueSchemaType.getLocalPart();
            }
            valueElement.setType(typeName);
          }
          entrySequence.addElement(valueElement);
          entryComplexType.setSequence(entrySequence);
          JavaClass descriptorClass=helper.getJavaClass(ownerTypeInfo.getDescriptor().getJavaClassName());
          JavaClass mapValueClass=helper.getJavaClass(MapValue.class);
          if (mapValueClass.isAssignableFrom(descriptorClass)) {
            element.setComplexType(entryComplexType);
            element.setMaxOccurs(Occurs.UNBOUNDED);
          }
 else {
            ComplexType complexType=new ComplexType();
            Sequence sequence=new Sequence();
            complexType.setSequence(sequence);
            Element entryElement=new Element();
            entryElement.setName("String_Node_Str");
            entryElement.setMinOccurs(Occurs.ZERO);
            entryElement.setMaxOccurs(Occurs.UNBOUNDED);
            sequence.addElement(entryElement);
            entryElement.setComplexType(entryComplexType);
            element.setComplexType(complexType);
          }
        }
 else {
          element.setType(typeName);
        }
        String lookupNamespace=schema.getTargetNamespace();
        if (lookupNamespace == null) {
          lookupNamespace="String_Node_Str";
        }
        NamespaceInfo namespaceInfo=getNamespaceInfoForNamespace(lookupNamespace);
        boolean isElementFormQualified=false;
        if (namespaceInfo != null) {
          isElementFormQualified=namespaceInfo.isElementFormQualified();
        }
        if ((isElementFormQualified && !elementName.getNamespaceURI().equals(lookupNamespace)) || (!isElementFormQualified && !elementName.getNamespaceURI().equals("String_Node_Str"))) {
          Element reference=new Element();
          reference.setMinOccurs(element.getMinOccurs());
          reference.setMaxOccurs(element.getMaxOccurs());
          Schema attributeSchema=this.getSchemaForNamespace(elementName.getNamespaceURI());
          if (attributeSchema != null && attributeSchema.getTopLevelElements().get(element.getName()) == null) {
            element.setMinOccurs(null);
            element.setMaxOccurs(null);
            attributeSchema.getTopLevelElements().put(element.getName(),element);
          }
          addImportIfRequired(schema,attributeSchema,elementName.getNamespaceURI());
          String prefix=getPrefixForNamespace(elementName.getNamespaceURI(),schema.getNamespaceResolver());
          if (prefix == null) {
            reference.setRef(element.getName());
          }
 else {
            reference.setRef(prefix + "String_Node_Str" + element.getName());
          }
          parentCompositor.addElement(reference);
        }
 else {
          parentCompositor.addElement(element);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void addToSchemaType(TypeInfo ownerTypeInfo,java.util.List<Property> properties,TypeDefParticle compositor,ComplexType type,Schema schema){
  Property xmlValueProperty=ownerTypeInfo.getXmlValueProperty();
  for (  Property next : properties) {
    if (next == null) {
      continue;
    }
    TypeDefParticle parentCompositor=compositor;
    boolean isChoice=(parentCompositor instanceof Choice);
    ComplexType parentType=type;
    if (!helper.isAnnotationPresent(next.getElement(),XmlTransient.class)) {
      if (!isChoice && next.isSetXmlElementWrapper()) {
        XmlElementWrapper wrapper=next.getXmlElementWrapper();
        Element wrapperElement=new Element();
        String name=wrapper.getName();
        if (name.equals("String_Node_Str")) {
          name=next.getPropertyName();
        }
        wrapperElement.setNillable(wrapper.isNillable());
        String wrapperNS=wrapper.getNamespace();
        if (!wrapperNS.equals("String_Node_Str") && !wrapperNS.equals(schema.getTargetNamespace())) {
          wrapperElement.setMinOccurs(Occurs.ONE);
          wrapperElement.setMaxOccurs(Occurs.ONE);
          String prefix=getOrGeneratePrefixForNamespace(wrapperNS,schema);
          wrapperElement.setRef(prefix + "String_Node_Str" + name);
          compositor.addElement(wrapperElement);
          continue;
        }
 else {
          wrapperElement.setName(name);
          if (wrapper.isRequired()) {
            wrapperElement.setMinOccurs(Occurs.ONE);
          }
 else {
            wrapperElement.setMinOccurs(Occurs.ZERO);
          }
          compositor.addElement(wrapperElement);
          ComplexType wrapperType=new ComplexType();
          Sequence wrapperSequence=new Sequence();
          wrapperType.setSequence(wrapperSequence);
          wrapperElement.setComplexType(wrapperType);
          parentType=wrapperType;
          parentCompositor=wrapperSequence;
        }
      }
      if (next.isAttribute() && !next.isAnyAttribute()) {
        Attribute attribute=new Attribute();
        QName attributeName=next.getSchemaName();
        attribute.setName(attributeName.getLocalPart());
        if (next.isRequired()) {
          attribute.setUse(Attribute.REQUIRED);
        }
        JavaClass javaType=next.getType();
        if (next.getGenericType() != null) {
          javaType=(JavaClass)next.getGenericType();
        }
        TypeInfo info=(TypeInfo)typeInfo.get(next.getType().getQualifiedName());
        String typeName=null;
        if (next.isXmlId()) {
          typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
        }
 else         if (next.isXmlIdRef()) {
          typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
        }
 else         if (info != null && !info.isComplexType()) {
          typeName=info.getSimpleType().getName();
        }
 else {
          QName schemaType=next.getSchemaType();
          if (schemaType == null) {
            schemaType=getSchemaTypeFor(javaType);
          }
          if (schemaType != null) {
            if (schemaType.getNamespaceURI() == null) {
              typeName=schemaType.getLocalPart();
            }
 else {
              String prefix=getOrGeneratePrefixForNamespace(schemaType.getNamespaceURI(),schema);
              typeName=prefix + "String_Node_Str" + schemaType.getLocalPart();
            }
          }
 else {
            typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
          }
        }
        if (isCollectionType(next)) {
          SimpleType localType=new SimpleType();
          org.eclipse.persistence.internal.oxm.schema.model.List list=new org.eclipse.persistence.internal.oxm.schema.model.List();
          list.setItemType(typeName);
          localType.setList(list);
          attribute.setSimpleType(localType);
        }
 else {
          if (typeName != null && !typeName.contains("String_Node_Str")) {
            if (info.getSchema() == schema) {
              String prefix=getPrefixForNamespace(schema.getTargetNamespace(),schema.getNamespaceResolver());
              if (prefix != null) {
                typeName=prefix + "String_Node_Str" + typeName;
              }
            }
          }
          attribute.setType(typeName);
        }
        String lookupNamespace=schema.getTargetNamespace();
        if (lookupNamespace == null) {
          lookupNamespace="String_Node_Str";
        }
        NamespaceInfo namespaceInfo=getNamespaceInfoForNamespace(lookupNamespace);
        boolean isAttributeFormQualified=true;
        if (namespaceInfo != null) {
          isAttributeFormQualified=namespaceInfo.isAttributeFormQualified();
        }
        if ((isAttributeFormQualified && !attributeName.getNamespaceURI().equals(lookupNamespace)) || (!namespaceInfo.isAttributeFormQualified() && !attributeName.getNamespaceURI().equals("String_Node_Str"))) {
          Schema attributeSchema=this.getSchemaForNamespace(attributeName.getNamespaceURI());
          if (attributeSchema != null && attributeSchema.getTopLevelAttributes().get(attribute.getName()) == null) {
            attributeSchema.getTopLevelAttributes().put(attribute.getName(),attribute);
          }
          addImportIfRequired(schema,attributeSchema,attributeName.getNamespaceURI());
          Attribute reference=new Attribute();
          String prefix=getPrefixForNamespace(attributeName.getNamespaceURI(),schema.getNamespaceResolver());
          if (prefix == null) {
            reference.setRef(attribute.getName());
          }
 else {
            reference.setRef(prefix + "String_Node_Str" + attribute.getName());
          }
          if (parentType.getSimpleContent() != null) {
            parentType.getSimpleContent().getExtension().getOrderedAttributes().add(reference);
          }
 else {
            parentType.getOrderedAttributes().add(reference);
          }
        }
 else {
          if (parentType.getSimpleContent() != null) {
            parentType.getSimpleContent().getExtension().getOrderedAttributes().add(attribute);
          }
 else           if (parentType.getComplexContent() != null) {
            parentType.getComplexContent().getExtension().getOrderedAttributes().add(attribute);
          }
 else {
            parentType.getOrderedAttributes().add(attribute);
          }
        }
      }
 else       if (next.isAnyAttribute()) {
        AnyAttribute anyAttribute=new AnyAttribute();
        anyAttribute.setProcessContents("String_Node_Str");
        anyAttribute.setNamespace("String_Node_Str");
        if (type.getSimpleContent() != null) {
          SimpleContent content=type.getSimpleContent();
          content.getRestriction().setAnyAttribute(anyAttribute);
        }
 else {
          type.setAnyAttribute(anyAttribute);
        }
      }
 else       if (next.isChoice()) {
        Choice choice=new Choice();
        ArrayList<Property> choiceProperties=(ArrayList<Property>)((ChoiceProperty)next).getChoiceProperties();
        addToSchemaType(ownerTypeInfo,choiceProperties,choice,parentType,schema);
        if (next.getGenericType() != null) {
          choice.setMaxOccurs(Occurs.UNBOUNDED);
        }
        if (parentCompositor instanceof Sequence) {
          ((Sequence)parentCompositor).addChoice(choice);
        }
 else         if (parentCompositor instanceof Choice) {
          ((Choice)parentCompositor).addChoice(choice);
        }
      }
 else       if (next.isAny()) {
        Any any=new Any();
        any.setNamespace("String_Node_Str");
        if (next.isLax()) {
          any.setProcessContents(Any.LAX);
        }
 else {
          any.setProcessContents("String_Node_Str");
        }
        if (isCollectionType(next)) {
          any.setMinOccurs(Occurs.ZERO);
          any.setMaxOccurs(Occurs.UNBOUNDED);
        }
        if (parentCompositor instanceof Sequence) {
          ((Sequence)parentCompositor).addAny(any);
        }
 else         if (parentCompositor instanceof Choice) {
          ((Choice)parentCompositor).addAny(any);
        }
      }
 else       if (next.isReference()) {
        ReferenceProperty refProp=(ReferenceProperty)next;
        java.util.List<ElementDeclaration> referencedElements=refProp.getReferencedElements();
        if (referencedElements.size() == 1) {
          Element element=new Element();
          ElementDeclaration decl=referencedElements.get(0);
          String localName=decl.getElementName().getLocalPart();
          Schema referencedSchema=this.getSchemaForNamespace(decl.getElementName().getNamespaceURI());
          addImportIfRequired(schema,referencedSchema,decl.getElementName().getNamespaceURI());
          String prefix=this.getPrefixForNamespace(decl.getElementName().getNamespaceURI(),schema.getNamespaceResolver());
          if (prefix == null || prefix.equals("String_Node_Str")) {
            element.setRef(localName);
          }
 else {
            element.setRef(prefix + "String_Node_Str" + localName);
          }
          if (next.getGenericType() != null) {
            element.setMinOccurs(Occurs.ZERO);
            element.setMaxOccurs(Occurs.UNBOUNDED);
          }
          parentCompositor.addElement(element);
        }
 else {
          Choice choice=new Choice();
          if (next.getGenericType() != null) {
            choice.setMaxOccurs(Occurs.UNBOUNDED);
          }
          for (          ElementDeclaration elementDecl : referencedElements) {
            Element element=new Element();
            String localName=elementDecl.getElementName().getLocalPart();
            Schema referencedSchema=this.getSchemaForNamespace(elementDecl.getElementName().getNamespaceURI());
            addImportIfRequired(schema,referencedSchema,elementDecl.getElementName().getNamespaceURI());
            String prefix=this.getPrefixForNamespace(elementDecl.getElementName().getNamespaceURI(),schema.getNamespaceResolver());
            if (prefix == null || prefix.equals("String_Node_Str")) {
              element.setRef(localName);
            }
 else {
              element.setRef(prefix + "String_Node_Str" + localName);
            }
            choice.addElement(element);
          }
          if (parentCompositor instanceof Sequence) {
            ((Sequence)parentCompositor).addChoice(choice);
          }
 else           if (parentCompositor instanceof Choice) {
            ((Choice)parentCompositor).addChoice(choice);
          }
        }
      }
 else       if (!(xmlValueProperty != null && xmlValueProperty == next)) {
        Element element=new Element();
        if (!(parentCompositor instanceof All)) {
          element.setMinOccurs(next.isRequired() ? Occurs.ONE : Occurs.ZERO);
        }
        element.setNillable(next.isNillable());
        if (next.isSetDefaultValue()) {
          element.setDefaultValue(next.getDefaultValue());
        }
        if (next.getMimeType() != null) {
          element.getAttributesMap().put(XMLConstants.EXPECTED_CONTENT_TYPES_QNAME,next.getMimeType());
        }
        QName elementName=next.getSchemaName();
        JavaClass javaType=next.getActualType();
        boolean isComplexType=false;
        element.setName(elementName.getLocalPart());
        String typeName=null;
        if (next.isXmlId()) {
          typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
        }
 else         if (next.isXmlIdRef()) {
          typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
        }
 else {
          TypeInfo info=(TypeInfo)typeInfo.get(javaType.getQualifiedName());
          if (info != null) {
            isComplexType=info.isComplexType();
            if (isComplexType) {
              typeName=info.getComplexType().getName();
            }
 else             if (info.getSimpleType() != null) {
              typeName=info.getSimpleType().getName();
            }
 else {
              typeName=info.getSchemaTypeName();
            }
            if (typeName == null) {
              if (!info.hasRootElement()) {
                if (info.isComplexType()) {
                  element.setComplexType(info.getComplexType());
                }
 else {
                  element.setSimpleType(info.getSimpleType());
                }
              }
            }
            if (addImportIfRequired(schema,info.getSchema(),info.getClassNamespace())) {
              String prefix=schema.getNamespaceResolver().resolveNamespaceURI(info.getClassNamespace());
              if (prefix != null && !typeName.equals("String_Node_Str")) {
                typeName=prefix + "String_Node_Str" + typeName;
              }
            }
          }
 else           if (!next.isMap()) {
            QName schemaType=next.getSchemaType();
            if (schemaType == null) {
              schemaType=getSchemaTypeFor(javaType);
            }
            if (schemaType != null) {
              if (schemaType.getNamespaceURI() == null) {
                typeName=schemaType.getLocalPart();
              }
 else {
                String prefix=getOrGeneratePrefixForNamespace(schemaType.getNamespaceURI(),schema);
                typeName=prefix + "String_Node_Str" + schemaType.getLocalPart();
              }
            }
          }
          if (typeName != null && !typeName.contains("String_Node_Str")) {
            String prefix=getPrefixForNamespace(info.getSchema().getTargetNamespace(),schema.getNamespaceResolver());
            if (prefix != null) {
              typeName=prefix + "String_Node_Str" + typeName;
            }
          }
        }
        if (next.getGenericType() != null) {
          if (next.isXmlList()) {
            SimpleType localSimpleType=new SimpleType();
            org.eclipse.persistence.internal.oxm.schema.model.List list=new org.eclipse.persistence.internal.oxm.schema.model.List();
            list.setItemType(typeName);
            localSimpleType.setList(list);
            element.setSimpleType(localSimpleType);
          }
 else {
            element.setMaxOccurs(Occurs.UNBOUNDED);
            element.setType(typeName);
          }
        }
 else         if (next.isMap()) {
          ComplexType entryComplexType=new ComplexType();
          Sequence entrySequence=new Sequence();
          Element keyElement=new Element();
          keyElement.setName(Property.DEFAULT_KEY_NAME);
          keyElement.setMinOccurs(Occurs.ZERO);
          JavaClass keyType=next.getKeyType();
          JavaClass valueType=next.getValueType();
          if (keyType == null) {
            keyType=helper.getJavaClass(Object.class);
          }
          if (valueType == null) {
            valueType=helper.getJavaClass(Object.class);
          }
          QName keySchemaType=getSchemaTypeFor(keyType);
          if (keySchemaType != null) {
            TypeInfo targetInfo=this.typeInfo.get(keyType.getQualifiedName());
            if (targetInfo != null) {
              Schema keyElementSchema=this.getSchemaForNamespace(keySchemaType.getNamespaceURI());
              addImportIfRequired(schema,keyElementSchema,keySchemaType.getNamespaceURI());
            }
            String prefix;
            if (keySchemaType.getNamespaceURI().equals(XMLConstants.SCHEMA_URL)) {
              prefix=XMLConstants.SCHEMA_PREFIX;
            }
 else {
              prefix=getPrefixForNamespace(keySchemaType.getNamespaceURI(),schema.getNamespaceResolver());
            }
            if (prefix != null && !prefix.equals("String_Node_Str")) {
              typeName=prefix + "String_Node_Str" + keySchemaType.getLocalPart();
            }
 else {
              typeName=keySchemaType.getLocalPart();
            }
            keyElement.setType(typeName);
          }
          entrySequence.addElement(keyElement);
          Element valueElement=new Element();
          valueElement.setName(Property.DEFAULT_VALUE_NAME);
          valueElement.setMinOccurs(Occurs.ZERO);
          QName valueSchemaType=getSchemaTypeFor(valueType);
          if (valueSchemaType != null) {
            TypeInfo targetInfo=this.typeInfo.get(valueType.getQualifiedName());
            if (targetInfo != null) {
              Schema valueElementSchema=this.getSchemaForNamespace(valueSchemaType.getNamespaceURI());
              addImportIfRequired(schema,valueElementSchema,valueSchemaType.getNamespaceURI());
            }
            String prefix;
            if (valueSchemaType.getNamespaceURI().equals(XMLConstants.SCHEMA_URL)) {
              prefix=XMLConstants.SCHEMA_PREFIX;
            }
 else {
              prefix=getPrefixForNamespace(valueSchemaType.getNamespaceURI(),schema.getNamespaceResolver());
            }
            if (prefix != null && !prefix.equals("String_Node_Str")) {
              typeName=prefix + "String_Node_Str" + valueSchemaType.getLocalPart();
            }
 else {
              typeName=valueSchemaType.getLocalPart();
            }
            valueElement.setType(typeName);
          }
          entrySequence.addElement(valueElement);
          entryComplexType.setSequence(entrySequence);
          JavaClass descriptorClass=helper.getJavaClass(ownerTypeInfo.getDescriptor().getJavaClassName());
          JavaClass mapValueClass=helper.getJavaClass(MapValue.class);
          if (mapValueClass.isAssignableFrom(descriptorClass)) {
            element.setComplexType(entryComplexType);
            element.setMaxOccurs(Occurs.UNBOUNDED);
          }
 else {
            ComplexType complexType=new ComplexType();
            Sequence sequence=new Sequence();
            complexType.setSequence(sequence);
            Element entryElement=new Element();
            entryElement.setName("String_Node_Str");
            entryElement.setMinOccurs(Occurs.ZERO);
            entryElement.setMaxOccurs(Occurs.UNBOUNDED);
            sequence.addElement(entryElement);
            entryElement.setComplexType(entryComplexType);
            element.setComplexType(complexType);
          }
        }
 else {
          element.setType(typeName);
        }
        String lookupNamespace=schema.getTargetNamespace();
        if (lookupNamespace == null) {
          lookupNamespace="String_Node_Str";
        }
        NamespaceInfo namespaceInfo=getNamespaceInfoForNamespace(lookupNamespace);
        boolean isElementFormQualified=false;
        if (namespaceInfo != null) {
          isElementFormQualified=namespaceInfo.isElementFormQualified();
        }
        if ((isElementFormQualified && !elementName.getNamespaceURI().equals(lookupNamespace)) || (!isElementFormQualified && !elementName.getNamespaceURI().equals("String_Node_Str"))) {
          Element reference=new Element();
          reference.setMinOccurs(element.getMinOccurs());
          reference.setMaxOccurs(element.getMaxOccurs());
          Schema attributeSchema=this.getSchemaForNamespace(elementName.getNamespaceURI());
          if (attributeSchema != null && attributeSchema.getTopLevelElements().get(element.getName()) == null) {
            element.setMinOccurs(null);
            element.setMaxOccurs(null);
            attributeSchema.getTopLevelElements().put(element.getName(),element);
          }
          addImportIfRequired(schema,attributeSchema,elementName.getNamespaceURI());
          String prefix=getPrefixForNamespace(elementName.getNamespaceURI(),schema.getNamespaceResolver());
          if (prefix == null) {
            reference.setRef(element.getName());
          }
 else {
            reference.setRef(prefix + "String_Node_Str" + element.getName());
          }
          parentCompositor.addElement(reference);
        }
 else {
          parentCompositor.addElement(element);
        }
      }
    }
  }
}