Adjust to yangtools-2.0.0/odlparent-3.0.0 changes
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / handlers / SchemaContextHandler.java
index 6ba7018cb5d6e6d7a957a0ea3ee97e9855efb49c..e50b0152a51ba59cfb3ad7c53fe68d4ee89cabb4 100644 (file)
@@ -54,6 +54,7 @@ public class SchemaContextHandler implements SchemaContextListenerHandler {
     }
 
     @Override
+    @SuppressWarnings("checkstyle:hiddenField")
     public void onGlobalContextUpdated(final SchemaContext context) {
         Preconditions.checkNotNull(context);
         this.context = null;
@@ -63,14 +64,14 @@ public class SchemaContextHandler implements SchemaContextListenerHandler {
 
         this.moduleSetId++;
         final Module ietfYangLibraryModule =
-                context.findModuleByNamespaceAndRevision(IetfYangLibrary.URI_MODULE, IetfYangLibrary.DATE);
+                context.findModule(IetfYangLibrary.MODULE_QNAME).orElse(null);
         NormalizedNode<NodeIdentifier, Collection<DataContainerChild<? extends PathArgument, ?>>> normNode =
                 RestconfMappingNodeUtil.mapModulesByIetfYangLibraryYang(context.getModules(), ietfYangLibraryModule,
                         context, String.valueOf(this.moduleSetId));
         putData(normNode);
 
         final Module monitoringModule =
-                this.context.findModuleByNamespaceAndRevision(MonitoringModule.URI_MODULE, MonitoringModule.DATE);
+                this.context.findModule(MonitoringModule.MODULE_QNAME).orElse(null);
         normNode = RestconfMappingNodeUtil.mapCapabilites(monitoringModule);
         putData(normNode);
     }