mdsal.git
2 years agoRelease mdsal v8.0.10
jenkins-releng [Wed, 19 Jan 2022 09:12:02 +0000 (09:12 +0000)]
Release mdsal

2 years agoBump odlparent/yangtools to 9.0.12/7.0.12 75/99375/1
Robert Varga [Wed, 19 Jan 2022 08:20:35 +0000 (09:20 +0100)]
Bump odlparent/yangtools to 9.0.12/7.0.12

Pick up latest fixes from upstream.

Change-Id: I93a5848523b632ce9ef451ff896275b238a7cba6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 8.0.10-SNAPSHOT 46/99246/1
Robert Varga [Mon, 10 Jan 2022 10:53:03 +0000 (11:53 +0100)]
Bump versions to 8.0.10-SNAPSHOT

This starts the next development iteration.

Change-Id: I23e50a7fc505c3eb0f25ad1b886de98eca2c1170
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix DataObject builer javadoc references 45/99245/1
Robert Varga [Mon, 10 Jan 2022 09:54:31 +0000 (10:54 +0100)]
Fix DataObject builer javadoc references

We have a few mis-references generated in documentation, fix them up.

Change-Id: I3040adeb6ec10ca46395212324df29dbe292a82d
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit aa2ff80e8294ab1590bebcb4b8c60e36d266bda7)

2 years agoBump odlparent/yangtools to 9.0.10/7.0.11 42/99242/1
Robert Varga [Mon, 10 Jan 2022 10:07:10 +0000 (11:07 +0100)]
Bump odlparent/yangtools to 9.0.10/7.0.11

Pick up latest fixes from upstream.

Change-Id: I8facba41b2019da8daeea754b78c96d586672aaf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump java-diff-utils to 4.11 41/99241/1
Robert Varga [Mon, 10 Jan 2022 09:04:23 +0000 (10:04 +0100)]
Bump java-diff-utils to 4.11

https://github.com/java-diff-utils/java-diff-utils/blob/master/CHANGELOG.md#49
https://github.com/java-diff-utils/java-diff-utils/blob/master/CHANGELOG.md#410
https://github.com/java-diff-utils/java-diff-utils/blob/master/CHANGELOG.md#411

Change-Id: I5e4191c4993ac472ee33171fa4d2da604a7c7313
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 43200236635afacd16c0dffd3f31162d2077278d)

2 years agoDeprecate AssertDataObjects 40/99240/1
Ivan Hrasko [Thu, 4 Nov 2021 14:10:26 +0000 (15:10 +0100)]
Deprecate AssertDataObjects

XtendBuilderExtensions class is proven to be unnecessary,
remove its usage and mark it for removal.

JIRA: MDSAL-716
Change-Id: I92cf5e060b41320b1d8b7b067c76e5bfdf61fc5c
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1fbc15a384476ed652e45faa6e9dc4d41234aae0)

2 years agoBump versions to 8.0.9-SNAPSHOT 62/99162/1
Robert Varga [Fri, 24 Dec 2021 22:30:05 +0000 (23:30 +0100)]
Bump versions to 8.0.9-SNAPSHOT

This starts the next development iteration.

Change-Id: Ie4a972f57108fb92e8668e1d255f27cf7b00386e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRefactor augment generator linkage 61/99161/1
Robert Varga [Tue, 21 Dec 2021 13:22:03 +0000 (14:22 +0100)]
Refactor augment generator linkage

The uses/augment and module/augment cases are quite different from
the perspective how we map their argument reference to generators.

The uses/augment case is quite simple, as it refers to grouping's nodes,
not augmentations. The only variation we need to account for is the
skip back to the defining grouping.

The module/augment case, on the other hand, is more complex, as it can
refer to augmentations -- hence it need to account for changes namespace
changes along uses/grouping as well as back from grouping child to
augmentations.

JIRA: MDSAL-715
Change-Id: I7425301afa6de566d985d19450ccfc64ea527119
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d601e4b48e111846c005b6f773634e7a5c28e89f)

2 years agoUse Empty.value() instead of Empty.getInstance() 31/99031/1
Robert Varga [Mon, 22 Nov 2021 13:09:34 +0000 (14:09 +0100)]
Use Empty.value() instead of Empty.getInstance()

Empty..getInstance() is going away, do not generate references to it.

Change-Id: I9322032c8b4c6741d2608948fc98711f3ce2573c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 140fdfc2474786eb3b9cbf5217d39618597eeead)

2 years agoBump odlparent/yangtools to 9.0.9/7.0.10 19/99119/3
Robert Varga [Sun, 19 Dec 2021 09:43:05 +0000 (10:43 +0100)]
Bump odlparent/yangtools to 9.0.9/7.0.10

Pick up latest fixes from upstream.

Change-Id: I90601e17bd7c2e502ad98077df6f52e401125f66
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo no use reflection to obtain opaque value ctor 10/98910/1
Robert Varga [Wed, 8 Dec 2021 16:03:25 +0000 (17:03 +0100)]
Do no use reflection to obtain opaque value ctor

We can do all the lookups and access via java.lang.invoke, let's
not bring java.lang.reflect to the party.

