mdsal.git
2 years agoImprove AugmentedTypeTest 44/99044/1
Robert Varga [Sat, 29 Jan 2022 01:53:32 +0000 (02:53 +0100)]
Improve AugmentedTypeTest

Eclipse is warning of an always-false equality check in this test suite.
Fix this by performing a proper type comparison, eliminating use of
assertTrue().

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

2 years agoFixup AbstractDOMStoreTreeChangePublisher 03/99503/2
Robert Varga [Thu, 27 Jan 2022 18:01:43 +0000 (19:01 +0100)]
Fixup AbstractDOMStoreTreeChangePublisher

With DOMDataTreeChangeListener reporting lists, we need to adjust our
SPI to floow suite.

Change-Id: Ib3f5b98519e33ed28a3bfa276903c26e399ab9bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent/yangtools to 9.0.13/7.0.13 75/99475/1
Robert Varga [Wed, 26 Jan 2022 16:32:38 +0000 (17:32 +0100)]
Bump odlparent/yangtools to 9.0.13/7.0.13

Pick up latest fixes from upstream.

Change-Id: I4cd88e9d8371b8cd3f4cfdc4f004d93f0eb3cf3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoGeneratorReactor.linkOriginalGenerator() should be stateless 41/99441/1
Robert Varga [Tue, 25 Jan 2022 12:01:22 +0000 (13:01 +0100)]
GeneratorReactor.linkOriginalGenerator() should be stateless

linkOriginalGenerator() does not need to modify GeneratorReactor, make
it static, so that we can disconnect the state manipulation.

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

2 years agoRemove GeneratorReactor.leafGenerators 40/99440/1
Robert Varga [Tue, 25 Jan 2022 11:49:48 +0000 (12:49 +0100)]
Remove GeneratorReactor.leafGenerators

This field is completely unused, remove it.

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

2 years agoImprove GeneratorReactor timing 39/99439/1
Robert Varga [Mon, 24 Jan 2022 09:37:29 +0000 (10:37 +0100)]
Improve GeneratorReactor timing

Parts of generation are not covered by timer, make sure we measure the
entire execution.

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

2 years agoExpose a List of changes in DOMDataTreeChangeListener 33/97633/3
Robert Varga [Thu, 20 Jan 2022 11:16:27 +0000 (12:16 +0100)]
Expose a List of changes in DOMDataTreeChangeListener

The order of changes have a semantic meaning in that they occur
in-order. There are a number of use cases where we would want to access
only the last delta (i.e. for the last state), which is easier when we
expose a proper List instead of Collection.

Change-Id: I159983207dfc935cbc81eccc24296e3db885f73e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove remaining concepts.(Checked)Builder references 56/98756/11
Ivan Hrasko [Tue, 30 Nov 2021 10:53:40 +0000 (11:53 +0100)]
Remove remaining concepts.(Checked)Builder references

To complete elimination of concepts.(Checked)Builder usage
we have to remove references from manually created Builder
classes and Types.java as well.

JIRA: MDSAL-690
Change-Id: I4a4129bf006d99cf430af6c4d08234208b6620d4
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSimplify leaf access 69/99269/1
Robert Varga [Wed, 12 Jan 2022 12:47:53 +0000 (13:47 +0100)]
Simplify leaf access

We do not need to go through the entryset -- just use Map.values(),
eliminating the need for one object indirection.

Change-Id: I5a5226d4b6b256d998e0a30de52bc89e01d1a16d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAlign argument names of getLeafNodes() 68/99268/1
Robert Varga [Wed, 12 Jan 2022 11:58:04 +0000 (12:58 +0100)]
Align argument names of getLeafNodes()

Naming here is off: the class and schema do not correspond to each
other, but they are not in parent/child relationship, either.

Change-Id: I3f48ce0beaa446fcf4829fb3faaf24d075516ba2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoInline create{Notification,Rpc}DataContext() 67/99267/2
Robert Varga [Wed, 12 Jan 2022 10:51:50 +0000 (11:51 +0100)]
Inline create{Notification,Rpc}DataContext()

We have two methods invoked only from caching loader, inline them,
so that we can eliminate some checks and make visibility obvious.

