mdsal.git
17 months agoAdopt yangtools-9.0.5 47/103547/1
Robert Varga [Sat, 3 Dec 2022 14:00:48 +0000 (15:00 +0100)]
Adopt yangtools-9.0.5

yangtools-9.0.4 contains a regression, pick up the fix for it.

Change-Id: If5470573a6203a6be08ac1d2ecc56def1226b2ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
18 months agoBump versions to 10.0.5-SNAPSHOT 49/103449/1
Robert Varga [Mon, 28 Nov 2022 18:27:45 +0000 (19:27 +0100)]
Bump versions to 10.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: I7a790248dc1747bfb87e3669044256833230e322
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
18 months agoFix AbstractDOMRoutingTable.{add,remove}All() 44/103444/1
Robert Varga [Mon, 28 Nov 2022 13:15:17 +0000 (14:15 +0100)]
Fix AbstractDOMRoutingTable.{add,remove}All()

Our naive implementation breaks down if we are registering multiple
items, as we end up adding unmodified entries each and every time.

Fix this up by decomposing identifiers in the caller, keeping them in a
table and then have addAll()/removeAll() work on the table, with careful
checks.

JIRA: MDSAL-796
Change-Id: I0a52763e047026c1a641d9a25d82ee1d193fd573
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6de97609d101ed52828c7e7dd1b30a4acd4b7411)

18 months agoMake invertImplementationsMap() static 57/103257/1
Robert Varga [Mon, 28 Nov 2022 10:42:41 +0000 (11:42 +0100)]
Make invertImplementationsMap() static

This method is not touching staste, make it static to make that clear.

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

18 months agoBump upstreams 35/103435/1
Robert Varga [Sun, 27 Nov 2022 13:14:25 +0000 (14:14 +0100)]
Bump upstreams

Adopt:
- odlparent-11.0.3
- yangtools-9.0.4

Change-Id: I9d1945f0617f0e18637d3c20d65d2f340e4b9f56
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
18 months agoDeprecate BindingReflections.isSubstitutionFor() 52/103352/1
Robert Varga [Thu, 24 Nov 2022 13:34:40 +0000 (14:34 +0100)]
Deprecate BindingReflections.isSubstitutionFor()

This method is used only in mdsal-binding-dom-codec, deprecate it for
removal.

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

18 months agoDeprecate BindingReflections.isNotification() 51/103351/1
Robert Varga [Thu, 24 Nov 2022 12:04:36 +0000 (13:04 +0100)]
Deprecate BindingReflections.isNotification()

This methods is only used internally and in tests, deprecate it for
removal.

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

18 months agoQualify FIXME 50/103350/1
Robert Varga [Wed, 2 Nov 2022 15:39:46 +0000 (16:39 +0100)]
Qualify FIXME

Attach issue reference to the pre-existing FIXME.

JIRA: MDSAL-785
Change-Id: Ic09ae54a8b8219703ccefc038df5d295e27b22c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6ddb2bfd9baa05be8045e10ad1faf0990a2b6fe9)

18 months agoDeprecate BindingReflections.getChildrenClass* 47/103347/1
Robert Varga [Thu, 24 Nov 2022 11:38:23 +0000 (12:38 +0100)]
Deprecate BindingReflections.getChildrenClass*

These methods are only used by mdsal-binding-dom-codec, deprecate them.

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

18 months agoDeprecate BindingReflections.resolveRpc{In,Out}putClass() 46/103346/1
Robert Varga [Wed, 2 Nov 2022 14:47:59 +0000 (15:47 +0100)]
Deprecate BindingReflections.resolveRpc{In,Out}putClass()

These methods are not used anywhere, deprecate them.

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

18 months agoBump yangtools to 9.0.3 19/103319/1
Robert Varga [Tue, 22 Nov 2022 20:04:23 +0000 (21:04 +0100)]
Bump yangtools to 9.0.3

Pick up latest fixes from upstream.

Change-Id: Icc1fc2759d211a0945ffab755160613ae0335afd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
18 months agoAdd RpcProviderService documentation 54/103254/1
Robert Varga [Sun, 20 Nov 2022 18:42:38 +0000 (19:42 +0100)]
Add RpcProviderService documentation

We have largely-undocumented methods. Add documentation.

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

18 months agoRequire union field to be set 80/103180/1
Robert Varga [Wed, 9 Nov 2022 18:05:46 +0000 (19:05 +0100)]
Require union field to be set

Do not allow an union type object to be costructed without supplying one
of its alternatives.

JIRA: MDSAL-792
Change-Id: I69a9dc3f0094cc9ff03d0846d5f9dcc746417628
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3830f29ff52775324072a30e8cc3bc9b9a41233f)