Change-Id: I7528a469270d384fbbbd9680cffe227129cf4d39
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c95e5240ca83def4357e8ca7c45b71ea33e9f973)

2 years agoUse a shared type for Pattern 87/98887/1
Robert Varga [Tue, 7 Dec 2021 15:37:05 +0000 (16:37 +0100)]
Use a shared type for Pattern

We are looking up the type here multiple times, which is not entirely
efficient. Add a constant to hold the type.

Change-Id: I5da339cd21c5944c13ed2eb66f15b9ae61d56b46
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit bd63710ebd35fbda6eff024bb3bbc60f037eee9f)

2 years agoUse BindingTypes instead of rollin input/output types 86/98886/1
Robert Varga [Tue, 7 Dec 2021 09:13:28 +0000 (10:13 +0100)]
Use BindingTypes instead of rollin input/output types

We have well-known constants covering ConcreteTypes for RpcInput and
RpcOutput. Use them directly, reducing startup time a bit.

Change-Id: I145c4de2db0d3769f6926200f8e8afe6461a445f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 2db704e27af6f96b6cc7a37f86bd0b2ad378384e)

2 years agoFix action invocation and registration 00/98800/1
Robert Varga [Thu, 25 Nov 2021 15:28:33 +0000 (16:28 +0100)]
Fix action invocation and registration

Binding actions involving groupings are a bit more complicated when it
comes to DOM mapping. An instantiated Action can correspond to any
number of ActionEffectiveStatements, but we skimped that over and used
the SchemaPath (and after that, an invalid SchemaNodeIdentifier) to
identify them.

Correct this by requiring users to provide an ActionSpec, which is a
combination of an Action interface and a corresponding instantiation
path.

JIRA: MDSAL-712
Change-Id: I632c0f51b2e71fa1b0a04e43d5b1c50286430b21
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 54cf838b1a16c1f911963e23e738b1eef753c421)

2 years agoAnother mdsal-dom-api module update 56/98556/1
Robert Varga [Mon, 15 Nov 2021 12:14:49 +0000 (13:14 +0100)]
Another mdsal-dom-api module update

We are using annotations in interfaces, hence we need to require
them transitively.

Change-Id: Ibc6b02f5e02c3e7533a9272daa1090569234e11a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 54b2e91548e5121f9cc1ec8d1982f768dafe7ea5)

2 years agoUpdate mdsal-dom-api module-info 46/98546/1
Robert Varga [Mon, 15 Nov 2021 07:12:50 +0000 (08:12 +0100)]
Update mdsal-dom-api module-info

Our users need access to both concepts and yang.common, reflect that.

Change-Id: I46f18e3a6057ff5407c3cfdde7dcea31baf54f62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7b91035d8c3cc1ed0ff401c546bbfb9a445a3290)

2 years agoClean up IMDS dependencies 98/98498/1
Robert Varga [Sun, 14 Nov 2021 10:27:43 +0000 (11:27 +0100)]
Clean up IMDS dependencies

Fix dependency declarations and make sure we do not need error-prone.

Change-Id: Ie015e508cf352fc0f28c03bb9b99879773fd0aba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump byte-buddy to 1.12.1 29/98329/2
Robert Varga [Sun, 7 Nov 2021 18:16:11 +0000 (19:16 +0100)]
Bump byte-buddy to 1.12.1

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.1
plus the preceding items.

Change-Id: Ie785b9e131369a35584f68a9c9b32ee536b5cead
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse Map.entry() in BindingCodecContext 44/98244/1
Robert Varga [Fri, 29 Oct 2021 16:05:21 +0000 (18:05 +0200)]
Use Map.entry() in BindingCodecContext

We are not using nulls, let's use an immutable entry.

Change-Id: I1d2fdd64b8396f991a267c429cf5822d9ada5fa1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove CompilationTestUtils 06/98206/1
Robert Varga [Thu, 28 Oct 2021 15:53:16 +0000 (17:53 +0200)]
Improve CompilationTestUtils

We can perform better asserts, let's do that.

Change-Id: I671e1a0425d74b2f87a398102fba9cd890b9efc6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd missing requires on yang-common 05/98205/1
Robert Varga [Thu, 28 Oct 2021 16:00:36 +0000 (18:00 +0200)]
Add missing requires on yang-common

We are referencing types from yang-common, make sure we require them
and not get them transitively.

Change-Id: Id93e890e3a303b4199e7ae2f2809e29b02f81b7a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 8.0.8-SNAPSHOT 45/98145/1
Robert Varga [Tue, 26 Oct 2021 19:36:06 +0000 (21:36 +0200)]
Bump versions to 8.0.8-SNAPSHOT

This starts the next development iteration.

Change-Id: I55d485d6a4ad9de8147d2deee1ec56ca3f3b7e8c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 9.0.8 44/98144/2
Robert Varga [Tue, 26 Oct 2021 19:31:35 +0000 (21:31 +0200)]
Bump odlparent to 9.0.8

We have mis-aligned versions view of odlparent with yangtools-7.0.9,
fix that.

