mdsal.git
3 months agoClean up constant reference 61/109861/1
Robert Varga [Fri, 19 Jan 2024 13:12:27 +0000 (14:12 +0100)]
Clean up constant reference

We have two methods with the same name, make sure we use the right
constant when referencing it.

JIRA: MDSAL-852
Change-Id: I7628d2c997e3c62895984d6d85672c65ff9f0ce7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoOverride Rpc/Action invoke method 59/109859/2
Robert Varga [Thu, 18 Jan 2024 06:56:56 +0000 (07:56 +0100)]
Override Rpc/Action invoke method

Add a plain @Override method for Rpc/Action's invoke method, so that it
is manifested in the generated type.

JIRA: MDSAL-852
Change-Id: I7db7c9036bdb3051ae48a903b66df933fb338fae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 078d561c79e3fcf57b2bfd5d6b50c4502288781a)
(cherry picked from commit ddd6615c50aa56f9a35c216b6ae71b6910ad4c2a)

3 months agoCapture collection type class 58/109858/1
Robert Varga [Wed, 27 Dec 2023 00:13:01 +0000 (01:13 +0100)]
Capture collection type class

Improve CodeHelpers safety by not losing Class type.

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

3 months agoUse Locale.ROOT for toUpperCase 57/109857/1
Robert Varga [Thu, 18 Jan 2024 16:41:27 +0000 (17:41 +0100)]
Use Locale.ROOT for toUpperCase

We can just assert this is the root locale, not a some particular
language.

Change-Id: Ibce067abf252162740a9c6ed88a3beff99f455b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit f2572480048c7d2017ee88f65a22b2eabe0dd46b)
(cherry picked from commit 8e29ff200b8be981d5ca602fda773fe6a81de60c)

4 months agoBump byte-buddy to 1.14.11 66/109466/1
Robert Varga [Thu, 28 Dec 2023 21:48:23 +0000 (22:48 +0100)]
Bump byte-buddy to 1.14.11

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.10
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.11

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

4 months agoFix wrong annotation use 38/109438/1
Robert Varga [Sat, 16 Dec 2023 14:12:38 +0000 (15:12 +0100)]
Fix wrong annotation use

Use JDT annotation instead of SpotBugs, reducing our exposure.

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

4 months agoMove binding.model.api documentation 37/109437/1
Robert Varga [Tue, 19 Dec 2023 12:49:28 +0000 (13:49 +0100)]
Move binding.model.api documentation

Package documentation resides in the wrong file, move it.

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

5 months agoAdd (DOM)DataTreeIdentifier serialization proxies 77/109277/2
Robert Varga [Sat, 9 Dec 2023 13:18:03 +0000 (14:18 +0100)]
Add (DOM)DataTreeIdentifier serialization proxies

Further evolution of these two classes will require allowing for two
distinct specializations.

In order to be able to do that, we need to disconnect them from their
serial form.

This patch instroduces serialization proxies, which know how to write
out and read in these objects without referencing their class name.

JIRA: MDSAL-845
Change-Id: I2b50d3aa5f752d6181dab991a5a8282b079b16df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9286037f2852d197c4384511fce97c551e2b8dc3)
(cherry picked from commit 9e23304d266d00210f1aeec57a99a1d8694caffe)

5 months agoUse compareAndExchange() to set closeFuture 76/109276/1
Robert Varga [Sat, 9 Dec 2023 10:51:14 +0000 (11:51 +0100)]
Use compareAndExchange() to set closeFuture

Java 9+ gives us a convenient way to ensure null-safety in this CAS
operation -- compareAndExchange() returns the witness value, i.e.
we get the value instead of a plain boolean false.

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

5 months agoMake sure listeners are immutable 75/109275/1
Robert Varga [Thu, 7 Dec 2023 02:38:45 +0000 (03:38 +0100)]
Make sure listeners are immutable

We guarantee DOMNotificationRouter.listeners to be immutable. Make sure
the field has the correct type to prevent confusion.

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

5 months agoClean up DataTreeIdentifier a bit 74/109274/1
Robert Varga [Sat, 9 Dec 2023 12:37:24 +0000 (13:37 +0100)]
Clean up DataTreeIdentifier a bit

Use a simple hashCode() implementation and instanceof pattern to
simplify equals().

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

6 months agoBump verions to 11.0.16-SNAPSHOT 50/108650/1
Robert Varga [Wed, 25 Oct 2023 04:20:18 +0000 (06:20 +0200)]
Bump verions to 11.0.16-SNAPSHOT

This starts the next development iteration.

Change-Id: I4d922c44a17b0472ca0358073b46e7e5b0ca52e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRelease mdsal v11.0.15
jenkins-releng [Wed, 25 Oct 2023 00:14:45 +0000 (00:14 +0000)]
Release mdsal