18 months agoBump versions to 10.0.4-SNAPSHOT 90/103090/1
Robert Varga [Fri, 4 Nov 2022 18:53:43 +0000 (19:53 +0100)]
Bump versions to 10.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: I05e2cdf01a12ba0eb2dc7db820f3c24d36aec73a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
18 months agoRename ModuleInfoSnapshotResolver 89/103089/1
Robert Varga [Fri, 4 Nov 2022 16:40:54 +0000 (17:40 +0100)]
Rename ModuleInfoSnapshotResolver

We are masquerading as the binding-dom-codec, but that is not accurate.
Use our name instead.

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

18 months agoModernize ModuleInfoSnapshotResolver a bit 88/103088/1
Robert Varga [Fri, 4 Nov 2022 17:18:56 +0000 (18:18 +0100)]
Modernize ModuleInfoSnapshotResolver a bit

Use local variable type inference and streams to transform things.
This reduces the verboseness a bit.

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

18 months agoSimplify YangModuleInfoScanner 87/103087/1
Robert Varga [Fri, 4 Nov 2022 16:36:45 +0000 (17:36 +0100)]
Simplify YangModuleInfoScanner

We will be tracking YangFeatureProviders, so
List<ObjectRegistration<YangModuleInfo>> is not quite accurate. Track
only a simple Registration and make sure we wrap the return from
ModuleInfoSnapshotResolver.

Also improve the tracking logic a bit: do not track bundles which do not
contain YangModuleInfos, but make a special exception for the system
bundle.

JIRA: MDSAL-791
Change-Id: I245f25c72152f7e49817c316f63ace557b4c56c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 221a5985063800dc59fb5d3af354f7dd6291b775)

18 months agoRemove unneeded suppression 86/103086/1
Robert Varga [Fri, 4 Nov 2022 16:16:33 +0000 (17:16 +0100)]
Remove unneeded suppression

We are catching only checked exceptions, no need for the suppression.

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

19 months agoSimpleDOMQueryResult should be a record 28/103028/1
Robert Varga [Tue, 1 Nov 2022 18:23:54 +0000 (19:23 +0100)]
SimpleDOMQueryResult should be a record

This is a simple reference holder with some accessors, turn it into a
record.

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

19 months agoDeprecate BindingReflections.isAugmentationChild() 27/103027/1
Robert Varga [Wed, 2 Nov 2022 14:28:24 +0000 (15:28 +0100)]
Deprecate BindingReflections.isAugmentationChild()

This method is used only in test, deprecate it for removal.

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

19 months agoDeprecate BindingReflections.findHierarchicalParent() 26/103026/1
Robert Varga [Wed, 2 Nov 2022 14:33:33 +0000 (15:33 +0100)]
Deprecate BindingReflections.findHierarchicalParent()

These methods are not used, deprecate them for removal.

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

19 months agoBump upstreams 27/102927/1
Robert Varga [Fri, 28 Oct 2022 16:05:00 +0000 (18:05 +0200)]
Bump upstreams

Adopt the following:
- odlparent-11.0.2
- yangtools-9.0.2

Change-Id: I2032cb89f0fa1868afb7c3017ea6820c4d2bbe09
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
19 months agoDeprecate BindingMapping.NOTIFICATION_LISTENER_SUFFIX 59/102659/1
Robert Varga [Thu, 13 Oct 2022 09:28:09 +0000 (11:28 +0200)]
Deprecate BindingMapping.NOTIFICATION_LISTENER_SUFFIX

This is part of the NotificationListener specification, it needs to be
deprecated just as the rest of it is.

Change-Id: I61996af51b9f8bc67b986cefdc8abf98bdc2ac7c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoBump versions to 10.0.3-SNAPSHOT 72/102372/2
Robert Varga [Wed, 14 Sep 2022 12:30:02 +0000 (14:30 +0200)]
Bump versions to 10.0.3-SNAPSHOT

This starts the next development iteration.

Change-Id: I2434badf754ee6f6845ee7f090f78e597f0d5af0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoGenerate javadoc for TypeObjects 20/102120/8
Samuel Schneider [Wed, 17 Aug 2022 08:07:50 +0000 (10:07 +0200)]
Generate javadoc for TypeObjects

Fix warnings about missing javadoc in TypeObject classes.

Add setting of YangSourceDefinition when building GeneratedType
for TypeObject so JavaFileTemplate.appendSnippet() generate javadoc
for this class.

Generation of javadoc was added for all TypeObjects not only
ScalarTypes as described in corresponding task.

