Fix uses/augment linkage 14/99414/32
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 21 Jan 2022 06:10:37 +0000 (07:10 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 13 Feb 2022 23:12:11 +0000 (00:12 +0100)
commitf0749e72cfb282d0043d2171afc85a23fe9931da
tree935781c8b257634656e2b5dc6df1052af045509a
parentafdfd6c4d2812df08f523bb23e0d0860d3a55bc0
Fix uses/augment linkage

Our previous fix for MDSAL-715 switched the resolution logic to a unified
approach based on linked augmentation. Unfortunately it missed the fact
that linking the groupings also had the side-effect of setting the
augment target, which in turn populates 'augments' list.

Our failure to do so ends up wrecking lookups in the case where we have
an uses-augmented node further augmented by a module-augment.

Fix this by intertwining original and augment linkage, so that a subtree
root (such as module) pays attention to augments which need to resolve
before descending to recursive linkage.

JIRA: MDSAL-718
Change-Id: I7bd6cbed636267d35113888ddd35f0c6d9411043
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 files changed:
binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/AbstractAugmentGenerator.java
binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/AbstractCompositeGenerator.java
binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/AbstractExplicitGenerator.java
binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/AugmentRequirement.java [new file with mode: 0644]
binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/GeneratorReactor.java
binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/LinkageProgress.java [new file with mode: 0644]
binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/ModuleAugmentGenerator.java
binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/UsesAugmentGenerator.java
binding/mdsal-binding-generator/src/test/java/org/opendaylight/mdsal/binding/generator/impl/Mdsal718Test.java [new file with mode: 0644]
binding/mdsal-binding-generator/src/test/resources/mdsal718/bar.yang [new file with mode: 0644]
binding/mdsal-binding-generator/src/test/resources/mdsal718/baz.yang [new file with mode: 0644]
binding/mdsal-binding-generator/src/test/resources/mdsal718/foo.yang [new file with mode: 0644]
binding/mdsal-binding-generator/src/test/resources/mdsal718/xyzzy.yang [new file with mode: 0644]