nextDecl);
arrayVisitor.visit(nextDecl);
} else {
CorbaTypeImpl nextCorbaType = null;
XmlSchemaType nextSchemaType = null;
CorbaTypeImpl oldCorbaType = getCorbaType();
QName newQname = new QName(getCorbaType().getQName().getNamespaceURI(), newScope.toString());
if (oldCorbaType instanceof Alias) {
// Alias
//
nextSchemaType = duplicateXmlSchemaSimpleType(newScope);
Alias oldAlias = (Alias) oldCorbaType;
Alias alias = new Alias();
alias.setQName(newQname);
alias.setBasetype(oldAlias.getBasetype());
alias.setType(oldAlias.getType());
alias.setRepositoryID(newScope.toIDLRepositoryID());
nextCorbaType = alias;
} else if (oldCorbaType instanceof Sequence) {
// Sequence
//
nextSchemaType = duplicateXmlSchemaComplexType(newScope);
Sequence oldSequence = (Sequence) oldCorbaType;
Sequence newSequence = new Sequence();
newSequence.setQName(newQname);
newSequence.setType(nextSchemaType.getQName());
newSequence.setElemtype(oldSequence.getElemtype());
newSequence.setBound(oldSequence.getBound());
newSequence.setRepositoryID(newScope.toIDLRepositoryID());
nextCorbaType = newSequence;