JIRA: MDSAL-762
Change-Id: Iec3ab9e36bcea0807892bd024b7f04c451ff9000
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoClean up AbstractEnumerationBuilder 71/102371/1
Robert Varga [Wed, 14 Sep 2022 10:43:51 +0000 (12:43 +0200)]
Clean up AbstractEnumerationBuilder

We can use Java 17, fluent StringBuilder and streams to make the code
denser.

Change-Id: Id0b8bc176076469120fddbb993e9a59215aa660a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoPropagate status in feature classes 27/102327/2
Robert Varga [Fri, 9 Sep 2022 13:52:44 +0000 (15:52 +0200)]
Propagate status in feature classes

When we have a deprecated or obsolete identity, the resulting interface
should be marked as deprecated, perhaps for removal.

JIRA: MDSAL-770
Change-Id: I2b1204b2afcd4b2786c0c76695c1d58304349f57
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoPropagate status in identity classes 26/102326/2
Robert Varga [Fri, 9 Sep 2022 13:51:15 +0000 (15:51 +0200)]
Propagate status in identity classes

When we have a deprecated or obsolete identity, the resulting interface
should be marked as deprecated, perhaps for removal.

JIRA: MDSAL-769
Change-Id: I5aefc70d5cde269217143e092ba208589b55d12f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoBump xtend to 2.28.0 13/102313/1
Robert Varga [Fri, 9 Sep 2022 05:39:05 +0000 (07:39 +0200)]
Bump xtend to 2.28.0

https://www.eclipse.org/xtend/releasenotes.html#/releasenotes/2022/05/30/version-2-27-0
https://www.eclipse.org/xtend/releasenotes.html#/releasenotes/2022/08/29/version-2-28-0

Change-Id: I9ce1d9fddabff9df48de9fc69637492d30c39635
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoGenerate features with @NonNullByDefault 06/102206/1
Robert Varga [Mon, 22 Aug 2022 14:50:10 +0000 (16:50 +0200)]
Generate features with @NonNullByDefault

We get quite a few warnings around nulls, use @NonNullByDefault, as that
is what we need.

Change-Id: Ia6b7c572ece161cc4e9cac1e9530a91b621cd93e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoBump versions to 10.0.2-SNAPSHOT 47/102147/1
Robert Varga [Thu, 18 Aug 2022 08:11:18 +0000 (10:11 +0200)]
Bump versions to 10.0.2-SNAPSHOT

This starts the next development iteration.

Change-Id: I353e51fd685690023e24fdad452d53ced4d44eee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoBump odlparent/yangtools 38/102138/1
Robert Varga [Wed, 17 Aug 2022 15:48:39 +0000 (17:48 +0200)]
Bump odlparent/yangtools

Adopt:
- odlparent-11.0.1
- yangtools-9.0.1

Change-Id: I3b1ba2d5345bbf26d471296f850e3b9836ffb2a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoUse @Serial tag 88/102088/4
Robert Varga [Tue, 16 Aug 2022 11:01:14 +0000 (13:01 +0200)]
Use @Serial tag

With Java 17 we can make serialization-related components explicitly
tagged so their shape is enforced. Sprinkle java.io.Serial around.

Change-Id: Ibf0ce6e19f8433b3274e05ad3f56d86616146e78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoUse contructor injection in OSGiModelRuntime 85/102085/4
Robert Varga [Tue, 16 Aug 2022 10:06:57 +0000 (12:06 +0200)]
Use contructor injection in OSGiModelRuntime

Remove unneeded indirection through fields, so that the lifecycle is a
tad more crisp.

Change-Id: I55794015a41340e38f77c7cca7caf047116ae18c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoUse instanceof pattern in Identity's equals() 90/102090/3
Robert Varga [Tue, 16 Aug 2022 11:47:39 +0000 (13:47 +0200)]
Use instanceof pattern in Identity's equals()

We can use an implicit cast here, let's just do that to make things a
tad simpler.

Change-Id: Ic2f48c2b8f3fc0e4b5aec0b699cad8edf4c434b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoFixup a nullness warning 84/102084/1
Robert Varga [Tue, 16 Aug 2022 09:45:50 +0000 (11:45 +0200)]
Fixup a nullness warning

Add an annotation to fix a potential problem.

Change-Id: I8676cb25ee5f7c8c132b894f47c4383825d9ff5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoFix raw type warnings in OSGiBindingRuntime 81/102081/1
Robert Varga [Tue, 16 Aug 2022 09:38:16 +0000 (11:38 +0200)]
Fix raw type warnings in OSGiBindingRuntime

Component/ComponentFactory take a type specification, make sure we
take advantage of that.