JIRA: MDSAL-703
Change-Id: I3d772d956bacce0dfd8c398d2b7a9b1b49d2c1bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup BindingTypesTest 45/98045/1
Robert Varga [Fri, 22 Oct 2021 11:39:23 +0000 (13:39 +0200)]
Cleanup BindingTypesTest

Use assertThrows() instead of @Text(expected), not that it really
matters here.

Change-Id: I8c8ac3d0c5fc99eebaaaae9c5d0943244e9498f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRequire checker.qual 44/98044/1
Robert Varga [Fri, 22 Oct 2021 10:17:35 +0000 (12:17 +0200)]
Require checker.qual

We are using the annotations here, but do not pull in the corresponding
module. Fix that.

Change-Id: Idc25a01c5ba0068763f45f11ddcdfb75a1aae3ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDataTreeIdentifier is HierarchicalIdentifier 43/98043/1
Robert Varga [Fri, 22 Oct 2021 10:12:54 +0000 (12:12 +0200)]
DataTreeIdentifier is HierarchicalIdentifier

yangtools.concepts.Path is deprecated, use its replacement interface,
which actually fits here like a glove.

Change-Id: Ic3df2f95ce54334526444aeb28688bf70e14ed35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 8.0.7-SNAPSHOT 14/98014/2
Robert Varga [Wed, 20 Oct 2021 20:13:08 +0000 (22:13 +0200)]
Bump versions to 8.0.7-SNAPSHOT

This starts the next development iteration.

Change-Id: Idd52a361f4d44df5bc4cac63d6f6b2b98797d4b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse HierarchicalIdentifier 86/97886/5
Robert Varga [Thu, 14 Oct 2021 18:29:19 +0000 (20:29 +0200)]
Use HierarchicalIdentifier

We have a number of identifiers which do not actually implement
Identifier concept but rather Path. We have a replacement for Path,
so let's use it, improving contracts the process of doing so.

Change-Id: Idf506084d1b67993f4a7d37efd23b5fca234375f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent/yangtools 13/98013/3
Robert Varga [Wed, 20 Oct 2021 20:12:22 +0000 (22:12 +0200)]
Bump odlparent/yangtools

Adopt odlparent-9.0.7, yangtools-7.0.9.

Change-Id: I5bafc485191739b184a46c4a3db532a00b50b554
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd NotificationService.registerListener() 76/97976/5
Robert Varga [Tue, 19 Oct 2021 12:08:56 +0000 (14:08 +0200)]
Add NotificationService.registerListener()

We want to get rid of FooListener-based notifications, so that we
can use simple lambdas and proper composition. This takes the first
step towards that by allowing users to register a simple
@FunctionalInterface-based listener.

JIRA: MDSAL-700
Change-Id: Ica1ac23515c813366d5d66dc91c3183695f84ce7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove RoutedDOMRpcRoutingTableEntryTest 54/97954/5
Robert Varga [Sun, 17 Oct 2021 10:52:18 +0000 (12:52 +0200)]
Improve RoutedDOMRpcRoutingTableEntryTest

The only test we had here was exercising a warning path, expand
the test suite to properly cover routed RPCs.

Change-Id: Ic37cdc54b1406257408505b21cb65d6d0aa1cf35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not use anonymous classes in PingPongTransactionChain 52/97952/4
Robert Varga [Sun, 17 Oct 2021 10:23:38 +0000 (12:23 +0200)]
Do not use anonymous classes in PingPongTransactionChain

PingPongTransactionChain is quite complicated and it is not helpful
to have just anonymous subclasses, which may end up capturing more
than we want. Split them out to make Sonar happier.

Change-Id: I9995682091daf6b31c196fee5b89d8cfd19f016c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd basic PingPongTransactionChainTest 53/97953/3
Robert Varga [Sun, 17 Oct 2021 13:14:28 +0000 (15:14 +0200)]
Add basic PingPongTransactionChainTest

Covert the basics of behaviour, this still does not deal with various
race conditions.

JIRA: MDSAL-698
Change-Id: I53103cf3226ca8426dd12eed1f013052258ceb1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove DOMRpcRouterTest 51/97951/1
Robert Varga [Sun, 17 Oct 2021 09:13:20 +0000 (11:13 +0200)]
Improve DOMRpcRouterTest

The test is testing a router with no RPCs, add a simple test model
and use its constants to improve actual coverage.

Change-Id: Id2db74f5d321d2857ab3f1237711b4d654e4087b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove RoutedDOMRpcRoutingTableEntryTest 50/97950/4
Robert Varga [Sun, 17 Oct 2021 08:39:06 +0000 (10:39 +0200)]
Improve RoutedDOMRpcRoutingTableEntryTest

Add a few assertions around what we expect to happen.

Change-Id: I4fc56fb0f763a5b9cf6669444a8d1e3e442780c2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoTestUtils is a utility class 49/97949/2
Robert Varga [Sun, 17 Oct 2021 08:27:13 +0000 (10:27 +0200)]
TestUtils is a utility class

We are subclassing TestUtils just to get at a few static methods and
constants. Turn it into a final class instead.

