Update TypeDefinition design
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / util / SchemaContextUtil.java
index 8061d9a4ad29611ea13530cefd494991e16925c6..06ae0d090faf05c41b0a53e9deb303af5bdfd622 100644 (file)
@@ -305,7 +305,7 @@ public final class SchemaContextUtil {
     }
 
     private static ModuleIdentifier moduleToIdentifier(final Module module) {
-        return ModuleIdentifierImpl.create(module.getName(), Optional.of(module.getRevision()));
+        return ModuleIdentifierImpl.create(module.getName(), module.getRevision());
     }
 
     private static SchemaNode findNodeInModule(final Module module, final Iterable<QName> path) {
@@ -424,7 +424,7 @@ public final class SchemaContextUtil {
 
             if (foundNode == null) {
                 // fallback that tries to map into one of the child cases
-                for (final ChoiceCaseNode caseNode : ((ChoiceSchemaNode) parent).getCases()) {
+                for (final ChoiceCaseNode caseNode : ((ChoiceSchemaNode) parent).getCases().values()) {
                     final DataSchemaNode maybeChild = caseNode.getDataChildByName(current);
                     if (maybeChild != null) {
                         foundNode = findNodeIn(maybeChild, nextPath);