Change-Id: I11cd64811b683fdfa8dfd62980cf9e1979ed1c0d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoAdd YangFeatureProvider 50/102050/15
Robert Varga [Wed, 10 Aug 2022 23:23:51 +0000 (01:23 +0200)]
Add YangFeatureProvider

YangFeatureProvider is a counterpart to YangModuleInfoProvider,
providing the runtime with the ability to introspect what features
should be supported in an EffectiveModelContext.

JIRA: MDSAL-767
Change-Id: I6d08772c96eead79b4c88ae9ac27c57901dc70a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoGenerate classes for 'feature' statements 49/102049/19
Robert Varga [Wed, 10 Aug 2022 23:51:46 +0000 (01:51 +0200)]
Generate classes for 'feature' statements

We need to cross-reference 'feature' statements before we assemble an
EffectiveModelContext. In order to do that cleanly and in a type-safe
manner, we need to generate Binding representation of each feature.

JIRA: MDSAL-766
Change-Id: I67e2a1dd42bd1b364fbcbbf88a83d96c947621ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoUse instanceof pattern checks 78/102078/1
Robert Varga [Mon, 15 Aug 2022 17:48:07 +0000 (19:48 +0200)]
Use instanceof pattern checks

We can clean up some code with instanceof patterns, use them.

Change-Id: I0c3022b44d824b4677b1286a9c3b99cf18a01193
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoNarrow @SuppressModernizer 75/102075/2
Robert Varga [Mon, 15 Aug 2022 08:27:00 +0000 (10:27 +0200)]
Narrow @SuppressModernizer

We are only suppressing the use of Guava's Objects in != operator, narrow
covered places.

Change-Id: I6b3ec8f78996227bae27558f9c04b22ed866595b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoUse an instanceof pattern 74/102074/1
Robert Varga [Mon, 15 Aug 2022 07:35:54 +0000 (09:35 +0200)]
Use an instanceof pattern

We can remove a cast here, saving a few characters.

Change-Id: Ie2c03a062cffce58ba15a253e81957b6cc5d1b6b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoDitch Collections.{singleton,empty}List() 73/102073/1
Robert Varga [Sun, 14 Aug 2022 16:59:29 +0000 (18:59 +0200)]
Ditch Collections.{singleton,empty}List()

Use List.of() instead.

Change-Id: I728826dba2b4790ef75606da918c5968b3c8ee48
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoShare AbstractExplicitGenerator.runtimeJavaType() 70/102070/1
Robert Varga [Fri, 12 Aug 2022 20:41:15 +0000 (22:41 +0200)]
Share AbstractExplicitGenerator.runtimeJavaType()

Most implementations do the same thing, pull the implementation down
into the abstract class.

Change-Id: Iaf0b6cee34e62c89ea3d34b8c83fa4f02bce913e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoSeal CollisionMember.Member 53/102053/2
Robert Varga [Thu, 11 Aug 2022 00:19:57 +0000 (02:19 +0200)]
Seal CollisionMember.Member

This is an implementation detail, seal the class hierarchy.

Change-Id: Ifb9497a172d16a2e2560b46df47631934351afe0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoDispatch statements with instanceof pattern 52/102052/1
Robert Varga [Thu, 11 Aug 2022 00:09:08 +0000 (02:09 +0200)]
Dispatch statements with instanceof pattern

Remove a bit of casting by using an instanceof match.

Change-Id: I2d22f4a3bd6151c4193d3dec95efc7f69c09013d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoUse instanceof pattern 28/102028/2
Robert Varga [Tue, 9 Aug 2022 20:01:25 +0000 (22:01 +0200)]
Use instanceof pattern

Remove a cast to make the expression simpler.

Change-Id: I7a0d1abf1e80cafb9352bfbb1f05ae56b9117bf1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoBump byte-buddy to 2.12.13 92/101992/2
Robert Varga [Sun, 7 Aug 2022 18:00:56 +0000 (20:00 +0200)]
Bump byte-buddy to 2.12.13

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.11
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.12
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.13

Change-Id: I08268857938cf7f732662c0e41c4fb7e8a5ba996
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoImprove javadoc for generated keys 95/101795/9
Samuel Schneider [Mon, 11 Jul 2022 09:52:08 +0000 (11:52 +0200)]
Improve javadoc for generated keys

Fix warnings about missing javadoc in Key classes
generated by ListKeyTemplate.xtend.

Add generation of javadoc for all values constructor,
getter methods and for the class.

JIRA: MDSAL-759
Change-Id: I1cef9d4b4415e0f786eca414937b1958d31acd38
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoGenerate javadoc for augments 63/101963/3
Samuel Schneider [Thu, 4 Aug 2022 13:13:00 +0000 (15:13 +0200)]
Generate javadoc for augments

Fix warnings about missing javadoc in augment interfaces.

