Program: 67679
Project: 67679
Buggy source:
public void addToSchemaType(ArrayList<Property> properties,TypeDefParticle compositor,ComplexType type,Schema schema){
  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 && helper.isAnnotationPresent(next.getElement(),XmlElementWrapper.class)) {
        XmlElementWrapper wrapper=(XmlElementWrapper)helper.getAnnotation(next.getElement(),XmlElementWrapper.class);
        Element wrapperElement=new Element();
        String name=wrapper.name();
        if (name.equals("String_Node_Str")) {
          name=next.getPropertyName();
        }
        wrapperElement.setName(name);
        wrapperElement.setMinOccurs("String_Node_Str");
        compositor.addElement(wrapperElement);
        ComplexType wrapperType=new ComplexType();
        Sequence wrapperSequence=new Sequence();
        wrapperType.setSequence(wrapperSequence);
        wrapperElement.setComplexType(wrapperType);
        parentType=wrapperType;
        parentCompositor=wrapperSequence;
      }
      if (helper.isAnnotationPresent(next.getElement(),XmlAttribute.class)) {
        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();
        }
        String typeName=null;
        TypeInfo info=(TypeInfo)typeInfo.get(next.getType().getQualifiedName());
        if (info != null) {
          if (!info.isComplexType()) {
            typeName=info.getSimpleType().getName();
          }
        }
 else {
          if (helper.isAnnotationPresent(next.getElement(),XmlID.class)) {
            typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
          }
 else           if (helper.isAnnotationPresent(next.getElement(),XmlIDREF.class)) {
            typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
          }
 else {
            QName schemaType=next.getSchemaType();
            if (schemaType == null) {
              schemaType=getSchemaTypeFor(javaType);
            }
            if (schemaType != null) {
              typeName=XMLConstants.SCHEMA_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.isAttributeFormQualified() && !attributeName.getNamespaceURI().equals(lookupNamespace)) || (!namespaceInfo.isAttributeFormQualified() && !attributeName.getNamespaceURI().equals("String_Node_Str"))) {
          Schema attributeSchema=this.getSchemaForNamespace(attributeName.getNamespaceURI());
          if (attributeSchema.getTopLevelAttributes().get(attribute.getName()) == null) {
            attributeSchema.getTopLevelAttributes().put(attribute.getName(),attribute);
          }
          if (attributeSchema != schema) {
            if (!importExists(schema,attributeSchema.getName())) {
              Import schemaImport=new Import();
              schemaImport.setNamespace(attributeSchema.getTargetNamespace());
              schemaImport.setSchemaLocation(attributeSchema.getName());
              schema.getImports().add(schemaImport);
              schema.getNamespaceResolver().put(schema.getNamespaceResolver().generatePrefix(),attributeSchema.getTargetNamespace());
            }
          }
          Attribute reference=new Attribute();
          String prefix=getPrefixForNamespace(attributeSchema.getTargetNamespace(),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 (helper.isAnnotationPresent(next.getElement(),XmlAnyAttribute.class)) {
        AnyAttribute anyAttribute=new AnyAttribute();
        anyAttribute.setProcessContents(AnyAttribute.LAX);
        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(choiceProperties,choice,parentType,schema);
        if (isCollectionType(next)) {
          choice.setMaxOccurs("String_Node_Str");
        }
        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();
        AnyProperty anyProp=(AnyProperty)next;
        if (anyProp.isLax()) {
          any.setProcessContents("String_Node_Str");
        }
        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());
          if (referencedSchema != schema) {
            if (!importExists(schema,referencedSchema.getName())) {
              Import schemaImport=new Import();
              schemaImport.setSchemaLocation(referencedSchema.getName());
              schemaImport.setNamespace(referencedSchema.getTargetNamespace());
              schema.getImports().add(schemaImport);
              if (schemaImport.getNamespace() != null) {
                schema.getNamespaceResolver().put(schema.getNamespaceResolver().generatePrefix(),schemaImport.getNamespace());
              }
            }
          }
          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 (isCollectionType(next)) {
            element.setMaxOccurs("String_Node_Str");
          }
          parentCompositor.addElement(element);
        }
 else {
          Choice choice=new Choice();
          if (isCollectionType(next)) {
            choice.setMaxOccurs("String_Node_Str");
          }
          for (          ElementDeclaration elementDecl : referencedElements) {
            Element element=new Element();
            String localName=elementDecl.getElementName().getLocalPart();
            Schema referencedSchema=this.getSchemaForNamespace(elementDecl.getElementName().getNamespaceURI());
            if (referencedSchema != schema) {
              if (!importExists(schema,referencedSchema.getName())) {
                Import schemaImport=new Import();
                schemaImport.setSchemaLocation(referencedSchema.getName());
                schemaImport.setNamespace(referencedSchema.getTargetNamespace());
                schema.getImports().add(schemaImport);
                if (schemaImport.getNamespace() != null) {
                  schema.getNamespaceResolver().put(schema.getNamespaceResolver().generatePrefix(),schemaImport.getNamespace());
                }
              }
            }
            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 (!helper.isAnnotationPresent(next.getElement(),XmlValue.class)) {
        Element element=new Element();
        element.setMinOccurs(next.isRequired() ? "String_Node_Str" : "String_Node_Str");
        QName elementName=next.getSchemaName();
        JavaClass javaType=next.getType();
        boolean isCollectionType=isCollectionType(next);
        if (isCollectionType) {
          JavaClass gType=next.getGenericType();
          if (gType != null && javaType.hasActualTypeArguments()) {
            Object[] params=javaType.getActualTypeArguments().toArray();
            javaType=(JavaClass)params[0];
          }
        }
        element.setName(elementName.getLocalPart());
        TypeInfo info=(TypeInfo)typeInfo.get(javaType.getQualifiedName());
        String typeName=null;
        boolean isComplexType=false;
        if (info != null) {
          if (helper.isAnnotationPresent(next.getElement(),XmlID.class)) {
            typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
          }
 else           if (helper.isAnnotationPresent(next.getElement(),XmlIDREF.class)) {
            typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
          }
 else {
            isComplexType=info.isComplexType();
            if (info.isComplexType()) {
              typeName=info.getComplexType().getName();
            }
 else {
              typeName=info.getSimpleType().getName();
            }
          }
          if (typeName == null) {
            if (!info.hasRootElement()) {
              if (info.isComplexType()) {
                element.setComplexType(info.getComplexType());
              }
 else {
                element.setSimpleType(info.getSimpleType());
              }
            }
          }
          if (info.getSchema() != schema) {
            if (!importExists(schema,info.getSchema().getName())) {
              Import schemaImport=new Import();
              schemaImport.setSchemaLocation(info.getSchema().getName());
              schemaImport.setNamespace(info.getSchema().getTargetNamespace());
              schema.getImports().add(schemaImport);
              if (schemaImport.getNamespace() != null) {
                schema.getNamespaceResolver().put(schema.getNamespaceResolver().generatePrefix(),schemaImport.getNamespace());
              }
              String prefix=getPrefixForNamespace(info.getSchema().getTargetNamespace(),schema.getNamespaceResolver());
              if (prefix != null && !typeName.equals("String_Node_Str")) {
                typeName=prefix + "String_Node_Str" + typeName;
              }
            }
          }
        }
 else {
          QName schemaType=next.getSchemaType();
          if (schemaType == null) {
            schemaType=getSchemaTypeFor(javaType);
          }
          if (schemaType != null) {
            typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str" + schemaType.getLocalPart();
          }
        }
        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;
            }
          }
        }
        if (isCollectionType) {
          if (helper.isAnnotationPresent(next.getElement(),XmlList.class)) {
            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("String_Node_Str");
            element.setType(typeName);
          }
        }
 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.getTopLevelElements().get(element.getName()) == null) {
            element.setMinOccurs(null);
            element.setMaxOccurs(null);
            attributeSchema.getTopLevelElements().put(element.getName(),element);
          }
          if (attributeSchema != schema && (!importExists(schema,attributeSchema.getName()))) {
            Import schemaImport=new Import();
            schemaImport.setNamespace(attributeSchema.getTargetNamespace());
            schemaImport.setSchemaLocation(attributeSchema.getName());
            schema.getImports().add(schemaImport);
            schema.getNamespaceResolver().put(schema.getNamespaceResolver().generatePrefix(),attributeSchema.getTargetNamespace());
          }
          String prefix=getPrefixForNamespace(attributeSchema.getTargetNamespace(),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(ArrayList<Property> properties,TypeDefParticle compositor,ComplexType type,Schema schema){
  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 && helper.isAnnotationPresent(next.getElement(),XmlElementWrapper.class)) {
        XmlElementWrapper wrapper=(XmlElementWrapper)helper.getAnnotation(next.getElement(),XmlElementWrapper.class);
        Element wrapperElement=new Element();
        String name=wrapper.name();
        if (name.equals("String_Node_Str")) {
          name=next.getPropertyName();
        }
        wrapperElement.setName(name);
        wrapperElement.setMinOccurs("String_Node_Str");
        compositor.addElement(wrapperElement);
        ComplexType wrapperType=new ComplexType();
        Sequence wrapperSequence=new Sequence();
        wrapperType.setSequence(wrapperSequence);
        wrapperElement.setComplexType(wrapperType);
        parentType=wrapperType;
        parentCompositor=wrapperSequence;
      }
      if (helper.isAnnotationPresent(next.getElement(),XmlAttribute.class)) {
        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();
        }
        String typeName=null;
        TypeInfo info=(TypeInfo)typeInfo.get(next.getType().getQualifiedName());
        if (info != null) {
          if (!info.isComplexType()) {
            typeName=info.getSimpleType().getName();
          }
        }
 else {
          if (helper.isAnnotationPresent(next.getElement(),XmlID.class)) {
            typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
          }
 else           if (helper.isAnnotationPresent(next.getElement(),XmlIDREF.class)) {
            typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
          }
 else {
            QName schemaType=next.getSchemaType();
            if (schemaType == null) {
              schemaType=getSchemaTypeFor(javaType);
            }
            if (schemaType != null) {
              typeName=XMLConstants.SCHEMA_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.isAttributeFormQualified() && !attributeName.getNamespaceURI().equals(lookupNamespace)) || (!namespaceInfo.isAttributeFormQualified() && !attributeName.getNamespaceURI().equals("String_Node_Str"))) {
          Schema attributeSchema=this.getSchemaForNamespace(attributeName.getNamespaceURI());
          if (attributeSchema.getTopLevelAttributes().get(attribute.getName()) == null) {
            attributeSchema.getTopLevelAttributes().put(attribute.getName(),attribute);
          }
          if (attributeSchema != schema) {
            if (!importExists(schema,attributeSchema.getName())) {
              Import schemaImport=new Import();
              schemaImport.setNamespace(attributeSchema.getTargetNamespace());
              schemaImport.setSchemaLocation(attributeSchema.getName());
              schema.getImports().add(schemaImport);
              schema.getNamespaceResolver().put(schema.getNamespaceResolver().generatePrefix(),attributeSchema.getTargetNamespace());
            }
          }
          Attribute reference=new Attribute();
          String prefix=getPrefixForNamespace(attributeSchema.getTargetNamespace(),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 (helper.isAnnotationPresent(next.getElement(),XmlAnyAttribute.class)) {
        AnyAttribute anyAttribute=new AnyAttribute();
        anyAttribute.setProcessContents(AnyAttribute.LAX);
        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(choiceProperties,choice,parentType,schema);
        if (isCollectionType(next)) {
          choice.setMaxOccurs("String_Node_Str");
        }
        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");
        AnyProperty anyProp=(AnyProperty)next;
        if (anyProp.isLax()) {
          any.setProcessContents(Any.LAX);
        }
 else {
          any.setProcessContents("String_Node_Str");
        }
        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());
          if (referencedSchema != schema) {
            if (!importExists(schema,referencedSchema.getName())) {
              Import schemaImport=new Import();
              schemaImport.setSchemaLocation(referencedSchema.getName());
              schemaImport.setNamespace(referencedSchema.getTargetNamespace());
              schema.getImports().add(schemaImport);
              if (schemaImport.getNamespace() != null) {
                schema.getNamespaceResolver().put(schema.getNamespaceResolver().generatePrefix(),schemaImport.getNamespace());
              }
            }
          }
          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 (isCollectionType(next)) {
            element.setMaxOccurs("String_Node_Str");
          }
          parentCompositor.addElement(element);
        }
 else {
          Choice choice=new Choice();
          if (isCollectionType(next)) {
            choice.setMaxOccurs("String_Node_Str");
          }
          for (          ElementDeclaration elementDecl : referencedElements) {
            Element element=new Element();
            String localName=elementDecl.getElementName().getLocalPart();
            Schema referencedSchema=this.getSchemaForNamespace(elementDecl.getElementName().getNamespaceURI());
            if (referencedSchema != schema) {
              if (!importExists(schema,referencedSchema.getName())) {
                Import schemaImport=new Import();
                schemaImport.setSchemaLocation(referencedSchema.getName());
                schemaImport.setNamespace(referencedSchema.getTargetNamespace());
                schema.getImports().add(schemaImport);
                if (schemaImport.getNamespace() != null) {
                  schema.getNamespaceResolver().put(schema.getNamespaceResolver().generatePrefix(),schemaImport.getNamespace());
                }
              }
            }
            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 (!helper.isAnnotationPresent(next.getElement(),XmlValue.class)) {
        Element element=new Element();
        element.setMinOccurs(next.isRequired() ? "String_Node_Str" : "String_Node_Str");
        QName elementName=next.getSchemaName();
        JavaClass javaType=next.getType();
        boolean isCollectionType=isCollectionType(next);
        if (isCollectionType) {
          JavaClass gType=next.getGenericType();
          if (gType != null && javaType.hasActualTypeArguments()) {
            Object[] params=javaType.getActualTypeArguments().toArray();
            javaType=(JavaClass)params[0];
          }
        }
        element.setName(elementName.getLocalPart());
        TypeInfo info=(TypeInfo)typeInfo.get(javaType.getQualifiedName());
        String typeName=null;
        boolean isComplexType=false;
        if (info != null) {
          if (helper.isAnnotationPresent(next.getElement(),XmlID.class)) {
            typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
          }
 else           if (helper.isAnnotationPresent(next.getElement(),XmlIDREF.class)) {
            typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str";
          }
 else {
            isComplexType=info.isComplexType();
            if (info.isComplexType()) {
              typeName=info.getComplexType().getName();
            }
 else {
              typeName=info.getSimpleType().getName();
            }
          }
          if (typeName == null) {
            if (!info.hasRootElement()) {
              if (info.isComplexType()) {
                element.setComplexType(info.getComplexType());
              }
 else {
                element.setSimpleType(info.getSimpleType());
              }
            }
          }
          if (info.getSchema() != schema) {
            if (!importExists(schema,info.getSchema().getName())) {
              Import schemaImport=new Import();
              schemaImport.setSchemaLocation(info.getSchema().getName());
              schemaImport.setNamespace(info.getSchema().getTargetNamespace());
              schema.getImports().add(schemaImport);
              if (schemaImport.getNamespace() != null) {
                schema.getNamespaceResolver().put(schema.getNamespaceResolver().generatePrefix(),schemaImport.getNamespace());
              }
              String prefix=getPrefixForNamespace(info.getSchema().getTargetNamespace(),schema.getNamespaceResolver());
              if (prefix != null && !typeName.equals("String_Node_Str")) {
                typeName=prefix + "String_Node_Str" + typeName;
              }
            }
          }
        }
 else {
          QName schemaType=next.getSchemaType();
          if (schemaType == null) {
            schemaType=getSchemaTypeFor(javaType);
          }
          if (schemaType != null) {
            typeName=XMLConstants.SCHEMA_PREFIX + "String_Node_Str" + schemaType.getLocalPart();
          }
        }
        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;
            }
          }
        }
        if (isCollectionType) {
          if (helper.isAnnotationPresent(next.getElement(),XmlList.class)) {
            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("String_Node_Str");
            element.setType(typeName);
          }
        }
 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.getTopLevelElements().get(element.getName()) == null) {
            element.setMinOccurs(null);
            element.setMaxOccurs(null);
            attributeSchema.getTopLevelElements().put(element.getName(),element);
          }
          if (attributeSchema != schema && (!importExists(schema,attributeSchema.getName()))) {
            Import schemaImport=new Import();
            schemaImport.setNamespace(attributeSchema.getTargetNamespace());
            schemaImport.setSchemaLocation(attributeSchema.getName());
            schema.getImports().add(schemaImport);
            schema.getNamespaceResolver().put(schema.getNamespaceResolver().generatePrefix(),attributeSchema.getTargetNamespace());
          }
          String prefix=getPrefixForNamespace(attributeSchema.getTargetNamespace(),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);
        }
      }
    }
  }
}