6 months agoBump upstreams 29/108629/1
Robert Varga [Tue, 24 Oct 2023 14:33:34 +0000 (16:33 +0200)]
Bump upstreams

Adopt:
- odlparent-12.0.10
- yangtools-10.0.12

Change-Id: Ib05b76ac21c3ee9d7d97d1bf8e0e7ad12eb12196
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoBump versions to 11.0.15-SNAPSHOT 94/108594/1
Robert Varga [Mon, 23 Oct 2023 15:12:50 +0000 (17:12 +0200)]
Bump versions to 11.0.15-SNAPSHOT

This starts the next development iteration.

Change-Id: I6105936cb698d9865c6f0eece06cf01517127f40
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRelease mdsal v11.0.14
jenkins-releng [Mon, 23 Oct 2023 10:13:11 +0000 (10:13 +0000)]
Release mdsal

6 months agoMake LambdaTarget a record 89/108589/1
Robert Varga [Sat, 21 Oct 2023 03:43:30 +0000 (05:43 +0200)]
Make LambdaTarget a record

We have a FIXME for efficiency improvement, address it.

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

6 months agoBump upstreams 87/108587/1
Robert Varga [Mon, 23 Oct 2023 08:29:39 +0000 (10:29 +0200)]
Bump upstreams

Adopt:
- odlparent-12.0.9
- yangtools-10.0.11

Change-Id: I7e7d4d3e48601ee9789326b223d2b129321cda89
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoBump byte-buddy to 1.14.9 89/108489/1
Robert Varga [Tue, 17 Oct 2023 12:18:08 +0000 (14:18 +0200)]
Bump byte-buddy to 1.14.9

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.9

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

7 months agoBump versions to 11.0.14-SNAPSHOT 99/108299/1
Robert Varga [Tue, 10 Oct 2023 08:48:37 +0000 (10:48 +0200)]
Bump versions to 11.0.14-SNAPSHOT

This starts the next development iteration.

Change-Id: I16084391ba22291efdd0dda0421808b06c0465d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoRelease mdsal v11.0.13
jenkins-releng [Mon, 9 Oct 2023 21:14:58 +0000 (21:14 +0000)]
Release mdsal

7 months agoBump upstreams 87/108287/2
Robert Varga [Mon, 9 Oct 2023 10:24:08 +0000 (12:24 +0200)]
Bump upstreams

Adopt:
- odlparent-12.0.8
- yangtools-10.0.10

Change-Id: I07a574f3b25b00742b1a78fcb7b4d29090e40ea6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoMake ClassToQNameLoader final 88/108288/1
Robert Varga [Mon, 9 Oct 2023 11:11:53 +0000 (13:11 +0200)]
Make ClassToQNameLoader final

Upgraded checkstyle is flagging this class as a violation. Fix that.

Change-Id: Ibbf6321ada47e6f231ce042f166359850060a03a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoBump xtend to 2.32.0 83/108283/1
Robert Varga [Tue, 29 Aug 2023 07:06:32 +0000 (09:06 +0200)]
Bump xtend to 2.32.0

https://eclipse.dev/Xtext/xtend/releasenotes.html#/releasenotes/2023/08/27/version-2-32-0

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

7 months agoFix NotificationListenerInvokerTest on Java 19+ 80/108280/1
Robert Varga [Fri, 29 Sep 2023 16:03:18 +0000 (18:03 +0200)]
Fix NotificationListenerInvokerTest on Java 19+

We cannot mock MethodHandle, as it is a sealed class on Java 19+. Adjust
the test to use String.toString() as the source of the MH.

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

7 months agoBump byte-buddy to 1.14.8 79/108279/1
Robert Varga [Sat, 16 Sep 2023 11:11:17 +0000 (13:11 +0200)]
Bump byte-buddy to 1.14.8

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.8

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

8 months agoMake AbstractPingPongTransactionChain.close() idempotent 80/107680/1
Robert Varga [Sun, 3 Sep 2023 19:59:41 +0000 (21:59 +0200)]
Make AbstractPingPongTransactionChain.close() idempotent

Expend one byte of state to track close() method, making sure it is
idempotent.

JIRA: MDSAL-838
Change-Id: Ie7bccb2c12ad9eadd948fc15244cc2b2b150a256
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 67c7314bd62883f9c7e1ae4daa1b6cf70fe3cd73)

8 months agoFix mdsal-binding-dom-adapter checkstyle 24/107624/1
Robert Varga [Wed, 30 Aug 2023 13:06:45 +0000 (15:06 +0200)]
Fix mdsal-binding-dom-adapter checkstyle