Add setting of YangSourceDefinition when building GeneratedType
corresponding to augments so JavaFileTemplate.appendSnippet()
generate javadoc for this class.

JIRA: MDSAL-761
Change-Id: I243ce2e5198dca2b9c6e6c009c6ddb2a248d44a5
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoGenerate javadoc for unions 68/101868/3
Samuel Schneider [Mon, 25 Jul 2022 13:12:49 +0000 (15:12 +0200)]
Generate javadoc for unions

Fix warnings about missing javadoc in union classes.

Add setting of YangSourceDefinition when building GeneratedType
corresponding to union so JavaFileTemplate.appendSnippet()
generate javadoc for this class.

JIRA: MDSAL-760
Change-Id: I42ac82ab099785b1318a5e3615e37ebeee653b02
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoUse FrameworkUtil.asDictionary() 07/101807/2
Robert Varga [Mon, 11 Jul 2022 21:08:59 +0000 (23:08 +0200)]
Use FrameworkUtil.asDictionary()

We do not need a Hashtable, use FrameworkUtil to give us what we need.

Change-Id: If6a590a2651e92b89e349b41a6ab4e10b0f73db8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoFix raw type warnings 06/101806/2
Robert Varga [Mon, 11 Jul 2022 21:04:53 +0000 (23:04 +0200)]
Fix raw type warnings

CompoentFactory should use a proper type, fix that.

Change-Id: Ibf0c072d49c1ce9047eb01101f94d9b589448452
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoClean up YangSourceDefinition a bit 03/101803/1
Robert Varga [Mon, 11 Jul 2022 20:29:26 +0000 (22:29 +0200)]
Clean up YangSourceDefinition a bit

Capture the shared predicate in a method and use method references
to route to it. Also use instanceof pattern match.

Change-Id: I530274532db9a4942dcc54725c211785badd5d42
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoUse instanceof pattern match 02/101802/1
Robert Varga [Mon, 11 Jul 2022 20:19:50 +0000 (22:19 +0200)]
Use instanceof pattern match

We can be more expressive now that we have Java 17, let's do that.

Change-Id: I669fe4bd871c9cc269ead6b3b376af21295efc4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoAdd generation of javadoc for Builder.withKey() 72/101672/6
Samuel Schneider [Fri, 1 Jul 2022 11:10:54 +0000 (13:10 +0200)]
Add generation of javadoc for Builder.withKey()

Fix warnings about missing javadoc for method withKey() in Builder
classes generated by BuilderTemplate.xtend.

JIRA: MDSAL-758
Change-Id: Ia871623b608a9dcdfb4fec284622843a7365e839
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoUse FrameworkUtil.asDictionary() 19/101719/1
Robert Varga [Mon, 4 Jul 2022 14:39:02 +0000 (16:39 +0200)]
Use FrameworkUtil.asDictionary()

We do not need a dedicated Dictionary implementation as OSGi R8 provides
a conversion utility.

Change-Id: I308c3d5dc23e0c06f176cda089daf4597b5028d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoBump versions to 10.0.1-SNAPSHOT 27/101627/1
Robert Varga [Mon, 27 Jun 2022 08:51:59 +0000 (10:51 +0200)]
Bump versions to 10.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: Iee036e6c5815752768d86f701fc44b3ce1e6c808
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoImprove TypeObject.toString() 81/100281/8
ivan.martiniak [Mon, 28 Mar 2022 11:09:03 +0000 (13:09 +0200)]
Improve TypeObject.toString()

Fixed:
 - Use "value" instead of "_value".

JIRA: MDSAL-693
Change-Id: I7243cf935f5988a563e4d5748ab364e2921c4853
Signed-off-by: ivan.martiniak <ivan.martiniak@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoAdd support for composite notification listeners 84/97984/11
Robert Varga [Tue, 19 Oct 2021 15:30:51 +0000 (17:30 +0200)]
Add support for composite notification listeners

This is a replacement for FooListener notifications, allowing
an atomic subscription.

JIRA: MDSAL-702
Change-Id: I8ebf57f1a479d178aecb8d465d85d690124a587c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoRemove BindingDOMNotificationServiceAdapter.getDomService() 25/101625/1
Robert Varga [Sat, 25 Jun 2022 10:32:52 +0000 (12:32 +0200)]
Remove BindingDOMNotificationServiceAdapter.getDomService()

This method is not used anywhere, remove it.

Change-Id: I9b501de0cab4b6f96c09f8a825907adeccbd1ea3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoAdd registerNotificationListeners() 24/101624/2
Robert Varga [Fri, 24 Jun 2022 12:59:30 +0000 (14:59 +0200)]
Add registerNotificationListeners()

