X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=binding%2Fmdsal-binding-generator%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fbinding%2Fgenerator%2Fimpl%2Freactor%2FAbstractCompositeGenerator.java;h=93f8dbde3c1ad4fe9fa36b6c33d567e85335f61c;hb=f95f86719bb99367294c2694872aa727778bd458;hp=d63e6cf43893ad4fceed882ecaa5f580b5b54f5f;hpb=6c92275ae2b3c6ce597c0c0f7a915ec911aacf21;p=mdsal.git diff --git a/binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/AbstractCompositeGenerator.java b/binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/AbstractCompositeGenerator.java index d63e6cf438..93f8dbde3c 100644 --- a/binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/AbstractCompositeGenerator.java +++ b/binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/AbstractCompositeGenerator.java @@ -25,6 +25,7 @@ import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTypeBuilde import org.opendaylight.mdsal.binding.model.ri.BindingTypes; import org.opendaylight.mdsal.binding.runtime.api.CompositeRuntimeType; import org.opendaylight.mdsal.binding.runtime.api.RuntimeType; +import org.opendaylight.yangtools.rfc8040.model.api.YangDataEffectiveStatement; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.model.api.AddedByUsesAware; import org.opendaylight.yangtools.yang.model.api.CopyableNode; @@ -36,6 +37,7 @@ import org.opendaylight.yangtools.yang.model.api.stmt.AugmentEffectiveStatement; import org.opendaylight.yangtools.yang.model.api.stmt.CaseEffectiveStatement; import org.opendaylight.yangtools.yang.model.api.stmt.ChoiceEffectiveStatement; import org.opendaylight.yangtools.yang.model.api.stmt.ContainerEffectiveStatement; +import org.opendaylight.yangtools.yang.model.api.stmt.FeatureEffectiveStatement; import org.opendaylight.yangtools.yang.model.api.stmt.GroupingEffectiveStatement; import org.opendaylight.yangtools.yang.model.api.stmt.IdentityEffectiveStatement; import org.opendaylight.yangtools.yang.model.api.stmt.InputEffectiveStatement; @@ -204,9 +206,9 @@ public abstract class AbstractCompositeGenerator composite) { // We know how to descend down - return ((AbstractCompositeGenerator) ret).findGenerator(childStrategy, stmtPath, next); + return composite.findGenerator(childStrategy, stmtPath, next); } // Yeah, don't know how to continue here return null; @@ -309,19 +311,16 @@ public abstract class AbstractCompositeGenerator) child).linkOriginalGenerator()) { - progress = LinkageProgress.SOME; - it.remove(); - - // If this is a composite generator we need to process is further - if (child instanceof AbstractCompositeGenerator composite) { - if (unlinkedComposites.isEmpty()) { - unlinkedComposites = new ArrayList<>(); - } - unlinkedComposites.add(composite); + if (it.next() instanceof AbstractExplicitGenerator explicit && explicit.linkOriginalGenerator()) { + progress = LinkageProgress.SOME; + it.remove(); + + // If this is a composite generator we need to process is further + if (explicit instanceof AbstractCompositeGenerator composite) { + if (unlinkedComposites.isEmpty()) { + unlinkedComposites = new ArrayList<>(); } + unlinkedComposites.add(composite); } } } @@ -494,13 +493,14 @@ public abstract class AbstractCompositeGenerator 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()) { @@ -554,6 +555,10 @@ public abstract class AbstractCompositeGenerator stmt) { - if (stmt instanceof AddedByUsesAware aware) { - if (aware.isAddedByUses() - || stmt instanceof CopyableNode copyable && copyable.isAugmenting()) { - return false; - } + if (stmt instanceof AddedByUsesAware aware + && (aware.isAddedByUses() || stmt instanceof CopyableNode copyable && copyable.isAugmenting())) { + return false; } return true; }