if (repl != type && s_logger.isDebugEnabled()) {
s_logger.debug("Replacing type " + type + " with type " + repl + " in component " +
SchemaUtils.describeComponent(getComponent()));
}
while (repl != null) {
CommonTypeDefinition def = vctx.findType(repl);
if (def == null) {
// try substituting the original namespace, to work with no-namespace schemas
if (repl.getUri() == null && type.getUri() != null) {
repl = new QName(type.getUri(), repl.getName());
def = vctx.findType(repl);
}
if (def == null) {
throw new IllegalStateException("Internal error - type definition not found");
}
}
GlobalExtension exten = (GlobalExtension)def.getExtension();
if (exten == null) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("No extension found for referenced type " + SchemaUtils.describeComponent(def));
}
return repl;