We have a use case where we really want to perform a bulk registration
of multiple listeners. Add the corresponding method and implement it in
DOMNotificationRouter.

JIRA: MDSAL-701
Change-Id: I57e16f4f1044a96ee06dafb003436d84ca47c829
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoCleanup DOMNotificationRouter 23/101623/1
Robert Varga [Fri, 24 Jun 2022 13:24:52 +0000 (15:24 +0200)]
Cleanup DOMNotificationRouter

Use a dedicated subclass for internal registrations. This cuts a bit
of verbosity and makes things a bit more clear.

Change-Id: Ibd22dda7346e0152213d021d536e93714d1f881a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoAnnotate DOMNotificationService returns 19/101619/1
Robert Varga [Wed, 22 Jun 2022 10:30:40 +0000 (12:30 +0200)]
Annotate DOMNotificationService returns

We guarantee a non-null return, annotate that.

Change-Id: Id5eaeeed165b86007766d50e23a964f1a76fab5e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoDeprecate NotificationListener 17/101617/4
Robert Varga [Tue, 21 Jun 2022 11:49:03 +0000 (13:49 +0200)]
Deprecate NotificationListener

NotificationListener is a top-level generated class with a tight binding
to invocation patterns (in mdsal-binding-api). We already provide an
alternative API via functional interfaces, which deal with the
equivalent problem.

Deprecate NotificationListener and related services, guiding users to
their replacements.

JIRA: MDSAL-496
Change-Id: I4ac52493f253040f0055011122dd41c4c367d84b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoCleanup mdsal-binding-dom-codec-spi dependencies 18/101618/1
Robert Varga [Tue, 21 Jun 2022 12:12:55 +0000 (14:12 +0200)]
Cleanup mdsal-binding-dom-codec-spi dependencies

We are using a number of upstream artifacts, make sure we spell
them out.

Change-Id: I7ae2ae61aa0ce6ea8e1e595d1da3facb734db464
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoTurn Restrictions into a final class 16/101616/4
Robert Varga [Tue, 21 Jun 2022 11:09:23 +0000 (13:09 +0200)]
Turn Restrictions into a final class

We have a number of distinct implementations, make sure we concatenate
them into a single one. Also mark future evolution of this contract.

JIRA: MDSAL-85
Change-Id: I620d7e52ea0faf1add13ceeae660062c3dbfa278
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoModernize BindingGeneratorUtil 15/101615/1
Robert Varga [Tue, 21 Jun 2022 10:37:09 +0000 (12:37 +0200)]
Modernize BindingGeneratorUtil

Use instanceof pattern and use ImmutableList consistently.

Change-Id: If324ba0440df122d37acce485822ce5e463aac87
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoRemove Types.getDefaultRestrictions() 14/101614/1
Robert Varga [Tue, 21 Jun 2022 10:27:56 +0000 (12:27 +0200)]
Remove Types.getDefaultRestrictions()

This method is not used anywhere, remove it.

Change-Id: I704f95e98d67aed7e2a322532695d3889af4668a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoUse yangtools release instead of snapshots 12/101612/1
Robert Varga [Mon, 20 Jun 2022 15:10:28 +0000 (17:10 +0200)]
Use yangtools release instead of snapshots

We have a release out there, use that in preparation for our release.

Change-Id: Ia1211f11db9421d9c8e957de4393aeb57d840781
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoRemove an empty line 99/101599/1
Robert Varga [Thu, 16 Jun 2022 11:40:10 +0000 (13:40 +0200)]
Remove an empty line

We have a superfluous empty line, remove it.

Change-Id: Icd599065ce41edb6e2f9be071a24b11064d360eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoFix a typo 98/101598/1
Robert Varga [Thu, 16 Jun 2022 11:36:36 +0000 (13:36 +0200)]
Fix a typo

We have an unused parameter, but it should have the right name.

Change-Id: I8a9c023d4799c4d9899754c4aef4c0051118d8d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoGenerate fields for all Identityrefs in an Union binding class 63/100863/15
OleksandrZharov [Thu, 28 Apr 2022 11:47:27 +0000 (13:47 +0200)]
Generate fields for all Identityrefs in an Union binding class

Changed property name in generator for identityrefs so it will
generate variable names based on type of identityref and not
identityref_ like was before. With that it will generate fields
for all identityrefs that we have in union and methods for them.

Updated related test and added another one to cover the change.

JIRA: MDSAL-740
Change-Id: I11735655ab407f37774cb1b5ffa61955abaee37c
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
23 months agoFixup dependency 79/101579/1
Robert Varga [Mon, 13 Jun 2022 12:10:16 +0000 (14:10 +0200)]
Fixup dependency