Change-Id: Id910192224e9a51217f70e125ed58daf08958ab1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoClarify BindingReflections.getChildrenClassToMethod() 66/99266/2
Robert Varga [Wed, 12 Jan 2022 10:33:15 +0000 (11:33 +0100)]
Clarify BindingReflections.getChildrenClassToMethod()

Keys in the returned map are not any classes, but are guaranteed to be
DataContainers. Document that fact.

Change-Id: Ieac66637f9d5e6c2a9869304fd7a36b376ed5b05
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoReference SchemaContext.NAME directly 65/99265/1
Robert Varga [Tue, 11 Jan 2022 14:33:16 +0000 (15:33 +0100)]
Reference SchemaContext.NAME directly

SchemaContext.getQName() is deprecated, reference the name directly.

Change-Id: Icb22924175667221144fae225296c1be3ea4c758
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix raw Notification warnings 62/99262/1
Robert Varga [Tue, 11 Jan 2022 13:44:17 +0000 (14:44 +0100)]
Fix raw Notification warnings

binding.Notification now takes a generic argument, fix a round of raw
references.

Change-Id: I62eed2951a43367e06c69855aaa6a9e43df99392
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove concepts.Builder reference from Builders 55/98755/8
Ivan Hrasko [Tue, 30 Nov 2021 10:38:17 +0000 (11:38 +0100)]
Remove concepts.Builder reference from Builders

In order to better localize callers of build() method, remove
reference to concepts.Builder from Xtend BuilderTemplate.

JIRA: MDSAL-690
Change-Id: I7f068fe2e99afd5bc39f187253d8e2917c2a6e75
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix DataObject builer javadoc references 39/99239/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>
2 years agoRemove AssertDataObjects 38/99238/1
Robert Varga [Mon, 10 Jan 2022 09:12:28 +0000 (10:12 +0100)]
Remove AssertDataObjects

AssertDataObjects has been deprecated, remove it.