Upgraded checkstyle is finding a few issues, fix them up.

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

8 months agoBump byte-buddy to 1.14.7 45/107545/1
Robert Varga [Mon, 28 Aug 2023 11:43:11 +0000 (13:43 +0200)]
Bump byte-buddy to 1.14.7

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.6
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.7

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

8 months agoBump byte-buddy to 1.14.5 44/107544/1
Robert Varga [Thu, 15 Jun 2023 08:48:02 +0000 (10:48 +0200)]
Bump byte-buddy to 1.14.5

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.5

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

9 months agoBump versions to 11.0.13-SNAPSHOT 00/107100/1
Robert Varga [Wed, 26 Jul 2023 20:19:39 +0000 (22:19 +0200)]
Bump versions to 11.0.13-SNAPSHOT

This starts the next development iteration.

Change-Id: If86f0f70c9eec4bf8213e2d081da024288bf9cb5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRelease mdsal v11.0.12
jenkins-releng [Wed, 26 Jul 2023 14:48:05 +0000 (14:48 +0000)]
Release mdsal

9 months agoBump upstreams 49/107049/1
Robert Varga [Tue, 25 Jul 2023 14:25:12 +0000 (16:25 +0200)]
Bump upstreams

Adopt:
- odlparent-12.0.7
- yangtools-10.0.9

Change-Id: Ic477a5bbb65b85959d01845c1066c88a2b673a71
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoBump xtend to 2.31.0 92/106492/1
Robert Varga [Wed, 14 Jun 2023 20:53:49 +0000 (22:53 +0200)]
Bump xtend to 2.31.0

https://www.eclipse.org/xtend/releasenotes.html#/releasenotes/2023/05/29/version-2-31-0

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

10 months agoBump xtend to 2.30.0 91/106491/1
Robert Varga [Wed, 1 Mar 2023 23:10:30 +0000 (00:10 +0100)]
Bump xtend to 2.30.0

https://www.eclipse.org/xtend/releasenotes.html#/releasenotes/2023/02/27/version-2-30-0

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

10 months agoFix code generation with leafrefs pointing to optional members 83/106483/1
Robert Varga [Tue, 13 Jun 2023 14:57:25 +0000 (16:57 +0200)]
Fix code generation with leafrefs pointing to optional members

When we have a typedef which points to a location disabled by
if-feature, we need to accept this fact -- but do not allow that typedef
to be referenced.

JIRA: MDSAL-829
Change-Id: Ibde28faa2f96904dc16fcc6f5a922edc6bcffebb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 756d61f430ee651a06adb69138d25b5a2a3648a7)

11 months agoBump versions to 11.0.12-SNAPSHOT 11/106411/1
Robert Varga [Thu, 8 Jun 2023 09:01:52 +0000 (11:01 +0200)]
Bump versions to 11.0.12-SNAPSHOT

This starts the next development iteration.

Change-Id: I7fb586593cd7a6dad78905e6e69f1ac346c0c606
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoRelease mdsal v11.0.11
jenkins-releng [Wed, 7 Jun 2023 14:48:27 +0000 (14:48 +0000)]
Release mdsal

11 months agoBump yangtools to 10.0.8 85/106385/1
Robert Varga [Mon, 5 Jun 2023 10:12:12 +0000 (12:12 +0200)]
Bump yangtools to 10.0.8

Pick up parser fixes from upstream.

Change-Id: I56985cd9f994fadc538f02ec924cf5370b54260a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoBump versions to 11.0.11-SNAPSHOT 88/106188/1
Robert Varga [Sun, 28 May 2023 12:13:28 +0000 (14:13 +0200)]
Bump versions to 11.0.11-SNAPSHOT

This starts the next development iteration.

Change-Id: Id92b54e2a8b7b69ac7c5fbf17b4401120a76173a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoDitch use of LinkedList in BindingCodecContext 85/106185/2
Robert Varga [Thu, 25 May 2023 15:12:33 +0000 (17:12 +0200)]
Ditch use of LinkedList in BindingCodecContext

LinkedList is a rather ugly thing performance-wise, use an ArrayList
instead.

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

11 months agoRemove BindingToNormalizedStreamWriter.create() 84/106184/2
Robert Varga [Thu, 20 Apr 2023 20:30:12 +0000 (22:30 +0200)]
Remove BindingToNormalizedStreamWriter.create()

We have a lot of indirection going on for little real benefit. Reduce
the tangle by replacing calls to create() with plain constructor and
inlining callers.

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

11 months agoCachingNormalizedNodeSerializer should not be instantiated 87/106187/1
Robert Varga [Thu, 20 Apr 2023 23:35:12 +0000 (01:35 +0200)]
CachingNormalizedNodeSerializer should not be instantiated