We are missing annotation-api for docs, fix that up.

Change-Id: Id838000fd380805b16e5ca17f2585d4bf18d9751
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoRemove unused dependencies 74/101574/1
Robert Varga [Mon, 13 Jun 2022 11:00:33 +0000 (13:00 +0200)]
Remove unused dependencies

We no longer access maven APIs directly, remove now-unused dependencies.

Change-Id: I14fbc398899e6ceae868a24ee5163c4e16e5dd82
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoEliminate use of the IllegalArgumentCodec 74/98374/5
Robert Varga [Fri, 10 Jun 2022 12:13:33 +0000 (14:13 +0200)]
Eliminate use of the IllegalArgumentCodec

Add DomLocalCodec replacement with exactly the semantics we need,
and use that instead of IllegalArgumentCodec.

JIRA: MDSAL-704
Change-Id: I31da50435c8b2a270c1b3cf4210eed59e7e4376f
Signed-off-by: Kostiantyn Nosach <kostiantyn.nosach@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoModernize mdsal-dom-{api,spi} 93/101493/4
Robert Varga [Wed, 8 Jun 2022 09:12:58 +0000 (11:12 +0200)]
Modernize mdsal-dom-{api,spi}

Use various constructs available in JDK11/17.

Change-Id: I5c80b841c25ee5e695c8c643fe9fa43a2cede86b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoFix checkState() argument 94/101494/3
Robert Varga [Wed, 8 Jun 2022 09:27:29 +0000 (11:27 +0200)]
Fix checkState() argument

Use %s instead of {}.

Change-Id: I008a1531dc53420247765a07f2b2cd798ef2d3a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoModernize EntityOwnershipChangeState 92/101492/2
Robert Varga [Wed, 8 Jun 2022 09:00:12 +0000 (11:00 +0200)]
Modernize EntityOwnershipChangeState

Bring this class to modern world:
- Use Boolean.hashCode(boolean)
- Use 'var'
- Use instanceof pattern

Change-Id: I5d902e35f6581a0df4d114f9884438c402d5dae0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoDo not use ListenerRegistration in DOMSchemaService 90/101490/4
Robert Varga [Wed, 8 Jun 2022 08:10:24 +0000 (10:10 +0200)]
Do not use ListenerRegistration in DOMSchemaService

Expose only Registration.

Change-Id: Ia5ddf7e97760b9d5a7bfb8c28f0aa21989b7f5e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoUse instanceof patterns 91/101491/2
Robert Varga [Wed, 8 Jun 2022 08:52:10 +0000 (10:52 +0200)]
Use instanceof patterns

Remove redundant casts to make things a tad simpler.

Change-Id: Iadefb90681431da9e716e4b7050b8e9da39044cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoDo not generate java.beans.ConstructorProperties 83/101483/1
Robert Varga [Tue, 7 Jun 2022 08:21:11 +0000 (10:21 +0200)]
Do not generate java.beans.ConstructorProperties

We are generating ConstructorParameters, there is no need for
java.desktop dependency here.

JIRA: MDSAL-757
Change-Id: Ibaa0c20194052b7b85a0ba37f59f5c86c99534a7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoCleanup docs links 72/101472/1
Robert Varga [Mon, 6 Jun 2022 12:27:19 +0000 (14:27 +0200)]
Cleanup docs links

We have a more modern Guava and do not use old commons-lang.

Change-Id: I1716c399b3235bff7f4f12acef3433d9984a8f6a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoFreeze odlparent at 11.0.0 71/101471/1
Robert Varga [Mon, 6 Jun 2022 12:25:59 +0000 (14:25 +0200)]
Freeze odlparent at 11.0.0

Do not use snapshots.

Change-Id: If8a4b6128de80a5f74917b7327d73dff1938aa92
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSwitch to jakarta.annotation-api 21/101421/2
Ivan Hrasko [Wed, 1 Jun 2022 18:57:31 +0000 (20:57 +0200)]
Switch to jakarta.annotation-api

Since odlparent has switched to jakarta we have to move from
javax.annotation-api to jakarta.annotation-api.

Change-Id: If6fcded7168674d454033f8b7602a0afb0f64221
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 years agoModernize LazyDataObjectModification 65/101365/4
Robert Varga [Mon, 30 May 2022 16:02:04 +0000 (18:02 +0200)]
Modernize LazyDataObjectModification

Use switch expressions to eliminate unneeded default cases.

Change-Id: Iaf8124fc86cf71e7b7a1d589a21b3c7b85b90767
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoModernize BindingStructuralType 63/101363/3
Robert Varga [Mon, 30 May 2022 15:54:59 +0000 (17:54 +0200)]
Modernize BindingStructuralType

