Adjust for ModuleImport type change 75/101075/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 11 May 2022 13:38:03 +0000 (15:38 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 11 May 2022 13:44:37 +0000 (15:44 +0200)
We are using Unqualified, not String, hence we need to unpack it.

Change-Id: I1227a66256351acbd534701506230c8c7147972a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/LeafNodeCodecContext.java
binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/YangModuleInfoTemplate.xtend

index 573b476b12efcb58c0aedbaa9ab4b0e1be520a61..845fed4ba84e3d43b748dba08a8fa0224ccd865a 100644 (file)
@@ -112,7 +112,7 @@ class LeafNodeCodecContext extends ValueNodeCodecContext.WithCodec {
 
             for (ModuleImport moduleImport : module.getImports()) {
                 if (moduleImport.getPrefix().equals(defaultValuePrefix)) {
-                    Module importedModule = schemaContext.findModule(moduleImport.getModuleName(),
+                    Module importedModule = schemaContext.findModule(moduleImport.getModuleName().getLocalName(),
                         moduleImport.getRevision()).get();
                     qname = QName.create(importedModule.getQNameModule(), defaultValue.substring(prefixEndIndex + 1));
                     return codec.deserialize(qname);
index 3efa63801350fb6f9d5442352b98a42e0be77f8f..f8e008b6c4e6d51d32c753ead8bef34ac0db7eb9 100644 (file)
@@ -178,18 +178,18 @@ class YangModuleInfoTemplate {
             «ENDIF»
             «IF !m.imports.empty»
                 «FOR imp : m.imports»
-                    «val name = imp.moduleName»
+                    «val name = imp.moduleName.localName»
                     «val rev = imp.revision»
                     «IF !rev.present»
                         «val TreeMap<Optional<Revision>, Module> sorted = new TreeMap(REVISION_COMPARATOR)»
                         «FOR module : ctx.modules»
-                            «IF module.name.equals(name)»
+                            «IF name.equals(module.name)»
                                 «sorted.put(module.revision, module)»
                             «ENDIF»
                         «ENDFOR»
                         set.add(«sorted.lastEntry().value.QNameModule.rootPackageName».«MODULE_INFO_CLASS_NAME».getInstance());
                     «ELSE»
-                        set.add(«(ctx.findModule(name, rev).get.QNameModule).rootPackageName».«MODULE_INFO_CLASS_NAME».getInstance());
+                        set.add(«(ctx.findModule(name, rev).orElseThrow.QNameModule).rootPackageName».«MODULE_INFO_CLASS_NAME».getInstance());
                     «ENDIF»
                 «ENDFOR»
             «ENDIF»