Change-Id: Ibb25b783b76429b9fca3ba44838e93f2755127d6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFold OSGiDOMNotificationRouter 48/97948/2
Robert Varga [Sun, 17 Oct 2021 08:16:28 +0000 (10:16 +0200)]
Fold OSGiDOMNotificationRouter

We have constructor injection, hence we can easily combine the two
implementations. Also add javax.inject annotations to allow easier
integration.

Change-Id: Id3604110522f73ef4e2f705cad74b31545eb27f1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove OSGi RPC/Action component coverage 47/97947/2
Robert Varga [Sun, 17 Oct 2021 08:03:03 +0000 (10:03 +0200)]
Improve OSGi RPC/Action component coverage

These are simple forwarders, add equally simple tests to cover their
basics.

Change-Id: I529253060122bcddc14a4c629de27d4c2d798af0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove useless throws 46/97946/2
Robert Varga [Sun, 17 Oct 2021 07:44:32 +0000 (09:44 +0200)]
Remove useless throws

Utility test classes have to have a private constructor, but there
is no point in guarding it with an UOE.

Change-Id: I658835c9c6a93032637198d66f08f8d0e0d6b0b5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove DOMRpcRouter coverage 45/97945/3
Robert Varga [Sun, 17 Oct 2021 06:57:45 +0000 (08:57 +0200)]
Improve DOMRpcRouter coverage

The test suite could use a ton of improvements, add a few more
assertions and tests.

Change-Id: I4492dc352e65c5240c55bb730d4b0468669776dd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove listener dispatch 44/97944/2
Robert Varga [Sun, 17 Oct 2021 07:34:42 +0000 (09:34 +0200)]
Improve listener dispatch

Both RPC and action listeners should always be ImmutableLists, make sure
that is captured in their definition. This is an invariant useful for
JIT, as we bind directly to implementation -- and do not throw
Collections.emptyList() into the mix.

Change-Id: I7fe71819f11b80399734759bf774c629adfe12bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup OSGi DOMRpcRouter services 43/97943/1
Robert Varga [Sun, 17 Oct 2021 06:28:36 +0000 (08:28 +0200)]
Cleanup OSGi DOMRpcRouter services

We have constructor injection available, which allows us to make these
classes cleaner by making the delegate field final.

Change-Id: I7ed6aa2f5670fb80fb123957a1446ceb0f6aef7c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMerge (OSGi)DOMRpcRouter 42/97942/1
Robert Varga [Sun, 17 Oct 2021 06:19:34 +0000 (08:19 +0200)]
Merge (OSGi)DOMRpcRouter

We have contructor injection in OSGi DS, hence we can merge these
classes. Also add missing cleanup under javax.inject rules.

Change-Id: I3c580929f67e4f103707902706c9303221272cb3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup mdsal-binding-generator packaging 33/97933/1
Robert Varga [Sat, 16 Oct 2021 15:09:23 +0000 (17:09 +0200)]
Cleanup mdsal-binding-generator packaging

We just ditched utilities depending on it, hence we do not need to
pull it anymore. Also adjust dependencies to silence warnings.

Change-Id: If09662e7a49d0df34aadf23a63193d48f3e75044
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove mdsal.binding.yang.types 32/97932/2
Robert Varga [Sat, 16 Oct 2021 14:52:56 +0000 (16:52 +0200)]
Remove mdsal.binding.yang.types

This package is not exported by us and therefore not accessible by
anyone. We have just ditched its last user, ditch the package as well,
along with its test suite.

Change-Id: Ida72524105d0134395c06c48a994fc86893567d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMigrate ConfigTypeProvider tests 31/97931/1
Robert Varga [Sat, 16 Oct 2021 13:16:03 +0000 (15:16 +0200)]
Migrate ConfigTypeProvider tests

There are a few remaining tests, migrate them and inhume
AbstractTypeProvider et al.

Change-Id: I1aa96547dfa67ef7dc48f8ef948656fab0405ca4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove a chunk of AbstractTypeProvider 29/97929/1
Robert Varga [Sat, 16 Oct 2021 13:06:45 +0000 (15:06 +0200)]
Remove a chunk of AbstractTypeProvider

We now have no references to some of the code, remove it before
we proceed further. Also hide methods not called externally, so
they will be identified as unused.

Change-Id: I351355657eb8cd2e19c18d553c18a0590cef8a9d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoExpand DefaultBindingGeneratorTest 28/97928/1
Robert Varga [Sat, 16 Oct 2021 13:00:05 +0000 (15:00 +0200)]
Expand DefaultBindingGeneratorTest

We have fixed the test model (as it was invalid). Add an explicit test
for the now-unresovled grouping leaf type and also restore the original
negative test.

Change-Id: I14c0d734ee8990f9ad9ac8f8c58f37cafae34990
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove RuntimeTypeProvider 27/97927/1
Robert Varga [Sat, 16 Oct 2021 11:55:10 +0000 (13:55 +0200)]
Remove RuntimeTypeProvider

Migrate all disabled tests which rely on it and remove it. This
increases our assertion coverage and reduces the amount of code we lug
around.