Use switch expressions to remove an unused default case.

Change-Id: I5bbbcafebfb24af79c0ecb4d16b5dc6d9425c3d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse instanceof pattern in RpcServiceAdapter 64/101364/2
Robert Varga [Mon, 30 May 2022 15:59:33 +0000 (17:59 +0200)]
Use instanceof pattern in RpcServiceAdapter

Remove an superfluous cast.

Change-Id: Icd1d576b13ff740fbfdf677b05848a0214fcf6fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse instanceof patterin ActionAdapter 62/101362/1
Robert Varga [Mon, 30 May 2022 15:54:37 +0000 (17:54 +0200)]
Use instanceof patterin ActionAdapter

Ditch a superfluous cast.

Change-Id: I17719c5f16da445c2d39eef1e4948f4efd9fc433
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoModernize AbstractCompositeRuntimeType 61/101361/1
Robert Varga [Mon, 30 May 2022 15:48:22 +0000 (17:48 +0200)]
Modernize AbstractCompositeRuntimeType

Use a switch expression to make initialization more explicit.

Change-Id: I349adb2626b13b55a6d122bcfb480acc6c380adc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoModernize Generator 60/101360/1
Robert Varga [Mon, 30 May 2022 15:45:27 +0000 (17:45 +0200)]
Modernize Generator

Use switch expressions and instanceof patterns to make the code more
expressive and ditch a few default cases.

Change-Id: I72e3abd0edc68c923500e006a17152bdadfd3fc3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoModernize AbstractTypeObjectGenerator 59/101359/1
Robert Varga [Mon, 30 May 2022 15:40:24 +0000 (17:40 +0200)]
Modernize AbstractTypeObjectGenerator

Use switch expressions and instanceof pattern matches.

Change-Id: Icf302df71d019db527fd1472d68b55a9100c536f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoModernize SchemaRootCodecContext 58/101358/1
Robert Varga [Mon, 30 May 2022 15:36:06 +0000 (17:36 +0200)]
Modernize SchemaRootCodecContext

Use switch expressions and instanceof patterns to improve
expressiveness.

Change-Id: I08f8806dca5cc1936b2d39ff7c3e2b7b5efc0e60
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse switch expression in IdentifiableItemCodec 57/101357/1
Robert Varga [Mon, 30 May 2022 15:31:47 +0000 (17:31 +0200)]
Use switch expression in IdentifiableItemCodec

An expression is more appropriate here, as we always return a result.

Change-Id: I6cb1d5ef2f04aa1156ef23d789ff52eb3b5600bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoModernize DataContainerCodecPrototype 56/101356/1
Robert Varga [Mon, 30 May 2022 15:28:51 +0000 (17:28 +0200)]
Modernize DataContainerCodecPrototype

Use pattern matching on instanceof and arrow cases. Also split off
ChoiceSchemaNode addressability computation to speed things up just
a bit.

Change-Id: I9deaab2a97becabbe63b3aa5602301239847358e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSpecialize AbstractDOMForwardedCompositeTransaction 55/101355/2
Robert Varga [Mon, 30 May 2022 12:39:39 +0000 (14:39 +0200)]
Specialize AbstractDOMForwardedCompositeTransaction

This is an internal class, which is always specialized to
LogicalDatastoreType. Bake that into the class design rather
having it as a generic argument.

Change-Id: Iec65a658fa29932cdb3a9370927ef1e99b4f6a68
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse switch expressions in mdsal-binding-model-ri 54/101354/1
Robert Varga [Mon, 30 May 2022 08:46:42 +0000 (10:46 +0200)]
Use switch expressions in mdsal-binding-model-ri

We can improve code layout a bit by using a switch expression.

Change-Id: I0784fa87890d81849e08f531b84b081033166c32
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse arrow case in BindingMapping 53/101353/1
Robert Varga [Mon, 30 May 2022 08:41:55 +0000 (10:41 +0200)]
Use arrow case in BindingMapping

This makes the switch expression a bit denser.

Change-Id: I168148a8c6d46a51cd5619cd52e314b9fd3e5453
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse instanceof pattern in BindingReflections 52/101352/1
Robert Varga [Mon, 30 May 2022 08:40:47 +0000 (10:40 +0200)]
Use instanceof pattern in BindingReflections

Reduce the number of casts.

Change-Id: I220b063f9ce81d7487fdf35ef2648193cb7c4cb6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse a switch expression in IMDS 51/101351/1
Robert Varga [Mon, 30 May 2022 08:26:10 +0000 (10:26 +0200)]
Use a switch expression in IMDS

We are switching on enum, use exhaustiveness.

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