We only use this class to act as a delegate towards the rest of the
infrastructure. Remove its constructor.

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

11 months agoClean up CachingNormalizedNodeSerializer 86/106186/1
Robert Varga [Thu, 20 Apr 2023 20:52:54 +0000 (22:52 +0200)]
Clean up CachingNormalizedNodeSerializer

Simplify the class by eliminating unneeded methods and lining
invariants. This makes things a tad clearer and eliminates a caller of
DataContainerCodecContext.createWriter().

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

11 months agoModernize BindingCodecContext 83/106183/1
Robert Varga [Thu, 25 May 2023 13:11:33 +0000 (15:11 +0200)]
Modernize BindingCodecContext

Use local variable type inference and instanceof patterns to make things
a tad clearer.

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

11 months agoClean up DataContainerCodecContext exception handling 82/106182/1
Robert Varga [Mon, 22 May 2023 23:13:00 +0000 (01:13 +0200)]
Clean up DataContainerCodecContext exception handling

We are getting confused between immediate throws and returns. The
exception factory methods should be returning the exception and not
throwing it.

Fix this up and add a SpotBugs annotation so that throws are guarded.
Also mark IncorrectNestingException for evolution. Final improvement
that we now have a completely-static factory method.

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

11 months agoImprove BindingCodecTree.getSubtreeCodec() 81/106181/1
Robert Varga [Fri, 26 May 2023 21:51:09 +0000 (23:51 +0200)]
Improve BindingCodecTree.getSubtreeCodec()

The only implementation we have returns non-null and throws exceptions.
Promote that behaviour to how the method is meant to operate.

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

11 months agoImprove BindingCodecContext.getCodecContextNode() 80/106180/1
Robert Varga [Fri, 26 May 2023 21:45:56 +0000 (23:45 +0200)]
Improve BindingCodecContext.getCodecContextNode()

This method always returns @NonNull, document that. Also improve the IAE
thrown on mismatched input and eliminate
SchemaRootCodecContext.create().

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

11 months agoBump upstreams 74/106174/1
Robert Varga [Fri, 26 May 2023 21:02:38 +0000 (23:02 +0200)]
Bump upstreams

Adopt:
- odlparent-12.0.6
- yangtools-10.0.7

Change-Id: I509da62c6d136ff66a12d99348389be0aa626b19
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoUse an instanceof pattern 84/105784/1
Robert Varga [Thu, 20 Apr 2023 23:51:16 +0000 (01:51 +0200)]
Use an instanceof pattern

We have a simple check-and-cast, fold them into a instanceof pattern.

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

12 months agoUse instanceof pattern in AbstractBindingNormalizedNodeCacheHolder 83/105783/1
Robert Varga [Thu, 20 Apr 2023 18:34:03 +0000 (20:34 +0200)]
Use instanceof pattern in AbstractBindingNormalizedNodeCacheHolder

Reduce casting and flatten unneeded if/else blocks with returns. Also
mark a FIXME to use a switch expression once we them with pattern
matching.

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

12 months agoLoad YangFeatureProviders in mdsal-dom-schema-osgi 82/105782/1
Robert Varga [Tue, 16 Aug 2022 11:04:35 +0000 (13:04 +0200)]
Load YangFeatureProviders in mdsal-dom-schema-osgi

YangModuleProvider provides a view into explicitly defined per-module
feature set. These are defined by applications implementing YANG
modules which provide if-feature'd contents and the application does
not support the full feature set.

This patch add the basic smarts to perform loading of providers, and
propagates them to ModuleInfoSnapshotResolver.

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

12 months agoFix runtime type search 80/105780/1
Robert Varga [Tue, 2 May 2023 11:19:54 +0000 (13:19 +0200)]
Fix runtime type search

When searching for children, we should be cognizant of the fact that we
might be looking at an inherited contract -- such as 'output' of an
'action' inherited through 'uses'. Extend the runtime search algorithm
to also look at previous() axis.

JIRA: MDSAL-824
Change-Id: Ic2f57b266825c6121f7bd6156a86112abff4b67a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 53450b03cee1ad3eb8e065c17729bdd16decd574)

12 months agoBump versions to 11.0.10-SNAPSHOT 52/105552/1
Robert Varga [Thu, 20 Apr 2023 14:48:13 +0000 (16:48 +0200)]
Bump versions to 11.0.10-SNAPSHOT

This starts the next development iteration.

Change-Id: Ie77de88f31bc44afdee5cfc12981a416c68b51d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoPropagate supported features from ModuleInfoSnapshotResolver 48/105548/1
Robert Varga [Thu, 20 Apr 2023 11:57:05 +0000 (13:57 +0200)]
Propagate supported features from ModuleInfoSnapshotResolver

