Robert Varga [Wed, 8 Jan 2025 13:34:59 +0000 (14:34 +0100)]
Improve resolveChildModification()
Use local variable type inference to strongly bind to ArrayList,
ditching a reference to Collection.
Change-Id: I180a02461d1ba851ebc36a10d33c0e0fbedc5893
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 27 Dec 2024 18:22:51 +0000 (19:22 +0100)]
Warn when encountering non-ModifiedNode
We have a pass-through here, which really ends up being an undefined
state transition: we certainly do not know the state proposed.
Promote the LOG.debug() to LOG.warn() and include a stack trace to flush
out offenders.
JIRA: YANGTOOLS-1651
Change-Id: I7481aa1a8302308990392b0d6b374e41ef3e1316
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 8 Jan 2025 10:21:59 +0000 (11:21 +0100)]
Fixup ModifiedNode references
getOriginal() has been replaced by original(), fix references in
javadocs.
Change-Id: I84d609a74aebf8306df04057c498f3cb16510fb1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 7 Jan 2025 00:07:22 +0000 (01:07 +0100)]
Introduce concepts.AccessControllerCompat
java.security.AccessController is going away, while we have a few users.
This patch promotes binding.loader.SecuritySupport to
concepts.AccessControllerCompat and reuses it in
binding.reflect.StringValueObjectFactory.
Change-Id: If958e2ef0dfdce0d76cc4e4a34f5c66c516918fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Jan 2025 16:59:26 +0000 (17:59 +0100)]
Improve BindingClassLoader.create(...)
We have an mandatory and an optional part here. Let's use a Builder with
java.nio.Path internally.
This ends up making BindingCodecContext loading a tad more obvious, as
we configure a JVM-wide Builder and then just call build() -- amortizing
internal loading stuff.
Also improve forward compatibility: when we run with Java 24, we assume
AccessController indirection is a no-op as per JEP-486 and do not touch
it -- thus making the code immune to AccessController not being
available in future versions.
JIRA: YANGTOOLS-1653
Change-Id: Ifc63b1fe4d85f8aef1d0d43f6535e849bebb9bf4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Jan 2025 23:04:43 +0000 (00:04 +0100)]
Modernize FilesystemSchemaSourceCache
Use java.nio.Path instead of java.io.File.
Change-Id: Ibc28950f5969ae953d83cd1522734a9584f01c4c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Jan 2025 22:21:42 +0000 (23:21 +0100)]
Modernize yang-data-codec-gson tests
Use NIO Path instead of OIO File.
Change-Id: Idc18ad0f875f192e8639ae9fec0183e5fff17993
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Jan 2025 22:17:25 +0000 (23:17 +0100)]
Modernize SystemTestUtils
Use nio.Path instead of io.File.
Change-Id: I7c4d688b0eeb600799254d0aae21d67632e31c1f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Jan 2025 15:31:30 +0000 (16:31 +0100)]
Use Java 19+ (Linked)HashMap instantiation
Java 19 has introduced HashMap.newHashMap(), which is going to be
flagged by modernizer-maven-plugin. Migrate from Guava's Maps methods
to these new methods.
Change-Id: I3ed61c184450f96a879756d41757f0ec16283b14
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Jan 2025 19:35:15 +0000 (20:35 +0100)]
Modernize MockitoExampleTutorialTest
Use Path instead of File, keeping modernizer happy.
Change-Id: I068a3bb3245ad2ef4d78d1bbec91678222753b8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Jan 2025 19:27:37 +0000 (20:27 +0100)]
Modernize MikitoTest
Use Path instead of File, modernizing to use of NIO constructs.
Change-Id: I02cd5f004f259346b7a057179e3bc4884a8c813f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Jan 2025 16:00:36 +0000 (17:00 +0100)]
Use Path.of() instead of new File()
Modernizer is pushing us towards Path-based addressing, this patch
addresses those violations.
Change-Id: I3b176b5ad1043b403a2600bae6886dae61375018
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Jan 2025 16:39:18 +0000 (17:39 +0100)]
Use Files.new{Input,OutputStream()
Do not reference File{Input,Output}Stream directly, use more modern
means of achieving the same.
Change-Id: Ia0babfa56e4225279d3aac66587e713402479d72
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Jan 2025 16:17:36 +0000 (17:17 +0100)]
Modernize SimpleModuleTest
Hide this class and use NIO2 methods instead of File, so that modernizer
is happy.
Change-Id: I379f687fef91f8805b5f730b4d651919122ebe2a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Jan 2025 16:03:59 +0000 (17:03 +0100)]
Hide TagTest
We have warnings around @Test not being exported, fix them by hiding the
sole test here.
Change-Id: I83ffdbe10cc394eced545d35b1db9f48a6a0f95f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Jan 2025 12:54:55 +0000 (13:54 +0100)]
Bump byte-buddy to 1.15.11
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.11
Change-Id: I48fc07556e803037256321a90a8099531351df67
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 6 Dec 2024 15:17:15 +0000 (16:17 +0100)]
Bump Xtend to 2.37.0
https://eclipse.dev/Xtext/releasenotes.html#/releasenotes/2024/11/19/version-2-37-0
Change-Id: If67bdaff39ba62eb3e2adfcdc27b28be92e82ffd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 29 Nov 2024 16:01:42 +0000 (17:01 +0100)]
Bump versions to 14.0.7-SNAPSHOT
This starts the next development iteration.
Change-Id: I36fc09fda3747de8eef95f434bd226a603ed4022
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Fri, 29 Nov 2024 13:29:23 +0000 (13:29 +0000)]
Release yangtools
Robert Varga [Thu, 28 Nov 2024 13:34:33 +0000 (14:34 +0100)]
Fix variable naming
Sonar is right to complain about variable naming, fix that up.
Change-Id: Ib80598914ec6ef911d94fdb9af28cfefdbf49df3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 28 Nov 2024 13:35:07 +0000 (14:35 +0100)]
Migrate UnionValueOptionContextTest
Use JUnit5 and eliminate two naming violations.
Change-Id: I2bf41be225d989ab71b1f54f472ae46e4559233f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 28 Nov 2024 10:17:37 +0000 (11:17 +0100)]
Bump odlparent to 14.0.5
Adopt latest upgrades from upstream.
Change-Id: I10ccf618df6f6e3141044468d51d470e9c5a512f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 28 Nov 2024 12:37:47 +0000 (13:37 +0100)]
Fix checkstyle violations
Upgraded checkstyle is finding new violations, fix them up.
Change-Id: I73edd14299abcab3e3f679af0dd49379f2e287fd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 28 Nov 2024 12:47:38 +0000 (13:47 +0100)]
Remove unused dependency
We are not using yang-xpath-api anymore, remove the reference to it.
Change-Id: Iea85edfd86d70644745ad8374bc0ae0111c3fcbb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 21 Nov 2024 12:00:52 +0000 (13:00 +0100)]
Migrate binding-codegen to JUnit5
Migrate away from JUnit4/Hamcrest.
Change-Id: I90a48c4924015abc989bad91d339471771c358e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 28 Nov 2024 09:43:03 +0000 (10:43 +0100)]
Clean up AssertJ import
Use static import of assertThat().
Change-Id: Iaba5c4b5934dd6573c8dd880cca15a34a033eeb0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 21 Nov 2024 10:43:14 +0000 (11:43 +0100)]
Migrate binding-model JUnit5
Migrate away from JUnit4. We also ditch Hamcrest.
Change-Id: I3dd8a9a00f555fcad87e39d134cc9c74c4883cb5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 13 Nov 2024 09:29:15 +0000 (10:29 +0100)]
Bump byte-buddy to 1.15.10
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.6
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.7
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.8
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.9
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.10
Change-Id: I011e39da60bd5fa0ab6a53de8ac776a1888a84fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 17 Oct 2024 18:36:13 +0000 (20:36 +0200)]
Make Cardinality a record
Cardinality is holding just two numbers, turn it into a record, which
reduces ceremony a bit.
Change-Id: I5ddadb167c411f3e63cc79b9cd09e6624c12e561
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 17 Oct 2024 18:29:56 +0000 (20:29 +0200)]
Summarize based on streams
Collectors.groupingBy() is quite poverful and allows us to create the
summary map using input streams, without iterating.
Change-Id: Ic660cd5bb7947ffc5c54558591a0e54f051f245e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 17 Oct 2024 18:15:21 +0000 (20:15 +0200)]
Eliminate SubstatementValidator.Counter
We can use Map.merge(def, 1, Integer::sum) instead, which performs the
same thing, without the need to have an explicit class.
Change-Id: I6e57cb23d6aecc1c9c9bac9ffb83026a6efe730f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 15 Oct 2024 15:21:49 +0000 (17:21 +0200)]
Override DataObjectReference.toLegacy()
We need to ensure we project KeyedInstanceIdentifier when asked to go to
legacy. This patch adds the overrides and corresponding tests.
Change-Id: Ib1edbde360ca59c34b0f4c7f199393ffa20b0d8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 17 Oct 2024 12:02:13 +0000 (14:02 +0200)]
Migrate TypeTest
Use JUnit5 and improve assertions.
Change-Id: I7ca9966b8040f138d763f5161376ca0b7c71e997
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 17 Oct 2024 12:00:07 +0000 (14:00 +0200)]
Migrate JavaTypeNameTest
Migrate to JUnit5 and improve test assertions.
Change-Id: Iaee4efab3a078845c3fb446812b5c4f7cb9d6efd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 17 Oct 2024 11:51:07 +0000 (13:51 +0200)]
Migrate ListEqualsTest
Migrate to JUnit5 and use BindingMap.of().
Change-Id: Id6313948e0b53d15278799d38ed78920f9dd78d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 17 Oct 2024 11:34:49 +0000 (13:34 +0200)]
Bump byte-buddy to 1.15.5
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.5
Change-Id: Ib1acf43e90d506e5675f4516b944af2bc020e20d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 15 Oct 2024 15:22:48 +0000 (17:22 +0200)]
Bump byte-buddy to 1.15.4
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.4
Change-Id: Idc85d932f354563b428a67fc46c527d7d8643212
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 12 Oct 2024 07:27:18 +0000 (09:27 +0200)]
Up date project description
We now include binding, be sure to mention it.
Change-Id: I53272def1858ee0644fdac21da7259433aeb9596
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 11 Oct 2024 20:37:41 +0000 (22:37 +0200)]
Remove test exception throws
SonarCloud is pointing out superfluous throws declarations, remove them.
Change-Id: Ie816e416db85cd8b793ad2c97fb288d0d00b83c9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Oct 2024 04:38:35 +0000 (06:38 +0200)]
Use List.getFirst()/getLast()
Take advantage of sequenced collections, improving our production code
a bit.
Change-Id: I8ab1c0dd9227da58c67f6b8205a82ca902f5791f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Oct 2024 05:37:47 +0000 (07:37 +0200)]
Bump versions to 14.0.6-SNAPSHOT
This starts the next development iteration.
Change-Id: Id903f1094401453974d212be68a1eca27758750c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Wed, 9 Oct 2024 03:12:51 +0000 (03:12 +0000)]
Release yangtools
Robert Varga [Tue, 8 Oct 2024 13:07:46 +0000 (15:07 +0200)]
Adjust yangtools-docs with binding
We need to include more artifacts, update docs projects accordingly.
Change-Id: I60ec822a6302ed0e6ed091e37813a330b2f57243
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Oct 2024 09:24:37 +0000 (11:24 +0200)]
Update tests
We are about to switch serialization proxies, update tests to show how
the format changes.
Change-Id: I6b448891519a374dc53a24fa48f1455b3c6078dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 7 Oct 2024 19:59:41 +0000 (21:59 +0200)]
Bump odlparent to 14.0.4
Pick up latest upgrades from upstream.
Change-Id: Ic6a5e705dba9a390efbdd979c049a28e75997702
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 7 Oct 2024 20:07:47 +0000 (22:07 +0200)]
Fixup javadoc formatting
Upgraded checkstyle is actually enforcing our Javadoc policy w.r.t.
<p> tag statement. Fix offending code.
Change-Id: I376834adf9139c885e94e116e905ae02b8445406
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 1 Oct 2024 07:26:02 +0000 (09:26 +0200)]
Bump byte-buddy to 1.15.3
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.3
Change-Id: Ifdccd721735a883242a3caea85a159e9a1b76671
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 27 Sep 2024 15:12:15 +0000 (17:12 +0200)]
Bump byte-buddy to 1.15.2
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.2
Change-Id: Ib02a9165a8d22462b0118e42abc47746b01ed451
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 13 Sep 2024 14:50:02 +0000 (16:50 +0200)]
Expose BindingDataContainerWriter
We somehow lost the ability to emit stream events directly into a
NormalizedNodeStreamWriter. This patch restores it.
JIRA: YANGTOOLS-1648
Change-Id: Id8f517c3534ec2dc64c2046462648fab4e849cae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 24 Sep 2024 07:46:14 +0000 (09:46 +0200)]
Bump Xtend to 2.36.0
https://eclipse.dev/Xtext/releasenotes.html#/releasenotes/2024/08/25/version-2-36-0
Change-Id: I404aa90b16a947475ed48782eaef93d80ece16ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 17 Sep 2024 07:27:23 +0000 (09:27 +0200)]
Define a serialization proxy for yang.common.Empty
Empty's serial form is tied to its layout. This defines a serialization
proxy which can be used to disconnect it and provide forward
compatibility.
JIRA: YANGTOOLS-1647
Change-Id: Ie13d5907e1b94cd96b10dc25a3633139548f8209
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 16 Sep 2024 09:20:43 +0000 (11:20 +0200)]
Deprecate simple DataTreeFactory.create()
We cannot quite guarantee DataTree operation without an
EffectiveModelContext. This patch deprecates the simple method, steering
users towards method which require it.
Change-Id: I2b3f6c6802aed1892113e6d32c131a341a6323ed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 16 Jun 2024 04:30:45 +0000 (06:30 +0200)]
Add Uint{8,16,32,64} and Decimal64 serialization proxies
Define serialization proxies for common types. This allows us to provide
compatibility with types serialized in future versions.
JIRA: YANGTOOLS-1647
Change-Id: I36a001a5af37c0c882e7fbb37e55ad379678b6e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 15 Sep 2024 15:06:03 +0000 (17:06 +0200)]
Eliminate MutableTreeNode.setSubtreeVersion()
Each call to TreeNode.toMutable() is followed by a call to
setSubtreeVersion(). Push the subtree version into toMutable() directly,
making the code a tad more compact.
JIRA: YANGTOOLS-570
Change-Id: I6ab52715bd6678563263d928611f1a5737ac5533
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 13 Sep 2024 14:40:01 +0000 (16:40 +0200)]
Remove RpcInputCodec
This interface used to have two unrelated implementations, but it only
has a single implementation now. Remove it to simplify things slightly.
Change-Id: I542e131e05f6a846ee1d8ba33d25e74744d9dc92
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 13 Sep 2024 14:38:46 +0000 (16:38 +0200)]
DataObjectCodecContext.serialize() should be final
We do not override this method anywhere, make sure to enforce it by
making it final.
Change-Id: Ia74c8625aca997e12ca80c046469dba1756d5818
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 2 Sep 2024 11:49:19 +0000 (13:49 +0200)]
Bump versions to 14.0.5-SNAPSHOT
This starts the next development iteration.
Change-Id: If0c33f3b32eed7e1b4050e6eb804507b1e145a62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Mon, 2 Sep 2024 09:42:42 +0000 (09:42 +0000)]
Release yangtools
Robert Varga [Mon, 2 Sep 2024 09:12:38 +0000 (11:12 +0200)]
Expose org.opendaylight.yangtools.binding.data.codec.impl again
This partially reverts
4c790297d02f82d750db09531f350b3ea813d287, so that
unit tests work.
JIRA: YANGTOOLS-1646
Change-Id: I477d4cbb1e45b6b0040831b101587e18cd5b2da8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 30 Aug 2024 19:17:53 +0000 (21:17 +0200)]
Bump versions to 14.0.4-SNAPSHOT
This starts the next development iteration.
Change-Id: I2192feca61338309170ead196b79162ebe49af56
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Fri, 30 Aug 2024 17:41:17 +0000 (17:41 +0000)]
Release yangtools
Robert Varga [Fri, 30 Aug 2024 16:48:52 +0000 (18:48 +0200)]
Bump odlparent to 14.0.3
Pick up latest updates.
Change-Id: Ib65cd95e46e8867da7d451888b95fca75f24eed1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 30 Aug 2024 12:42:00 +0000 (14:42 +0200)]
Bump byte-buddy to 1.15.1
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.1
Change-Id: Ic780564d53b504190fc111b0cbb761af56057257
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 25 Aug 2024 05:52:29 +0000 (07:52 +0200)]
Bump byte-buddy to 1.15.0
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.19
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.0
Change-Id: I734f095e9f397b113979a8863101e6d1ab375d07
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 1 Aug 2024 22:23:20 +0000 (00:23 +0200)]
Improve BindingClassLoader.toString() and equality
Improve BindingClassLoader.toString(), so that we:
- retain identity information, but use a consistent HexFormat string
- expose parent ClassLoader
- expose target from LeafBindingClassLoader
Also codify that a BindingClassLoader operates on object identity, so
there is no confusion about that fact, ever.
Change-Id: I1c9f968ff1e1bf4b4fc5b2a4a5dc64544f7ecfed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 1 Aug 2024 18:51:04 +0000 (20:51 +0200)]
Fix compareAndExchange() check
The witness value should be checked against 'local', as that is what we
expect.
Change-Id: Ie4e264e0b978e2cc9557e01e23f8200a4fe4febc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 1 Aug 2024 18:49:00 +0000 (20:49 +0200)]
Improve RootBindingClassLoader logging
Log isOurClass() exceptions on trace level to pollution. Add debugs
to point out which class loader we are using for which class.
Change-Id: I9f8eeab0e1fb222d2b40daba51eb7c86cf156d96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 1 Aug 2024 18:41:42 +0000 (20:41 +0200)]
Fix a nullness warning in RootBindingClassLoader
We have local which we may end up returning not marked as @NonNull. Fix
that.
Change-Id: Idbf59b005c5c5e4b2816d4474966af804bb786ab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 1 Aug 2024 11:01:44 +0000 (13:01 +0200)]
Do not expose binding.data.codec.impl
These are implementation internals and should not be accessible from
outside.
Change-Id: I2a17caa3818ee8b2df80735d55ec3315f858daf7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 31 Jul 2024 21:43:09 +0000 (23:43 +0200)]
Remove BindingCodecTreeFactory
This class has been superseded by binding.data.codec.dynamic version of
it. Remove if from binding-data-codec-api, making the codec API
independent of binding-runtime-api.
JIRAL YANGTOOLS-1638
Change-Id: I127102ce7d580771c2a3b9f0cb14c27843a42061
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 31 Jul 2024 18:53:57 +0000 (20:53 +0200)]
Add (Dynamic)BindingDataCodec et al.
We have BindingDOMCodecServices, which provides:
- a consistent set of binding-data-codec-api services
- a BindingRuntimeContext
- (indirectly) a EffectiveModelContext
The first item is a binding.data.codec.api concern, which is addressed
by exposing BindingDataCodec, which exposes the individual services. It
also takes care of the third item via an explicit modelContext() method,
as yang.model.api is implied in the services we provide.
The second item is the assumption of a dynamic runtime, where
BindingRuntimeContext is readily available. This is exposed via
binding.data.codec.dynamic.DynamicBindingDataCodec.
BindingDOMCodecServices are deprecated in favor of using one of these
interfaces.
We also introduce binding.data.codec.dynamic.BindingDataCodecFactory,
which supersedes binding.data.codec.spi.BindingDOMCodecFactory, as this
is an assumption of dynamism.
binding-data-codec-osgi now explicitly requires
binding-data-codec-dynamic, which is appropriate w.r.t. to assumption of
BindingRuntimeContext being passed around.
JIRA: YANGTOOLS-1638
Change-Id: I7d44063b42c3cddaa39c1c7a8aa28e035bb130a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 28 Jul 2024 21:03:48 +0000 (23:03 +0200)]
Bump byte-buddy to 1.14.18
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.18
Change-Id: I254abd8ce16277c191cd7c2dd93eba49aaca8916
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 28 Jul 2024 13:43:37 +0000 (15:43 +0200)]
Bump versions to 14.0.3-SNAPSHOT
This starts the next development iteration.
Change-Id: I626563e5661e91245790c600f7ebce85f96a2dc9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Sun, 28 Jul 2024 12:05:44 +0000 (12:05 +0000)]
Release yangtools
Robert Varga [Sun, 28 Jul 2024 11:20:59 +0000 (13:20 +0200)]
Convert binding-loader to use bnd-parent
This is a nigh-trivial module, convert it to use bnd-parent. Also fixup
description a bit.
Change-Id: I35543143e4de825232c1ab8f6cfd6e8fae3c64f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 28 Jul 2024 08:33:09 +0000 (10:33 +0200)]
Do not specialize Grouping.implementedInterface()
Grouping is no longer a DataObject, hence its narrowed
implementedInterface() conflicts with DataObject when used in generic
type specification.
Do not narrow implementedInterface() in groupings.
JIRA: YANGTOOLS-1637
Change-Id: I3a907b2c6f8bc644d68a7aaf8efad3e56506081c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 26 Jul 2024 12:31:29 +0000 (14:31 +0200)]
Migrate AbstractGeneratedTypeBuilderTest to JUnit5
Clean up the test and use assertThrows().
Change-Id: I5113578d105ee4ba99529ad3ecec2aa4eb5371e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 25 Jul 2024 16:33:45 +0000 (18:33 +0200)]
Bump versions to 14.0.2-SNAPSHOT
This starts the next development iteration.
Change-Id: Ia1a29d72598c0694b4819c5b16d53c956a9d5eaf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Thu, 25 Jul 2024 13:37:47 +0000 (13:37 +0000)]
Release yangtools
Robert Varga [Thu, 25 Jul 2024 10:54:49 +0000 (12:54 +0200)]
Bump odlparent to 14.0.2
Pick up latest updates from upstream.
Change-Id: Ia021695b9bab708f28296670ac22c2a86852be5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 25 Jul 2024 11:23:49 +0000 (13:23 +0200)]
Convert yang-data-api to bnd-parent
This is a straightforward conversion, with @Exports matching
module-info.
Change-Id: I77207d1a445da1da576a222684632cd6220e98f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 25 Jul 2024 07:49:48 +0000 (09:49 +0200)]
Fix EnumerationTypeBuilder error message
We have a bit of a messy error message here, fix it up to provide
complete information.
Change-Id: Ic39a69036d333216a6700618a22ece03dfccea48
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 17 Jul 2024 15:37:54 +0000 (17:37 +0200)]
Grouping is a BindingObject
Generated groupings are using just Grouping, not DataObject, which has
the unfortunate effect of not allowing them to be specified as caching
specification -- as those require BindingObject.
Restore this ability by making Grouping extend BindingObject.
JIRA: YANGTOOLS-1635
Change-Id: I51591cd9b6cbf1d2fe9659389e441613fdf3b310
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Jul 2024 10:01:47 +0000 (12:01 +0200)]
Clean up binding-test-model tests
Modernize the tests a bit and hide them.
Change-Id: Ib6b9df83bc182194025aa65fbbbcc36849971c8e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Jul 2024 09:42:15 +0000 (11:42 +0200)]
binding.BaseIdentity is Serializable
Objects implementing BaseIdentity are used as values, for example in
ScalarTypeObjects, which are Serializable.
Prior to MDSAL-733 we used Class<? extends BaseIdentity> to pass values
around, which meant we relied on java.lang.Class being Serializable.
Adjust BaseIdentity to extend Serializable and make generated VALUE
implementations properly resolve to singletons.
JIRA: YANGTOOLS-1633
Change-Id: Ic7b759c55bf9091639a983b56341c481632328eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Jul 2024 11:28:09 +0000 (13:28 +0200)]
Bump versions to 14.0.1-SNAPSHOT
This starts the next development iteration.
Change-Id: Ia454315c6d5e1d8a8df95d754ac66d0e6d4844e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Tue, 16 Jul 2024 09:21:35 +0000 (09:21 +0000)]
Release yangtools
Robert Varga [Tue, 16 Jul 2024 08:29:49 +0000 (10:29 +0200)]
Make sure list keys are final
The class generated for a 'key' statement cannot be inherited, make sure
we mark it as final.
JIRA: YANGTOOLS-1632
Change-Id: Ic931143455a8baf2dd1089efc16fda6f5e56cc44
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 9 Jul 2024 08:29:29 +0000 (10:29 +0200)]
Do not generate QNAME constaints for Groupings
QNAME constant is not really needed, as there is nothing on data
addressing side to do. Futhermore, since static members are 'inherited',
this ends up leading to some augmentations having a QNAME member.
Do not add the constant in GroupingGenerator and adjust tests to pick up
the namespace they need from a stable location.
JIRA: YANGTOOLS-1577
Change-Id: Ic03c0d6980317bb8042b482efd03fb9befb00283
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Jul 2024 17:47:15 +0000 (19:47 +0200)]
Bump odlparent to 14.0.1
Pick up latest updates from upstream.
Change-Id: Id80f9997d53939a6aa1300f3422b3f6701d3159c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Jul 2024 17:05:40 +0000 (19:05 +0200)]
Add DataObject{Identifier,Reference}.builder() static methods
These methods mirror their YangInstanceIdentifier counterparts, but
route to alternative builders -- most notably
DataObjectIdentifier.Builder.
Attempting to use these is flushing a few bad things in builders, which
we also fix here.
JIRA: YANGTOOLS-1577
Change-Id: If09cdf49fdf924be3554e21e9064268b26fa1c5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Jul 2024 12:32:22 +0000 (14:32 +0200)]
Allow encoding to BindingInstanceIdentifier
Add BindingInstanceIdentifierCodec.toBindingInstanceIdentifier(),
providing a bridge from YangInstanceIdentifier to
BindingInstanceIdentifier.
JIRA: YANGTOOLS-1577
Change-Id: Ic042ce98dd41d7ce44725e810310b844acf75f6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Jul 2024 13:58:29 +0000 (15:58 +0200)]
Fix BindingCodecContext.getSubtreeCodec()
The implementation of getSubtreeCodec() has a leaky overlap with
InstanceIdentifierCodec's requirements -- and hence not returning valid
contexts.
Introduce lookupCodecContext(), which can return any manner of
CodecContext, use that in getSubtreeCodec(). getCodecContextNode() is
then a further filter on lookupCodecContext().
JIRA: YANGTOOLS-1577
Change-Id: Ia11ffcde2f9a6ee29599c5e4a35e129bd06f08dd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Jul 2024 15:42:51 +0000 (17:42 +0200)]
Remove AbstractDataObjectCodecContext
AbstractDataObjectCodecContext brings in bits of
CommonDataObjectCodecContext implementation into the picture, but it
really is its only specialization. Merge the two classes, adjusting
CodecDataObject accordingly.
JIRA: YANGTOOLS-1577
Change-Id: Iffe9b1981db6df974ab1a454f81aeaeca74c5656
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Jul 2024 14:22:05 +0000 (16:22 +0200)]
Allow ModuleRuntimeTypes to be looked up
We need the ability to lookup module root runtime type in order to
properly perform codec lookups -- for example when looking up a
top-level leaf.
JIRA: YANGTOOLS-1577
Change-Id: Ie2fd4b910d598b05c1d35bdb5489b8efb3f86bdb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Jul 2024 12:05:03 +0000 (14:05 +0200)]
Allow returning DataObjectReferences
toBinding() promises a DataObjectReference, hence we can remove the
check for KeylessStep -- resulting in DataObjectReference.
JIRA: YANGTOOLS-1577
Change-Id: I342f5b8d815542b558b1d088162c95feb49f0ca1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Jul 2024 11:45:36 +0000 (13:45 +0200)]
Fixup BindingInstanceIdentifierCodec
The argument here should be final, fix that.
JIRA: YANGTOOLS-1577
Change-Id: I2312307b80db570eae33849d2403848c176514f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Peter Suna [Fri, 12 Apr 2024 08:22:16 +0000 (10:22 +0200)]
Fix XSD pattern specifics
Replace XSD multi character escape and substraction group pattern
with compatible Java regex.
Create a test to reproduce the issue with converting XSD patterns
into Java-compatible regex.
JIRA: YANGTOOLS-1571
Change-Id: Iab302638c3a436058f6de1d5dd5abd6e76fc411c
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Robert Varga [Mon, 8 Jul 2024 18:42:21 +0000 (20:42 +0200)]
Update InstanceNotification mapping
InstanceNotification is capturing its parent, which can reasonably be
Grouping, which is not a DataObject.
The situation is not dissimilar to that of RpcInput/RpcOutput for
actions. There we generate a data anchor at the place of definition for
wide reuse -- but generate an interface for each instantiation in
non-grouping.
In this case, though, we cannot generate a DataObject, as we are
inherently tied to an instance identifier.
We therefore go the 'like a grouping' route, generating a reusable
interface, which is then inherited by all concrete instantiations.
JIRA: YANGTOOLS-1577
Change-Id: I54383bc2fe1d060d20911861297ec59d49ddbfc7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 9 Jul 2024 13:28:04 +0000 (15:28 +0200)]
Use Grouping as fieldsFrom() argument
fieldsFrom() is using DataObject, which has other implications than just
a grouping. Since we now have a dedicated construct, use that to mark
what is possible to pass down.
JIRA: YANGTOOLS-1577
Change-Id: If8ab18f26ac09ddc88cadc64fa4efddf15a821bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>