Change-Id: I5ecd83b953f021786a7fb9bd8a228c67e528ea7b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoReduce code duplication a tiny bit 13/97913/1
Robert Varga [Fri, 15 Oct 2021 19:55:51 +0000 (21:55 +0200)]
Reduce code duplication a tiny bit

The 'else' part of CaseNodeCodecContext's return is the same as
overridden method, hence call super instead of duplicating code.

Also add a few FIXMEs to guide our intent going forward.

JIRA: MDSAL-697
Change-Id: I7dd9576da217f1a186e9298346ee62aa2ede45d6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd a ModuleAugmentGenerator FIXME 12/97912/1
Robert Varga [Fri, 15 Oct 2021 18:32:52 +0000 (20:32 +0200)]
Add a ModuleAugmentGenerator FIXME

Since we will be dealing with getOriginal(), it seems we had some
dead code from conversion. This might prove useful in what we need
to achieve here.

JIRA: MDSAL-696
Change-Id: I8af7f2277f5adc9c08b304d4f8693fc43ece6778
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove getOriginalIfPossible() 11/97911/1
Robert Varga [Fri, 15 Oct 2021 18:31:06 +0000 (20:31 +0200)]
Remove getOriginalIfPossible()

We already have originalNodeOf(), which does precisely the same thing
as we just transplanted.

Change-Id: Ibcafaa23027be1e52e4bb1d8c1f752683fab1aff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup AbstractBindingRuntimeContext.getAvailableAugmentationTypes() 09/97909/9
Robert Varga [Fri, 15 Oct 2021 16:01:22 +0000 (18:01 +0200)]
Cleanup AbstractBindingRuntimeContext.getAvailableAugmentationTypes()

We are performing lookups along augmentation instantiation axis using
APIs which are going away. Cleanup the code and move the traversal to
BindingRuntimeTypes.

Leave a FIXME for getting the required intelligence from
GeneratorReactor as well as some sorely-needed documentation as to what
exactly is going on.

JIRA: MDSAL-695
Change-Id: I6dd7ad7807546091bfbc5cced48b574d6bff49e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup findChildSchemaDefinition() 07/97907/3
Robert Varga [Fri, 15 Oct 2021 13:46:04 +0000 (15:46 +0200)]
Cleanup findChildSchemaDefinition()

Now that we have the search and codec check split out, we can clean up
some of the logic to ditch if-else blocks. Also fixes a potential NPE.

Change-Id: I2a341d06bd3abfc39d7ecfaaf876e6617ddea037
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove grouping/instantiation lookup code 04/97904/3
Robert Varga [Fri, 15 Oct 2021 12:56:29 +0000 (14:56 +0200)]
Move grouping/instantiation lookup code

DatObjectCodecContext should not be concerned with relationships
between parent and child, certainly not to the point of dealing with
where an original grouping leaf is instantiated.

The natural place for this logic is BindingRuntimeContext or
BindingRuntimeTypes, as those get their indices from
mdsal-binding-generator -- which is the core component understanding
these relationships.

Also ditch use of Optionals for tracking walk through dependencies,
which clears up some ugly casts.

Change-Id: I72bfa499794b55c0c6266462b36df56c2ac085c2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix GeneratorReactor.mapToGenerator() 94/97394/16
Robert Varga [Sun, 5 Sep 2021 22:48:00 +0000 (00:48 +0200)]
Fix GeneratorReactor.mapToGenerator()

GeneratorReactor.mapToGenerator() relies on EffectiveStatements having
an identity, as it looks up only based on statement.

Rework the logic to operate on SchemaInferenceStack's state, which
provides hierarchical path which should match Generator layout. This
turns out to be a simple delegator job, but we need to switch matching
strategies when we go along the grouping or augment axis.

JIRA: MDSAL-694
Change-Id: Id87c54fdfc2ff37cdf44503e0603074a74c1c02c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoProperly annotate byte[] 69/97669/1
Robert Varga [Tue, 28 Sep 2021 14:54:47 +0000 (16:54 +0200)]
Properly annotate byte[]

This is the only case where we are using a simple array, which has
different annotation placement than reference types. Recognize it and do
the right thing.

JIRA: MDSAL-678
Change-Id: I38fe9c66cbfcf4388cc74ade241b4e986d2c7d6f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRequire transitive on spotbugs-annotations 68/97668/1
Robert Varga [Tue, 28 Sep 2021 14:25:47 +0000 (16:25 +0200)]
Require transitive on spotbugs-annotations

mdsal-binding-api is using @CheckReturnValue, which is not included in
the transitively-visible set and triggers two warnings from javac. Fix
that.

Change-Id: I6007a4745cbb31bd446e52fe7254e26c01388a7c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFilter empty augmentations from DataObject.toString() 67/97667/1
Robert Varga [Tue, 28 Sep 2021 14:12:48 +0000 (16:12 +0200)]
Filter empty augmentations from DataObject.toString()

Empty augmentations are a hallmark of every toString() result we see.
They carry no semantic meaning, so let's filter them to make life easier
for everyone.