ModuleInfoSnapshotResolver should follow the same pattern as Builder to
allow users to add supported features -- except it talks to a different
backing entity.

JIRA: MDSAL-789
Change-Id: I901e188e33e2508e5c20d135fe57399bc3c81f68
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 184ac4d3b25d6f9ec21636ca25f943f81560ba71)

12 months agoPropagate supported features from ModuleInfoSnapshotBuilder 47/105547/1
matus.matok [Thu, 6 Apr 2023 12:27:49 +0000 (14:27 +0200)]
Propagate supported features from ModuleInfoSnapshotBuilder

Allow a FeatureSet to be created from a collected
Module/Set<YangFeature> mapping, allowing each reported module to be
registered in ModuleInfoSnapshotBuilder. These are then transformed
into a FeatureSet and passed down to parser.

JIRA: MDSAL-789
Change-Id: I7837fb1debf2ebff3382422b232f047ec05316c1
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9642f37f7a23be0206d2f04a7c160c245a0b43ed)

12 months agoHide extractYangModuleInfo() 46/105546/1
Robert Varga [Thu, 20 Apr 2023 12:46:11 +0000 (14:46 +0200)]
Hide extractYangModuleInfo()

This method is only used internally, hide it from the rest of the
package.

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

12 months agoBump upstreams 42/105542/1
Robert Varga [Thu, 20 Apr 2023 11:25:05 +0000 (13:25 +0200)]
Bump upstreams

Adopt:
- odlparent-12.0.5
- yangtools-10.0.6

Change-Id: I1e5cda11366b81e37628a518bd5432f244b3f26c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoBump versions to 11.0.9-SNAPSHOT 73/105473/1
Robert Varga [Mon, 17 Apr 2023 08:21:08 +0000 (10:21 +0200)]
Bump versions to 11.0.9-SNAPSHOT

This starts the next development iteration.

Change-Id: I284f6cc33c2517ebb402f342ba36761383de569f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoFix DOMDataTreeCommitCohort 61/105061/2
Robert Varga [Tue, 4 Apr 2023 07:10:15 +0000 (09:10 +0200)]
Fix DOMDataTreeCommitCohort

The cohort should be exposing EffectiveModelContext in order to provide
correct interactions with other utilities.

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

13 months agoBump byte-buddy to 1.14.4 94/105394/1
Robert Varga [Tue, 11 Apr 2023 21:24:54 +0000 (23:24 +0200)]
Bump byte-buddy to 1.14.4

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.4

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

13 months agoBump byte-buddy to 1.14.3 91/105391/1
Robert Varga [Tue, 11 Apr 2023 18:35:15 +0000 (20:35 +0200)]
Bump byte-buddy to 1.14.3

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.3

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

13 months agoBump byte-buddy to 1.14.2 90/105390/1
Robert Varga [Mon, 13 Mar 2023 12:39:14 +0000 (13:39 +0100)]
Bump byte-buddy to 1.14.2

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.1
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.2

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

13 months agoTag serialVersionUID with @Serial 84/105384/1
Robert Varga [Tue, 11 Apr 2023 16:16:07 +0000 (18:16 +0200)]
Tag serialVersionUID with @Serial

Java 14+ allows tagging serialization-related constructs. While we do
not do anything fancy, make sure we tak serialVersionUID.

JIRA: MDSAL-821
Change-Id: I1b660df8fb5e7599d9d8b6658d8955251cc49870
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 67c534310831d06ba7c0341d8140c7c0c3c9f894)

13 months agoBump upstreams 77/105377/2
Robert Varga [Tue, 11 Apr 2023 16:05:19 +0000 (18:05 +0200)]
Bump upstreams

Adopt:
- odlparent-12.0.4
- yangtools-10.0.5

Change-Id: If70cc51bda56c6129d359f6b548554ea41e6f696
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoMigrate Optional.get() callers 76/105376/1
Robert Varga [Tue, 11 Apr 2023 11:37:46 +0000 (13:37 +0200)]
Migrate Optional.get() callers

Use Optional.orElseThrow() instanced.

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

13 months agoRemove explicit DataTreeChangeService 54/105054/1
Robert Varga [Tue, 4 Apr 2023 09:34:23 +0000 (11:34 +0200)]
Remove explicit DataTreeChangeService

DataBroker always implements DataTreeChangeService, hence we do not need
to spell that out.

Change-Id: If8f3889358cd7d92c59d719b37de040abcb40831
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoCorrect InstanceIdentifier.trustedCreate() 04/104604/1
Robert Varga [Tue, 21 Mar 2023 15:24:31 +0000 (16:24 +0100)]
Correct InstanceIdentifier.trustedCreate()