JIRA: MDSAL-717
Change-Id: Ie25d1f47955cdabd0ee38b81bf7f6f226e157e4b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump java-diff-utils to 4.11 37/99237/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>
2 years agoDeprecate AssertDataObjects 93/98293/16
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>
2 years agoRefactor augment generator linkage 29/99129/8
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>
2 years agoUse Empty.value() instead of Empty.getInstance() 36/98636/14
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>
2 years agoBump odlparent/yangtools to 9.0.9/7.0.10 18/99118/3
Robert Varga [Sun, 19 Dec 2021 09:42:19 +0000 (10:42 +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 30/98930/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>
2 years agoUse a shared type for Pattern 75/98875/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>
2 years agoUse BindingTypes instead of rollin input/output types 70/98870/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>
2 years agoVerify no schema/type overlap 37/98837/1
Robert Varga [Fri, 3 Dec 2021 15:31:20 +0000 (16:31 +0100)]
Verify no schema/type overlap

We could end up overwriting previous Schema->Type mapping, let's make
sure we never do that, as that could end up in all sorts of disasters.

Change-Id: Ie4e1682af9c5d59e8ec70b263f0f239f69dd3603
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove TestModel 02/98802/1
Robert Varga [Thu, 2 Dec 2021 10:50:09 +0000 (11:50 +0100)]
Move TestModel

There is no point in having a separate model, which is not used
anywhere, move it to mdsal.dom.proker package.

Change-Id: I8a40783ac77ec70b8314e56135f89da5c0b9b30a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove ScanningSchemaServiceProvider 01/98801/1
Robert Varga [Thu, 2 Dec 2021 10:02:09 +0000 (11:02 +0100)]
Remove ScanningSchemaServiceProvider

This class is not used anywhere, remove it. Also clean up dependencies
a bit.

Change-Id: Ic940691658250a0e86a2a5d3c2c8f22f3bf3f904
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove BindingRuntimeContext.getActionIdentifier() 90/98790/2
Robert Varga [Wed, 1 Dec 2021 14:37:00 +0000 (15:37 +0100)]
Remove BindingRuntimeContext.getActionIdentifier()

This method is left unused, remove it to prevent confusion to users.

JIRA: MDSAL-712
Change-Id: Ic924877f255dc9b2ccafaa64866deefd45a81f17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix action invocation and registration 01/98701/6
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>
2 years agoUpdate iana-routing-types to 2021-10-19 32/98732/2
Robert Varga [Mon, 29 Nov 2021 09:12:47 +0000 (10:12 +0100)]
Update iana-routing-types to 2021-10-19

Refresh the models we are packaging so downstreams can take advantage of
allocations made in the past 4 years.

JIRA: MDSAL-707
Change-Id: I17e8e77c21c29c70bc320b9869bb3b489e464f9e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove RFC7223 models 31/98731/2
Robert Varga [Mon, 29 Nov 2021 09:06:51 +0000 (10:06 +0100)]
Remove RFC7223 models

RFC7223 has been superseded by RFC8343, which we have packaged for a
long time. Remove it.

JIRA: MDSAL-708
Change-Id: I3b2f12e174dc5f0e7be7daaa1545a4b43e906241
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUpgrade iana-if-type 30/98730/2
Robert Varga [Mon, 29 Nov 2021 08:52:26 +0000 (09:52 +0100)]
Upgrade iana-if-type

Ditch double packaging of iana-if-type in favor of having a single
updated revision.

JIRA: MDSAL-706
Change-Id: Ib9637fa92bc1fb72cdf315cd0c8e65b9d0f11625
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove rfc7277 ietf-ip 29/98729/2
Robert Varga [Mon, 29 Nov 2021 07:52:27 +0000 (08:52 +0100)]
Remove rfc7277 ietf-ip

This model has been obsoleted by RFC8344 which we are packaging
separately. Remove it to reduce overlap.

JIRA: MDSAL-705
Change-Id: I195009d640bbafc833bdf96c08c24040bfda1d86
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix Notification raw types 37/98637/1
Robert Varga [Mon, 22 Nov 2021 13:39:34 +0000 (14:39 +0100)]
Fix Notification raw types

Narrowing of Notification's implementedInterface() has introduced a few
places where we treat it as raw type. Fix mdsal-binding-dom-adapter's
offences.

Change-Id: Ie2bc9eb8bf9051ab2945f477fa99e88d0348421d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAnother mdsal-dom-api module update 32/98532/2
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>
2 years agoMigrate eos/css to use HierarchicalIdentifier 79/98579/1
Robert Varga [Wed, 17 Nov 2021 09:56:32 +0000 (10:56 +0100)]
Migrate eos/css to use HierarchicalIdentifier

Use replacement of Path to prepare for adoption of yangtools-8.

Change-Id: Ie1a1e18129101a1084b59b352ee45d925983a584
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUpdate mdsal-dom-api module-info 27/98527/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>
2 years agoNarrow Notification.implementedInterface() return type 75/97975/9
Robert Varga [Tue, 19 Oct 2021 11:59:00 +0000 (13:59 +0200)]
Narrow Notification.implementedInterface() return type

All Notification interfaces should provide their own identity here,
make sure there is no confusion about that.

Change-Id: I9fb7f82fcee7acd38aa05b38a2721ef62f8a1750
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup InMemoryDOMStoreThreePhaseCommitCohortTest 99/98499/4
Robert Varga [Sun, 14 Nov 2021 10:31:48 +0000 (11:31 +0100)]
Cleanup InMemoryDOMStoreThreePhaseCommitCohortTest

Use mockito runner and make sure mocks are not static.

Change-Id: I3e7e160fbea64a760b41f882cd69dc0831b0f44d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove unified-html-generator 54/98254/2
Robert Varga [Tue, 2 Nov 2021 06:43:33 +0000 (07:43 +0100)]
Remove unified-html-generator

This generator is not used anywhere, remove it.

JIRA: MDSAL-688
Change-Id: I69259cc3c5684b15372a32edd0fd3f7bca5819ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRequire HierarchicalIdentifier 87/97887/7
Robert Varga [Thu, 14 Oct 2021 22:12:28 +0000 (00:12 +0200)]
Require HierarchicalIdentifier

yangtools.concepts.Path is going away and we are the last holdout,
migrate to its replacement.

Change-Id: I100261228105c35c157dce09120092b4d451f69b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 9.0.0-SNAPSHOT 10/98510/1
Robert Varga [Sun, 14 Nov 2021 19:29:17 +0000 (20:29 +0100)]
Bump versions to 9.0.0-SNAPSHOT

This starts the next major development iteration.

Change-Id: I2e86b89f44c05f9b22bc6fa44bf7f3b983bc3f0e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
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>