JIRA: MDSAL-691
Change-Id: I79dc07fa72c6c952e797ebb96784788e0dd30241
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd FIXMEs for hex-formatting binary values 66/97666/1
Robert Varga [Tue, 28 Sep 2021 14:09:48 +0000 (16:09 +0200)]
Add FIXMEs for hex-formatting binary values

Add FIXMEs to point out where things need to change.

Change-Id: Id7bbd991cf1adf93ee37fa34dfd3314410d72da0
JIRA: MDSAL-692
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix Types.getDefaultRestrictions() 60/97660/1
Robert Varga [Tue, 28 Sep 2021 03:39:16 +0000 (05:39 +0200)]
Fix Types.getDefaultRestrictions()

We have a warning about class visibility, fix it by using public
interface. Also mark the method for removal, as it does not seem
to be used.

Change-Id: I00556715ef3200dc2b46540a05c8e6c0fea0f55e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse a simple substraction for converting case 93/97593/3
Robert Varga [Wed, 22 Sep 2021 00:02:53 +0000 (02:02 +0200)]
Use a simple substraction for converting case

We are dealing with Latin1 here, just use plain arithmetics guaranteed
to work.

Change-Id: Ie86943401e6cea7bd9d000f6ccc7aa82aa7e9156
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd HexFormat FIXMEs 92/97592/1
Robert Varga [Tue, 21 Sep 2021 23:55:40 +0000 (01:55 +0200)]
Add HexFormat FIXMEs

Add markers where we should be taking advantage of Java 17's new
HexFormat class.

Change-Id: I907502f7c976163ec44df62bf056df282ae9a743
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove OSGiBindingAdapterFactory 10/94210/9
Robert Varga [Fri, 11 Dec 2020 10:57:27 +0000 (11:57 +0100)]
Remove OSGiBindingAdapterFactory

We have constructor injection, hence we do not need a separate
OSGi class for BindingAdapterFactory.

Change-Id: I41eeec3112bc8e745cd3b2db9012f28f57746625
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove generatedTypeForExtendedDefinitionTypeWithIdentityrefBaseTypeTest() 91/97591/1
Robert Varga [Tue, 21 Sep 2021 22:27:01 +0000 (00:27 +0200)]
Move generatedTypeForExtendedDefinitionTypeWithIdentityrefBaseTypeTest()

Move this test into the legacy test suite.

Change-Id: I127db528643cc59f76ce3e6198c96508e2c46d01
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove useless test 90/97590/1
Robert Varga [Tue, 21 Sep 2021 22:09:00 +0000 (00:09 +0200)]
Remove useless test

This is a test for a null check in dead code, just remove it.

Change-Id: If5a2347a27697640cb109be0a2d93d28de291dd2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove a few more tests 19/97219/7
Robert Varga [Mon, 16 Aug 2021 13:26:18 +0000 (15:26 +0200)]
Move a few more tests

A few tests from TypeProviderTest can be re-activated with
DefaultBindingGenerator, migrate them.

Change-Id: I61ffbd5c622bba113d58e32e4d2db6fe7275461b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix OSGiDOMSchemaService lifecycle 46/97546/4
Robert Varga [Mon, 20 Sep 2021 15:39:21 +0000 (17:39 +0200)]
Fix OSGiDOMSchemaService lifecycle

Original refactor specified rather invalid lifecycle for the
OSGiModuleInfoSnapshot dependency -- it is missing the dynamic
binding which was there in one version of the patch set.

Unfortunately the invalid instruction (FieldOption for a method) is not
caught and it is causing a rather weird state, where we end up with a
deactivated service still having listeners firing.

Fix injection lifecycle by having a property DYNAMIC and GREEDY
lifecycle -- which does exactly the right thing, except we need to track
a bit more state to make logging more sane.

JIRA: MDSAL-689
Change-Id: Ia027c45daab528821bee9ae93248d9d7e9ada85d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix raw Component{Factory,Instance} references 45/97545/2
Robert Varga [Mon, 20 Sep 2021 14:47:51 +0000 (16:47 +0200)]
Fix raw Component{Factory,Instance} references

These interfaces are now properly generic, bind them to their
corresponding component.

Change-Id: Ib03ec6cfeee4c10fbbfc5e6e0950d1dd035cecfe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup ReadFailedException 79/97479/1
Robert Varga [Mon, 13 Sep 2021 17:52:13 +0000 (19:52 +0200)]
Cleanup ReadFailedException

Remove redundant type specification and make arguments final.

Change-Id: Ib4791bb47c24bbdc6fb1ab6675d302650103ce43
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd a FIXME for method returns 90/97390/4
Robert Varga [Sun, 5 Sep 2021 18:00:54 +0000 (20:00 +0200)]
Add a FIXME for method returns

Method semantics are quite counter-intuitive, add a FIXME to ensure
users do not get confused.

Change-Id: Iefca54eb050c6c2df0cf8a4b1a99b641e282beb7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 8.0.6-SNAPSHOT 51/97451/1
Robert Varga [Sun, 12 Sep 2021 09:27:15 +0000 (11:27 +0200)]
Bump versions to 8.0.6-SNAPSHOT

This starts the next development iteration.