The check for wildcard is not correct: we should just consider the last
item when deciding to create a KeyedInstanceIdentifier. Add an explicit
test and fix the checks.

JIRA: MDSAL-818
Change-Id: Ic6fedca7e182eaf0d983e3e39b49dd75d01f8ae8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 2cb72f53bee4699dc32c004810d05b2187aed1e9)

14 months agoUse mockito-subclass 58/104558/1
Robert Varga [Thu, 23 Feb 2023 15:10:24 +0000 (16:10 +0100)]
Use mockito-subclass

Reduce the workaround here to use mockito-subclass instead of forcing an
old mockito version.

Change-Id: Ibcf45b9101133f2c7852e404081b58c25cd3b888
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoAdd IdentityKeyTest 55/104555/1
Robert Varga [Thu, 23 Feb 2023 12:58:44 +0000 (13:58 +0100)]
Add IdentityKeyTest

Add an explicit test for there/back conversion of identitiable items
with identity-bearing keys.

Change-Id: Iee6ef612aac91058dff658025fc6670c8b8b4f56
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoBump versions to 11.0.8-SNAPSHOT 95/104495/1
Robert Varga [Thu, 23 Feb 2023 09:48:12 +0000 (10:48 +0100)]
Bump versions to 11.0.8-SNAPSHOT

This starts the next development iteration.

Change-Id: I80ca407339914e3c26aa72b30936c141625e1544
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoMigrate user of TypeDescription.OBJECT 94/104494/1
Robert Varga [Wed, 22 Feb 2023 20:48:34 +0000 (21:48 +0100)]
Migrate user of TypeDescription.OBJECT

Use TypeDescription.ForLoadedType.of() instead. Also shorten references
to TypeDescription.ForLoadedType, as we already have it imported.

Change-Id: I2e5531b8e0199d341ee943792369bafb7ab64dc3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoBump upstreams 39/104439/5
Robert Varga [Fri, 17 Feb 2023 14:28:20 +0000 (15:28 +0100)]
Bump upstreams

Adopt:
- odlparent-12.0.3
- yangtools-10.0.4

Change-Id: I98d91e0dac8b396e6164c8b3820c57ba4c5304ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoRemove unneeded declaration 93/104493/1
Robert Varga [Wed, 22 Feb 2023 20:12:01 +0000 (21:12 +0100)]
Remove unneeded declaration

junit-jupiter-params is pulled in by default, remove the declaration.

Change-Id: I8bed9db5e4b50d114357ed308cb9479ed29f1078
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoUse text blocks in BuilderGeneratorTest 91/104491/3
Robert Varga [Wed, 22 Feb 2023 19:09:28 +0000 (20:09 +0100)]
Use text blocks in BuilderGeneratorTest

Java 17 has text blocks, which we can use to make the test a lot more
readable.

Change-Id: Ifa4236e09f6e576b339be7fba0dd2c91469ce9a7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoReduce bindingEquals() verbosity 90/104490/3
Robert Varga [Wed, 22 Feb 2023 19:03:31 +0000 (20:03 +0100)]
Reduce bindingEquals() verbosity

We are generating a cascade of checks, all of which must pass for us to
return 'true'. Rather that generating a number of 'if/return' blocks,
use a single expression to achieve the same result.

Change-Id: I13c7abe4ef81d2a2822b6b4d0456f277dd5ce288
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoUse {@code null} instead of plain null 88/104488/5
Robert Varga [Wed, 22 Feb 2023 18:41:56 +0000 (19:41 +0100)]
Use {@code null} instead of plain null

We want to highlight null, make sure we do that.

Change-Id: I489c42a5e8f28bec5799ba22c78b960fc4e753cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoClean up dependencies 89/104489/3
Robert Varga [Wed, 22 Feb 2023 19:02:37 +0000 (20:02 +0100)]
Clean up dependencies

We rely on rfc8040-model-api in generator, add that to dependencies to
supporess a warning.

Change-Id: I28f2a16b8eff90cc757a4ccebebe3940033a4739
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoBump byte-buddy to 1.14.0 92/104492/1
Robert Varga [Wed, 22 Feb 2023 19:12:46 +0000 (20:12 +0100)]
Bump byte-buddy to 1.14.0

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.20
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.21
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.22
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.12.23
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.13.0
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.0

Change-Id: I5fded158100395f841b15fba08245399d7973b85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoBump versions to 11.0.7-SNAPSHOT 48/104248/1
Robert Varga [Sun, 5 Feb 2023 11:09:03 +0000 (12:09 +0100)]
Bump versions to 11.0.7-SNAPSHOT

