return Collections.singleton(this);
if (incorporatingSchemas == null) { List visited = new ArrayList(); visited.add(this); incorporatingSchemas = new ArrayList(); incorporatingSchemas.add(this); for (int i = 0; i < visited.size(); ++i) { XSDSchemaImpl xsdSchema = (XSDSchemaImpl)visited.get(i); for (Iterator j = xsdSchema.getReferencingDirectives().iterator(); j.hasNext(); ) { XSDSchemaDirective xsdSchemaDirective = (XSDSchemaDirective)j.next(); if (xsdSchemaDirective instanceof XSDSchemaCompositor && ((XSDSchemaCompositor)xsdSchemaDirective).getIncorporatedSchema() == xsdSchema) { XSDSchema incorporatingSchema = xsdSchemaDirective.getSchema(); if (!visited.contains(incorporatingSchema)) { visited.add(incorporatingSchema); incorporatingSchemas.add(incorporatingSchema); } } } } } return incorporatingSchemas;
  public Collection resolveSchema(String namespace)  {    if ("".equals(namespace))    {      namespace = null;    }    if (namespace == null ? getTargetNamespace() == null || hasRetargetedNamespace() : namespace.equals(getTargetNamespace()))    {      return Collections.singleton(this);    }    else if (XSDConstants.isSchemaInstanceNamespace(namespace))    {      return Collections.singleton(getSchemaInstance(namespace));    }    else    {      Collection result = new ArrayList();      for (Iterator contents = getContents().iterator(); contents.hasNext(); )      {        XSDSchemaContent xsdSchemaContent = (XSDSchemaContent)contents.next();        if (xsdSchemaContent instanceof XSDSchemaDirective)        {          if (xsdSchemaContent instanceof XSDImport)          {            XSDImport xsdImport = (XSDImport)xsdSchemaContent;            String importNamespace = xsdImport.getNamespace();            if (namespace == null ? importNamespace == null : namespace.equals(importNamespace))            {              XSDSchema importedSchema = ((XSDImportImpl)xsdImport).importSchema();              if (importedSchema != null)              {                result.add(importedSchema);              }            }          }        }        else if (!(xsdSchemaContent instanceof XSDAnnotation))        {          break;        }      }      return result;    }  }