Change-Id: I22d0d635fd45b187c6deda49d6a7922bad96a69e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent/yangtools 50/97450/1
Robert Varga [Sat, 11 Sep 2021 14:22:08 +0000 (16:22 +0200)]
Bump odlparent/yangtools

Adopt odlparent-9.0.6/yangtools-7.0.8.

Change-Id: I6f5682c34c0358b9bb94bc41a7d9c89c55fa4241
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCorrect Generator.findGenerator() return type 97/97397/1
Robert Varga [Mon, 6 Sep 2021 08:09:45 +0000 (10:09 +0200)]
Correct Generator.findGenerator() return type

We can only ever return AbstractExplicitGenerator, make sure we reflect
that in method return type.

Change-Id: Ica9d309910836682476659cb09f9346e2fe16cc7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCentralize Builder and Key suffixes 92/97392/3
Robert Varga [Sun, 5 Sep 2021 20:21:35 +0000 (22:21 +0200)]
Centralize Builder and Key suffixes

We have a number of places hard-coding these constants, use a common
place for them.

Change-Id: Ifbd633e1bc7fbd66bd72d091955e4353d412b6c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove simple BaseTemplate methods 91/97391/1
Robert Varga [Sun, 5 Sep 2021 18:36:23 +0000 (20:36 +0200)]
Move simple BaseTemplate methods

Reduce xtend proliferation by moving simplistic methods into
JavaFileTemplate and using them from there. This has also benefit in
that BaseTemplate does not reference yang.model.api directly.

Change-Id: I0f10e8abd5fcf54f9d288bd882ad5e9b62298113
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix rfc8530 description 49/97349/1
Robert Varga [Fri, 27 Aug 2021 22:22:40 +0000 (00:22 +0200)]
Fix rfc8530 description

We have a mis-reference in the description, fix that.

Change-Id: I8f5ed6b9650adc76ee7b1830c63288a4c643092c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 8.0.5-SNAPSHOT 19/97319/1
Robert Varga [Tue, 24 Aug 2021 14:00:47 +0000 (16:00 +0200)]
Bump versions to 8.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: I2b9ba51d0b0399fe171d29a29f71008d57f06eac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRename mdsal-dom 18/97318/2
Robert Varga [Tue, 24 Aug 2021 13:34:18 +0000 (15:34 +0200)]
Rename mdsal-dom

This is a pure aggregator, let's rename it to match its siblings. This
does not affect anybody, as it's just a build layout thing.

Change-Id: I515a77722d0f7237d80a0a29c5da2ab231515630
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd karaf distribution 17/97317/3
Robert Varga [Tue, 24 Aug 2021 13:15:07 +0000 (15:15 +0200)]
Add karaf distribution

Add a basic distribution.

Change-Id: I7685fa428e8975e46f149fcab4c088f89716303f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent/yangtools 16/97316/2
Robert Varga [Tue, 24 Aug 2021 13:11:44 +0000 (15:11 +0200)]
Bump odlparent/yangtools

Adopt odlparent-9.0.5 and yangtools-7.0.7.

Change-Id: I71532087c44636382c83217468ef8bc810e866d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 8.0.4-SNAPSHOT 01/97301/1
Robert Varga [Mon, 23 Aug 2021 19:31:15 +0000 (21:31 +0200)]
Bump versions to 8.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: I7323c18e83019d36af40c67948a826fa8bcfc828
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstreams 00/97300/1
Robert Varga [Mon, 23 Aug 2021 19:07:08 +0000 (21:07 +0200)]
Bump upstreams

Adops odlparent-9.0.4 and yangtools-7.0.6.

Change-Id: Ie7505132ad25c7822362927e3bcdcac3e43a42ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 8.0.3-SNAPSHOT 77/97277/1
Robert Varga [Fri, 20 Aug 2021 09:23:25 +0000 (11:23 +0200)]
Bump versions to 8.0.3-SNAPSHOT

This starts the next development iteration.

Change-Id: I217e988e73ea089d82f44f08dd88a6c84629bb9f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstreams 67/97267/3
Robert Varga [Thu, 19 Aug 2021 23:07:16 +0000 (01:07 +0200)]
Bump upstreams

Adops odlparent-9.0.3 and yangtools-7.0.5.

Change-Id: I22c5ae9be1e8b817b8bf47f82ac28eb10ba6e840
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoShorten JavaFileGeneratorFactory's name 42/97242/1
Robert Varga [Tue, 17 Aug 2021 21:04:09 +0000 (23:04 +0200)]
Shorten JavaFileGeneratorFactory's name

The package name here is quite wasteful, hence use something shorter,
which should help with hitting file path limits.

Change-Id: Iade9a8e8a71a5cbfb0b7aef1de253e623c731920
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not guard utility class constructors 40/97240/3
Robert Varga [Tue, 17 Aug 2021 19:59:51 +0000 (21:59 +0200)]
Do not guard utility class constructors

There is no point in having exception throwing here, just use a simple
comment.

Change-Id: If4e2c22bde3a2456e1aec77ef2a1e846c2732a7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove ByteBuddyUtils.{ifEq,markLabel} 27/97227/2
Robert Varga [Mon, 16 Aug 2021 18:20:29 +0000 (20:20 +0200)]
Remove ByteBuddyUtils.{ifEq,markLabel}

