BUG-865: eliminate ExtendedType and DerivedType
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / util / SchemaContextUtil.java
index 7f494b14b5467d1368dc5e195fa98e4546083e7c..f509c9061a234b741a891216f0d75ad375b6af72 100644 (file)
@@ -678,17 +678,11 @@ public final class SchemaContextUtil {
             nodeType = ((LeafSchemaNode) schemaNode).getType();
         } else if (schemaNode instanceof LeafListSchemaNode) {
             nodeType = ((LeafListSchemaNode) schemaNode).getType();
+        } else {
+            throw new IllegalArgumentException("Unsupported node " + schemaNode);
         }
 
-        if (nodeType instanceof ExtendedType) {
-            while (nodeType.getBaseType() instanceof ExtendedType) {
-                nodeType = nodeType.getBaseType();
-            }
-
-            QNameModule typeDefModuleQname = nodeType.getQName().getModule();
-            return schemaContext.findModuleByNamespaceAndRevision(typeDefModuleQname.getNamespace(),
-                    typeDefModuleQname.getRevision());
-        } else if (nodeType.getBaseType() != null) {
+        if (nodeType.getBaseType() != null) {
             while (nodeType.getBaseType() != null) {
                 nodeType = nodeType.getBaseType();
             }