This starts the next development iteration.

Change-Id: I5220b28e9fd077c1b88acb89a25485fa16742f5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoExpand StatementNamespace 41/104241/2
Robert Varga [Thu, 2 Feb 2023 22:49:35 +0000 (23:49 +0100)]
Expand StatementNamespace

We are dealing with weird generated models in some cases. Expand
StatementNamespace to cover all the possible inter-statement conflicts
by dedicating suffixes.

JIRA: MDSAL-810
Change-Id: If5e99f89a03f1fa6287dc3516f193bed3de097e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoMove appendPrefix() 35/104235/2
Robert Varga [Thu, 2 Feb 2023 22:00:01 +0000 (23:00 +0100)]
Move appendPrefix()

The decision to append a prefix is a policy decision, hence it should
live in NamingStrategy. StatementNamespace only provides the knobs.

Change-Id: I3439930b2f9978a157f03f7ca685250c010242f1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoUpdate listeners in registerNotificationListeners 44/104244/1
Sangwook Ha [Sat, 4 Feb 2023 19:18:38 +0000 (11:18 -0800)]
Update listeners in registerNotificationListeners

'registerNotificationListeners' does not include a step to replace the
the listener map with a new one. Make sure that the listener map is
actually updated. Also, add test cases for the registration methods.

JIRA: MDSAL-811
Change-Id: I469000b6f92e8d45186cafa1a3a2c737f642de01
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
15 months agoBump versions to 11.0.6-SNAPSHOT 13/104213/1
Robert Varga [Wed, 1 Feb 2023 12:58:07 +0000 (13:58 +0100)]
Bump versions to 11.0.6-SNAPSHOT

This starts the next development iteration.

Change-Id: Idf89c631cd7dcd33f4469c3a05c30f0da33d319e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoAdd BindingRuntimeContext.getYangDataClass() 12/104212/1
Robert Varga [Wed, 1 Feb 2023 10:38:11 +0000 (11:38 +0100)]
Add BindingRuntimeContext.getYangDataClass()

For runtime support we need the ability to load YangData classes, this
patch adds that ability.

JIRA: MDSAL-675
Change-Id: Ia318c2cd7b47e6477144938d9f67f69972e4d7c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoAdd BindingRuntimeTypes.findYangData() 11/104211/1
Robert Varga [Wed, 1 Feb 2023 10:28:44 +0000 (11:28 +0100)]
Add BindingRuntimeTypes.findYangData()

BindingRuntimeTypes (as well as ModuleRuntimeType) need to expose the
ability to locate YangDataRuntimeTypes. This patch adds that capability.

JIRA: MDSAL-675
Change-Id: Ibb5da804ffa04750f6b450ace3a240b910fc7eac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoUse instanceof pattern 10/104210/1
Robert Varga [Wed, 1 Feb 2023 10:11:09 +0000 (11:11 +0100)]
Use instanceof pattern

Remove an explicit cast, making things a bit cleaner.

Change-Id: I5a06c7fcfa74dcca61e7c767cd9107fb926e7894
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoRFC8040 'rc:yang-data' support for mdsal binding generator 81/97381/32
Ruslan Kashapov [Tue, 13 Dec 2022 10:34:08 +0000 (12:34 +0200)]
RFC8040 'rc:yang-data' support for mdsal binding generator

New naming strategy is introduced to generate artifact names out of
yang-data argument: if name is yang identifier compliant the camel-case
transformation used, otherwise non-compliant characters are encoded.

JIRA: MDSAL-675
JIRA: MDSAL-808
Change-Id: I6644f550a378cd176e5f53a201ee6e70b32c6410
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoSeparate out YangIdentifierClassNamingStrategy 07/104207/3
Robert Varga [Tue, 31 Jan 2023 22:13:23 +0000 (23:13 +0100)]
Separate out YangIdentifierClassNamingStrategy

Our current ClassNamingStrategies rely on the fact that each YANG
statement's argument provides an AbstractQName from which we can extract
a YANG identifier (i.e. AbstractQName.getLocalName()).

ietf-restconf:yang-data's argument is any non-empty String, so we just
cannot keep this contract.

Separate current handing into a separate class, which inherits the
notion of having a nodeIdentifier(), except that fact is purely internal
field. This also neatly re-joins Module and CamelCase to use the same
simpleClassName() method.

JIRA: MDSAL-675
Change-Id: Iaa1a43ba865ff78aa98ac69459e16373634eff40
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoRevert "Make CamelCaseWithNamespaceNamingStrategy reusable" 06/104206/1
Robert Varga [Tue, 31 Jan 2023 21:46:27 +0000 (22:46 +0100)]
Revert "Make CamelCaseWithNamespaceNamingStrategy reusable"