Ever since we have moved DataObject.equals() implementations to
generated interfaces this code is no longer used. Remove it to reduce
overall footprint.

Since these are the only methods which require frame informantion, also
ditch the code to mark COMPUTE_FRAMES, providing even more
simplification.

Change-Id: I32f1868e3d82193702835938f54663fb2052ae71
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove AdaptingTracker type safety 26/97226/1
Robert Varga [Mon, 16 Aug 2021 16:55:18 +0000 (18:55 +0200)]
Improve AdaptingTracker type safety

Component{Factory,Instance} are generic with OSGi R7, let's take
advantage of that to improve type safety.

Change-Id: Ibe5c7937ad37117bab3492c9a2dfd5b67b972e4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove DynamicBindingAdapter safety 25/97225/1
Robert Varga [Mon, 16 Aug 2021 16:52:20 +0000 (18:52 +0200)]
Improve DynamicBindingAdapter safety

OSGi R7 uses generic ComponentFactory, let's use proper types to
improve safety.

Change-Id: I6a6a06186af825a54199e1576798ed34ba7be7a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd a basic test for Dict 24/97224/2
Robert Varga [Mon, 16 Aug 2021 16:43:46 +0000 (18:43 +0200)]
Add a basic test for Dict

Just test common functionality to increase coverage.

Change-Id: Icb41990aa1c884ed86679d4b1bf44f81e1ea73a7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove BindingDOMTransactionChainAdapterTest coverage 23/97223/2
Robert Varga [Mon, 16 Aug 2021 16:28:59 +0000 (18:28 +0200)]
Improve BindingDOMTransactionChainAdapterTest coverage

We are not testing merging transaction chains, let's do that through
a few parameters.

Change-Id: I77fb2a9e6fd335afebccc254df741670023f3750
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSupport DOMAction-level routing 14/97114/14
Robert Varga [Mon, 9 Aug 2021 20:36:05 +0000 (22:36 +0200)]
Support DOMAction-level routing

We have a distinct use case where we want to route actions across
a system. In this scenario, a next hop provider registers itself as the
local provider with the appropriate cost.

This capability is also exposed as the simplest way of registering
binding-level implementations -- where we want to register to all
actions on the operational datastore.

Add explicit documentation around how how the arguments are interpreted
and teach DOMRpcRouter about wildcards -- similar to how it deals with
RPCs.

JIRA: MDSAL-681
Change-Id: I6daf70b28347fab88c8dc467fce267d8ba71e57d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemember netty sink's registration 90/97190/1
Robert Varga [Thu, 12 Aug 2021 12:24:13 +0000 (14:24 +0200)]
Remember netty sink's registration

I928f1f5486b6edc8a62ed006431b7c5f06ddf986 has made a mistake in startup
path of replication source -- it fails to initialize the registration,
leading to a failure during shutdown.

JIRA: MDSAL-682
Change-Id: I4202e9773597169997b4ca88ed4d30819ebae678
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse utility DOMActionInstance constructor 41/97141/1
Robert Varga [Wed, 11 Aug 2021 13:27:13 +0000 (15:27 +0200)]
Use utility DOMActionInstance constructor

We have a simplified method, which creates the intermediate
DOMDataTreeIdentifier. Use it.

Change-Id: I98348c37574e09e7c17e0882bbc9cff6c256525f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove DOMRpcRouterTest 35/97135/2
Robert Varga [Wed, 11 Aug 2021 12:24:37 +0000 (14:24 +0200)]
Improve DOMRpcRouterTest

We have a ton of untested functionality, add a few tests to increase
coverage.

Change-Id: I0885a9a2c1b8f5ca5a3b56b6c03ff0c7acd00563
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix ActionProviderService(Adapter) 24/97024/20
PeterSuna [Mon, 26 Jul 2021 11:19:32 +0000 (13:19 +0200)]
Fix ActionProviderService(Adapter)

ActionProviderServiceAdapter is always passing an empty set of
instances to DOMActionProviderService, which is a direct violation of
API contract. Unfortunately the implementation interprets empty set as
a no-op, resulting in the violation being ignored silently and routing
not working.

JIRA: MDSAL-679
Change-Id: I53a8977365166228ed30130519a2024372d89365
Signed-off-by: PeterSuna <Peter.Suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse a global comparator 34/97134/1
Robert Varga [Wed, 11 Aug 2021 12:01:40 +0000 (14:01 +0200)]
Use a global comparator

Rather than instantiating a new comparator every time, just reuse a
single instance.

Change-Id: Ida1e9c1f41c5ab67a2847173bdcad6a1cd780c0e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix a NPE on missing path 29/97129/1
Robert Varga [Tue, 10 Aug 2021 22:08:35 +0000 (00:08 +0200)]
Fix a NPE on missing path

If we have an action registration for a different path, we will end up
with a NPE. Handle this case and throw DOMActionNotAvailableException
instead of a NPE.

Change-Id: Icc01eb2f7b291285fc26392561553520ad784bf3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>