Add nonnullFoo() getters for non-semantic objects
[mdsal.git] / binding / mdsal-binding-generator / src / main / java / org / opendaylight / mdsal / binding / generator / impl / reactor / AbstractCompositeGenerator.java
index 45dc763a40209919d8fd2a4b7f76605c5c84118e..8ca6b4079a81a58a9a55685380a9ec5f86f8a644 100644 (file)
@@ -530,7 +530,9 @@ public abstract class AbstractCompositeGenerator<S extends EffectiveStatement<?,
                 tmp.add(this instanceof RpcGenerator ? new RpcOutputGenerator(output, this)
                     : new OutputGenerator(output, this));
             } else if (stmt instanceof RpcEffectiveStatement rpc) {
-                tmp.add(new RpcGenerator(rpc, this));
+                if (this instanceof ModuleGenerator module) {
+                    tmp.add(new RpcGenerator(rpc, module));
+                }
             } else if (stmt instanceof TypedefEffectiveStatement typedef) {
                 tmp.add(new TypedefGenerator(typedef, this));
             } else if (stmt instanceof AugmentEffectiveStatement augment) {
@@ -548,8 +550,8 @@ public abstract class AbstractCompositeGenerator<S extends EffectiveStatement<?,
                 //                   So here is where we should decide how to handle this augment, and make sure we
                 //                   retain information about this being an alias. That will serve as the base for keys
                 //                   in the augment -> original map we provide to BindingRuntimeTypes.
-                if (this instanceof ModuleGenerator) {
-                    tmpAug.add(new ModuleAugmentGenerator(augment, this));
+                if (this instanceof ModuleGenerator module) {
+                    tmpAug.add(new ModuleAugmentGenerator(augment, module));
                 }
             } else if (stmt instanceof UsesEffectiveStatement uses) {
                 for (var usesSub : uses.effectiveSubstatements()) {