This reverts commit 74423fd58d3af3c3fcafd179be4b174aeace2230. As it
turns out we do not need fallback for yang-data after all.

JIRA: MDSAL-675
Change-Id: I3ecba0c7d93bc3e0d33479221b95adea40b4befe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoMove ClassNamingStrategy.simpleClassName() 96/104196/1
Robert Varga [Mon, 30 Jan 2023 20:04:06 +0000 (21:04 +0100)]
Move ClassNamingStrategy.simpleClassName()

Class name generation must not depend on YANG identifier, as there very
well may be other implementations. This results in a bit of duplicate
code, but that's fine.

JIRA: MDSAL-675
Change-Id: Iccbcf77ea68a7f6cf1c5cff18a218a27c04c40a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoMake CamelCaseWithNamespaceNamingStrategy reusable 95/104195/1
Robert Varga [Mon, 30 Jan 2023 18:44:57 +0000 (19:44 +0100)]
Make CamelCaseWithNamespaceNamingStrategy reusable

Appending a suffix is usable for other strategies as well, rename this
class to AppendNamespaceNamingStrategy and extract the fact that a
strategy has a namespace to AppendNamespaceNamingStrategy, which
automatic fallback.

JIRA: MDSAL-675
Change-Id: Ib1614b84591b4c0349f81785846f7216e0e87ec4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoAdd YangData base interface 64/104064/5
Robert Varga [Tue, 17 Jan 2023 20:52:18 +0000 (21:52 +0100)]
Add YangData base interface

RFC8040 defines a yang-data extension, which defines a piece of data,
which is yang-modeled, but does not tie to any of the RFC7950
constructs.

Add a baseline binding interface which captures its basic contract and
codegen generates interfaces on top of it.

JIRA: MDSAL-675
Change-Id: I6f93733ce15ad47294c7c04bc7de2d7aa22ac9cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoBump upstreams 94/104194/2
Robert Varga [Mon, 30 Jan 2023 17:36:29 +0000 (18:36 +0100)]
Bump upstreams

Adopt:
- odlparent-12.0.2
- yangtools-10.0.3

Change-Id: I557f7fab6650da3980109cde573bf509a27dd5f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoBump versions to 11.0.5-SNAPSHOT 95/104095/1
Robert Varga [Mon, 23 Jan 2023 09:45:36 +0000 (10:45 +0100)]
Bump versions to 11.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: If57c4c2a776554c1892bf23e30b032966eabc059
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoFix typedef/bits code generation 41/104041/5
Robert Varga [Mon, 16 Jan 2023 13:42:30 +0000 (14:42 +0100)]
Fix typedef/bits code generation

bits/typedef seemed to be generating code which does not compile.

Add a test to check if the generated code contains desired method and
fix the check for bits type.

JIRA: MDSAL-807
Change-Id: I4618269fff1fc284b65e9efb1d49501248d233c3
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoAdd Augmentable.augmentationOrElseThrow() 36/104036/5
Robert Varga [Mon, 16 Jan 2023 00:27:40 +0000 (01:27 +0100)]
Add Augmentable.augmentationOrElseThrow()

A number of places assume, or check-or-throw on, presence of a
particular Augmentation. Add convenience methods to short-circuit
the equivalent of Optional.orElseThrow(), so users get more comfort
expressing this.

JIRA: MDSAL-806
Change-Id: I457a93ac1689087a7ceace57489e528b488ed207
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoUse instanceof patterns for argument checking 65/104065/1
Robert Varga [Tue, 17 Jan 2023 22:07:13 +0000 (23:07 +0100)]
Use instanceof patterns for argument checking

Eliminate the need for explicit casts by inlining verify(instanceof)
calls.

Change-Id: Ice2508ea44693bac4198b55779f82a9d51cbe514
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoAdd FIXMEs to Rpc{Input,Output} 63/104063/1
Robert Varga [Tue, 17 Jan 2023 20:38:10 +0000 (21:38 +0100)]
Add FIXMEs to Rpc{Input,Output}

DataObject has implications which cover the possibility of being an
interior node of a structured data. RpcInput and RpcOutput are
explicitly excluded from that contract, similarly as BaseNotification
is.

Add FIXMEs to reconcile this modeling problem.

Change-Id: I84b6f5ca90cbfb685209559863f29634c5744772
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoMore use of instanceof patterns 59/103959/1
Robert Varga [Fri, 6 Jan 2023 22:28:26 +0000 (23:28 +0100)]
More use of instanceof patterns

Reduce the number of explicit casts by integrating them into instanceof
patterns, which leads to reduction of nested if statements in some
cases.

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