if (remainingParticles.isEmpty())
if (!remainingParticles.isEmpty())
  protected void handleAnalysis()  {    super.handleAnalysis();    XSDTypeDefinition theBaseTypeDefinition = getBaseTypeDefinition();    XSDComplexTypeContent newContentType = null;    XSDContentTypeCategory newContentTypeCategory = XSDContentTypeCategory.EMPTY_LITERAL;    XSDWildcard localWildcard = getAttributeWildcardContent();    XSDWildcard baseWildcard = null;    if (theBaseTypeDefinition != null && theBaseTypeDefinition.getContainer() != null)    {      ((XSDConcreteComponentImpl)theBaseTypeDefinition).analyze();      if (theBaseTypeDefinition != this)      {        List baseAttributeUses = Collections.EMPTY_LIST;        if (theBaseTypeDefinition instanceof XSDComplexTypeDefinition)        {          baseAttributeUses = ((XSDComplexTypeDefinition)theBaseTypeDefinition).getAttributeUses();        }        EList theAttributeUses = getAttributeUses();        List newAttributeUses = XSDAttributeGroupDefinitionImpl.getAttributeUses(getAttributeContents(), baseAttributeUses);        List remainingAttributeUses = new ArrayList(theAttributeUses);        remainingAttributeUses.removeAll(newAttributeUses);        theAttributeUses.removeAll(remainingAttributeUses);        setListContentAndOrder(theAttributeUses, newAttributeUses);        if (XSDDerivationMethod.EXTENSION_LITERAL == getDerivationMethod() &&               theBaseTypeDefinition instanceof XSDComplexTypeDefinition)        {          baseWildcard = ((XSDComplexTypeDefinition)theBaseTypeDefinition).getAttributeWildcard();        }      }    }    XSDWildcard newAttributeWildcard =       XSDAttributeGroupDefinitionImpl.getAttributeWildcard(baseWildcard, localWildcard, getAttributeContents());    if (newAttributeWildcard != null && newAttributeWildcard.getContainer() == null)    {      if (effectiveWildcard == null)      {        effectiveWildcard = (XSDWildcardImpl)getXSDFactory().createXSDWildcard();        // effectiveWildcard.setOwner(this);        setSyntheticWildcard(effectiveWildcard);      }      effectiveWildcard.setLike(newAttributeWildcard);      newAttributeWildcard = effectiveWildcard;    }    if (newAttributeWildcard != getAttributeWildcard())    {      setAttributeWildcard(newAttributeWildcard);    }    newContentType = getContent();    if (newContentType instanceof XSDSimpleTypeDefinition)    {      newContentTypeCategory = XSDContentTypeCategory.SIMPLE_LITERAL;      if (XSDDerivationMethod.EXTENSION_LITERAL == getDerivationMethod())      {        newContentType = ((XSDSimpleTypeDefinition)newContentType).getBaseTypeDefinition();      }    }    else     {      newContentTypeCategory = isMixed() ? XSDContentTypeCategory.MIXED_LITERAL : XSDContentTypeCategory.ELEMENT_ONLY_LITERAL;      boolean isEmptyContent = isEmptyContent((XSDParticle)newContentType);      if (XSDDerivationMethod.EXTENSION_LITERAL == getDerivationMethod())      {        if (theBaseTypeDefinition instanceof XSDComplexTypeDefinition)        {          XSDComplexTypeDefinition complexBaseTypeDefinition = (XSDComplexTypeDefinition)theBaseTypeDefinition;          if (isEmptyContent)          {            newContentTypeCategory = complexBaseTypeDefinition.getContentTypeCategory();            newContentType = complexBaseTypeDefinition.getContentType();          }          else          {            XSDComplexTypeContent baseContentType = complexBaseTypeDefinition.getContentType();            if (baseContentType instanceof XSDParticle)            {              if (extensionParticle == null)              {                extensionParticle = getXSDFactory().createXSDParticle();                setSyntheticParticle(extensionParticle);                extensionParticle.setMinOccurs(1);                extensionParticle.setMaxOccurs(1);                XSDModelGroup xsdModelGroup = getXSDFactory().createXSDModelGroup();                xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);                extensionParticle.setContent(xsdModelGroup);              }              XSDModelGroup extensionGroup = (XSDModelGroup)extensionParticle.getTerm();              List newParticles = new ArrayList();              newParticles.add(baseContentType);              if (getContent() != null)              {                newParticles.add(getContent());              }              List remainingParticles = new ArrayList(extensionGroup.getParticles());              remainingParticles.removeAll(newParticles);              if (remainingParticles.isEmpty())              {                extensionGroup.getParticles().removeAll(remainingParticles);              }              setListContentAndOrder(extensionGroup.getParticles(), newParticles);                  if (isEmptyContent((XSDParticle)baseContentType))              {                newContentType = getContent();              }              else              {                newContentType = extensionParticle;              }            }          }        }        else if (isEmptyContent)        {          newContentTypeCategory = XSDContentTypeCategory.EMPTY_LITERAL;        }      }      else      {        if (isEmptyContent)        {          newContentTypeCategory = XSDContentTypeCategory.EMPTY_LITERAL;        }      }    }    if (newContentTypeCategory != getContentTypeCategory())    {      setContentTypeCategory(newContentTypeCategory);    }    if (newContentType != getContentType())    {      setContentType(newContentType);    }    if (newAttributeWildcard != getAttributeWildcard())    {      setAttributeWildcard(newAttributeWildcard);    }  }