Robert Varga [Thu, 6 Feb 2025 19:50:31 +0000 (20:50 +0100)]
Convert binding-runtime-api to bnd-parent
Add a documentation and explicit export anchor, using more modern OSGi
integration.
Change-Id: I3ed50609856d074f0b74a5997dea03ef100d5bc7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 19:22:33 +0000 (20:22 +0100)]
Convert yang-data-codec-gson to bnd-parent
Improve the manifest and documentation a bit.
Change-Id: Ia8585c9d9fdc415737023763260df1aee4e6398f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 18:52:05 +0000 (19:52 +0100)]
Convert yang-data-codec-xml to bnd-parent
Improve the manifest and documentation a bit.
Change-Id: I9bf212f7ef06ba8335d5f01bb7fd463539b6baeb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 18:22:36 +0000 (19:22 +0100)]
Convert yang-data-codec-binfmt to bnd-parent
This is a trivial conversion, with the added twist of fixing up all
javadocs and enabling enforcement.
Change-Id: Ia2476a2bcf80402896a08ae965cb28b45f1474c8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 18:21:25 +0000 (19:21 +0100)]
Improve FIXME
Add the literal XML fragment to enable linting.
Change-Id: Ic7f4d26250daa3e28dfe9c7a0bced537e9f48544
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 13:33:41 +0000 (14:33 +0100)]
Migrate yang-data-tree-api to bnd-parent
This is mostly a trivial conversion, improving documentation very
slightly.
Change-Id: I59549275865c8669cbf3af46834ecac653c13a0b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 13:27:10 +0000 (14:27 +0100)]
Use correct annotation in data.tree.api.DataTree
We are using SpotBugs @Nullable here by mistake. Switch to using JDT
version.
Change-Id: I9ece015097920684445a0b08429a86c52c329806
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 13:24:40 +0000 (14:24 +0100)]
Migrate yang-data-spi to bnd-parent
This is a simple migration.
Change-Id: If08f6d956c845924ba145199d428f342aeaa1769
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 13:22:47 +0000 (14:22 +0100)]
Update yang-data-api description
We are using just the artifactId, this patch adds a bit more descriptive
description.
Change-Id: I258ea9b3014d5a7271791720813cf4b4d147f93a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 12:46:01 +0000 (13:46 +0100)]
Modernize yang-parser-rfc7950 a bit
Use AssertJ instead of the more obvious uses of Hamcrest.
Change-Id: I7ad281229f71132a60dc64b2f59c7cc5db502987
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 12:19:04 +0000 (13:19 +0100)]
Modernize yang-data-codec-xml tests
Use AssertJ instead of Hamcrest for most tests.
Change-Id: Idf87b126dce062f31c743d705119c5df5c52a9c1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 11:05:35 +0000 (12:05 +0100)]
Migrate binding-generator to JUnit5
This is the last holdout of JUnit4, migrate it.
Change-Id: Ib63ecc67c6d38d384552b10fb4948420533f3b86
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 07:27:12 +0000 (08:27 +0100)]
Ditch Hamcrest from binding-data-codec-dynamic
Use AssertJ for the three assertions we are making here.
Change-Id: I81caa38d384efdbe5a717da4936c948acaa4bc40
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 07:49:56 +0000 (08:49 +0100)]
Mass migrate to AssertJ
This performs a mass migration of most components from Hamcrest to
AssertJ.
Change-Id: I8f703ea9ed2190d2168255921c35370678d3d6d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 07:19:45 +0000 (08:19 +0100)]
Migrate to JUnit5 assertions
We have a few straggling places where we are still using JUnit4
assertions. Migrate all those places.
Change-Id: I3586f5d9b8b5dc5a5f294ab448bb1375be8cc550
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 08:13:05 +0000 (09:13 +0100)]
Convert binding-data-codec-api to bnd-parent
This is a straightforward conversion, improving the manifest and
eliminating warnings.
Change-Id: I35ed4fd5c4556d764866ff6325b1c097b07e4031
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 07:33:27 +0000 (08:33 +0100)]
Do not use Hamcrest in yang-data-codec-gson
Use AssertJ instead.
Change-Id: I3f78e1b71d0b0ce68116f6fb3e7b56fbccd957b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 07:26:50 +0000 (08:26 +0100)]
Correct a FIXME
The target package name should be codec.dynamic.ri, fix that.
Change-Id: Ia762c67ca85fb5c3f2f5119a33b3177241518630
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 5 Feb 2025 18:05:20 +0000 (19:05 +0100)]
Migrate binding-data-codec-dynamic to bnd-parent
Take ownership of our exports, marking their evolution now that they are
not tied to Felix export-unless-impl treatment.
Change-Id: Ic37742c0cabbcc815f92be300512d1390b915964
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 5 Feb 2025 16:27:22 +0000 (17:27 +0100)]
Migrate binding-data-codec-dynamic to JUnit5
This is a mass migration. Tests are updated to use assertInstanceOf()
and other JUnit5/Java goodies we have picked up since they were written.
Change-Id: Icc9886a0f31f3b359a29cb9232938babce92e0e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 20 Jan 2025 15:48:22 +0000 (16:48 +0100)]
Bump versions to 14.0.8-SNAPSHOT
This starts the next development iteration.
Change-Id: I73827230ee6144906c0382f0c2794faf30302389
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Mon, 20 Jan 2025 12:48:18 +0000 (12:48 +0000)]
Release yangtools
Robert Varga [Mon, 20 Jan 2025 11:41:24 +0000 (12:41 +0100)]
Bump byte-buddy to 1.16.1
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.16.0
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.16.1
Change-Id: Ia2355c3dba486f4c5a01021a89129c00dda7fc22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 16 Jan 2025 10:46:12 +0000 (11:46 +0100)]
Improve locking in InMemoryDataTreeModification
Not all state transitions in InMemoryDataTreeModification require locking,
as read threads does not touch ModifiedNode once we move out of Ready.
This means synchronization is needed only for Ready -> AppliedSnapshot
and Ready -> Prepared transitions. After that we can access the
modification without any locking.
Write threads are required to coordinate between themselves, and
therefore AppliedSnapshot -> Prepared and any subsequent
validate/prepare transitions do not need locks as well.
JIRA: YANGTOOLS-1651
Change-Id: Ida55be0deeba69e18d9b52ad0c8a7eb6a32f7af0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 17 Jan 2025 10:30:44 +0000 (11:30 +0100)]
Expand YT1655Test
Show that versions are retained for untouched modifications.
JIRA: YANGTOOLS-1655
Change-Id: I97316698c3fa51eb3418019db631e7d4fce22a15
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 17 Jan 2025 10:16:42 +0000 (11:16 +0100)]
Improve InMemoryDataTreeModificationTest
We have a few gaps in test coverage which can be addressed without doing
inter-thread heroics. This patch addresses them.
Change-Id: Ifde6c7778ff422d75a941efe43c747a08adde709
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 9 Jan 2025 08:44:31 +0000 (09:44 +0100)]
Add MemoryDataTreeModification.Prepared
When a modification completes prepare(), it is effectively cast in
stone, unless prepared again, hence we should treat it that way from
newModification().
This ensures that once prepare() completes, all calls to
newModification() will not touch the ModifiedNode tree.
JIRA: YANGTOOLS-1651
Change-Id: I9e1a41ac8bc7f65894b04f8e3e46006e9e023320
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 16 Jan 2025 11:04:02 +0000 (12:04 +0100)]
Enable applyToSnapshot() in Defunct state
Downstreams are catching exceptions thrown by ready() and recovering via
applyToCursor(). Fix that functionality by retaining the tree.
JIRA: YANGTOOLS-1651
Change-Id: Icbdc90058af1da4c2053d2af87dcc3b85f62aa26
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 15 Jan 2025 20:12:47 +0000 (21:12 +0100)]
Improve Bug4295Test assertions
We are missing out on free test coverage that comes with minor
investment.
Provide expected child count for subtrees, exercising
ModifiedNode.modifiedChildre().size().
Also assert 'o' and 'o-id' leaf values via
ModifiedNode.modifiedChild(), improving coverage thereof.
JIRA: YANGTOOLS-1651
Change-Id: I8f4d3dc3549e2054f876f7efa99a0ff28e2f4994
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 9 Jan 2025 08:38:46 +0000 (09:38 +0100)]
Log InMemoryDataTreeModification transitions
InMemoryDataTreeModification performs a number of operations either
concurrently or locked. Log these transitions at TRACE level.
JIRA: YANGTOOLS-1651
Change-Id: Idbe4f97467c970a2c737cd7587da589fc2c720c7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 9 Jan 2025 02:56:52 +0000 (03:56 +0100)]
Introduce InMemoryDataTreeModification.AppliedToSnapshot
Once we complete ready(), the user side of DataTreeModification is free
to invoke applyToCursor() and newModification() methods.
Introduce AppliedToSnapshot, which we enter into when we first observe
Ready state in newModification(). Any subsequent calls to
newModification() will just pick up snapshot root from AppliedToSnapshot
without touching ModifiedNode -- and thus we do not need any further
locking.
For the applyToCursor() path we may be racing with validate()/prepare(),
so perform that operation with the exclusive lock.
This brings more clarity as to what ModifiedNode.children is now and how
it should behave in the future -- which we thoroughly outline in FIXMEs.
JIRA: YANGTOOLS-1651
Change-Id: Icfb55beba97d9432e444df87631a03975bebb8e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 15 Jan 2025 11:07:36 +0000 (12:07 +0100)]
Guard empty children
Switch backing implementations when we encountere an empty child map,
making empty HashMaps more readily reclaimable.
This improves our ability to spot state errors, such as we just solved,
at least for obvious situations.
JIRA: YANGTOOLS-1651
Change-Id: I500b8e8758c7499af777773409ec16615da4294a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 27 Dec 2024 18:37:08 +0000 (19:37 +0100)]
Do not tolerate non-ModifiedNodes
ModifiedNode is sealed with only a single permitted subclass. Remove the
warning and run a plain verification instead. This will pop up if we
decide to extend the class hierarchy in the future.
Change-Id: Ida5e72ea5e36fc5f0dbeff7e97db569b87228de3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 10 Jan 2025 22:17:05 +0000 (23:17 +0100)]
Introduce InMemoryDataTreeModification.Defunct
We use 'Sealing' as a transitional state indicating not-Open, but do not
update it if something bad happens -- leaving no evidence of the
failure for future reference.
Introduce a Defunct state, which carries the evidence of the failure
along with the name of the thread that incurred it.
Since this is the second singleton State object, introduce
SingletonState to hold the common bits.
JIRA: YANGTOOLS-1651
Change-Id: Icdda877c576611ed86391cfe149c5cc385061830
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 8 Jan 2025 20:28:47 +0000 (21:28 +0100)]
Unify state transition error reporting
We have Illegal{Argument,State}Exception reported inconsistently when
we detect unhandled State.
This patch introduces illegalState() utility method, which unifies the
message reported and optionally propagates Defuct.cause.
JIRA: YANGTOOLS-1651
Change-Id: Idbc4dcb6fc3619596b11ec9989dea032d620d3dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 8 Jan 2025 18:31:53 +0000 (19:31 +0100)]
Introduce InMemoryDataTreeModification.Noop
The set of operations in a modification is defined as set when user
calls DataTreeModification.ready() and therefore we can check for
LogicalOperation.NONE before we complete the Open -> Ready transition.
This allows us to split out a singleton Noop state to represent a empty
modification and recognize it in newModification()/validate()/prepare()
so these run completely concurrently.
Since this is the second singleton State object, introduce
abstract SingletonState with a common toString().
JIRA: YANGTOOLS-1651
Change-Id: Ieb2700aa3673a5d305f618aae4cf8249e05d4133
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 10 Jan 2025 19:01:22 +0000 (20:01 +0100)]
Do not modify sealed ModifiedNode.children
ModifiedNode.children track child logical operations, forming a tree of
operations for a particular DataTreeModification.
These were originally designed to be unmodifiable after seal(), so
that they can be traversed without taking any locks -- i.e. a ready
DataTreeModification can examine these without further concerns, for
example to replicate itself into a DataTreeModificationCursor.
This design was unfortunately broken during YANGTOOLS-501 development,
where we moved MERGE node expansion from ready() to prepare()-time by
having AbstractNodeContainerModificationStrategy issue modifyNode().
The nodes created in this expansion are only needed for
DataTreeCandidate's view of what changed.
This patch opts to store these children in a separate field, just as we
do for ModificationType, validated snapshots, etc., restoring
immutability of ModifiedNode.children.
This means we can run DataTreeModification.applyToCursor() without
holding any locks whatsoever -- which we express by having the utility
methods involved there operate on NodeModification only.
JIRA: YANGTOOLS-1651
Change-Id: Ic89f262d8bf3b7cab5a7dd958d586804538c4bfb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 14 Jan 2025 14:06:05 +0000 (15:06 +0100)]
Unify read{Node,VersionInfo) code
We have copy&paste of the same setup code. Introduce a resolveSnapshot()
method, which unifies the lookup.
JIRA: YANGTOOLS-1651
Change-Id: Ibf2138a9fe006e9fc368a4b0ebf35a983fe989cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 13 Jan 2025 22:31:35 +0000 (23:31 +0100)]
Refactor Bug4295Test
We have a test covering the various merge scenarios, but it lacks
reasonable assertions. This refactors the test and adds a number of
assertions.
JIRA: YANGTOOLS-1651
Change-Id: If2b2f6273c379700bec43fa33b843a54342c7101
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 28 Dec 2024 12:16:59 +0000 (13:16 +0100)]
Introduce InMemoryDataTreeModification.State
InMemoryDataTreeModification is a nexus of multiple code paths, each
accessing differing aspects of a ModifiedNode.
This patch encapsulates rootNode in a State object, so that a state
check is required before we act on the rootNode.
We initially have only the states mirroring the
STATE_{OPEN,SEALING,SEALED} constants, but more states are expected to
be introduced by follow-up patches.
toString() method is adjusted to dump state, but states no longer dump
the entirety of the ModifiedNode, to prevent OOMs when toString() is
called on large modifications as part of logging/error reporting.
Add InMemoryDataTreeModificationTest to test state transitions and their
expectations.
JIRA: YANGTOOLS-1651
Change-Id: I30a83b1944a3e27f56b243e6c64d4f8fa1b08d25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 13 Jan 2025 09:37:36 +0000 (10:37 +0100)]
Split AbstractMutableContainerNode.seal()
We have three possibilities here, sharing the same tail code. Split the
implementation out to aid inlining.
Change-Id: I74232b84c8bb363bfbc1de9b2bfb5ccda52c15f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 12 Jan 2025 20:12:17 +0000 (21:12 +0100)]
Rename getChildFromData()
Drop the 'get' prefix because we can return a null, which does not sit
well with our 'foo/getFoo/findFoo' patterns.
JIRA: YANGTOOLS-2399
Change-Id: Iabc2a51ff5baf19a901e8b20504c8c7cbfea5d26
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 12 Jan 2025 18:39:39 +0000 (19:39 +0100)]
Rename TreeNode.version() to incarnation()
'version' and 'subtreeVersion' are a tad confusing, especially now that
we have VersionInfo -- which is carried in 'subtreeVersion'.
Rename 'version' to 'incarnation' whereever TreeNode view is concerned
and document it its relationship with NormalizedNode.
JIRA: YANGTOOLS-2399
Change-Id: I305eacfedec3b7ebf60c9c7296fc39081d94d339
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 11 Jan 2025 02:45:13 +0000 (03:45 +0100)]
Fix versionInfo storage
DataTreeSnapshot.readVersionInfo() should report the last commit that
modified the NormalizedNode view of a TreeNode. That corresponds to
TreeNode.subtreeVersion(), as correctly used by readInfo() callers.
Fix the sole writeInfo() caller's confused use of TreeNode.version().
JIRA: YANGTOOLS-1655
Change-Id: Id4d35e4f5001f7f4e4cabdf5c503399b3c1bca46
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 10 Jan 2025 13:36:11 +0000 (14:36 +0100)]
Split InMemoryDataTreeModification constructor
Exposed method has two parts: acquiring inputs and initializing internal
state. Split the initialization part into a private constructor.
JIRA: YANGTOOLS-1651
Change-Id: I3885ecca2b07fa4a97aaee42c5994cc9c36cc209
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 10 Jan 2025 13:18:09 +0000 (14:18 +0100)]
Remove ModifiedNode.createUnmodified()
We do not have a public constructor, let's promote it to a
package-private constructor.
JIRA: YANGTOOLS-1651
Change-Id: I82abde5ded31bab3351b2450f97f8ab2c2adf608
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 16 Sep 2024 21:07:22 +0000 (23:07 +0200)]
Improve CachingDerivedString memoization
Use a VarHandles and acquire/release mechanics to eliminate unneeded
global ordering.
Change-Id: I3f20d68906fe180ca771aafba2ee007af839ea09
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 8 Jan 2025 12:26:47 +0000 (13:26 +0100)]
Use assertInstanceOf()
We have an assertTrue() which really wants to be an assertInstanceOf().
Change-Id: I6a504b56a550bfd5d239bc7a881c59cae0863037
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 9 Jan 2025 13:50:29 +0000 (14:50 +0100)]
Enforce strict mocking in yang-data-tree-ri
We are using mocks to check interactions. Make sure we fail on anything
that is not stubbed.
Change-Id: Ieb1db784a7f2b1e9e205b12aef14445b194677cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 7 Jan 2025 14:09:56 +0000 (15:09 +0100)]
Synchronize InMemoryDataTreeModification transitions
The three methods marked here all mutate ModifiedNode, with
newModification() happening concurrently with validate() and prepare().
This patch introduces a heavy-weight guard to prevent concurrent access,
so we serialize access between the threads.
It is not a complete solution, as newModification() can still
interfere wreck state inside a prepare()d candidate -- and we will deal
with that in a follow-up patch.
JIRA: YANGTOOLS-1651
Change-Id: If2132b3a6ac51c72dd8380b2ffdfb49158f023e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 27 Dec 2024 17:13:37 +0000 (18:13 +0100)]
Do not leak Modifiednode to AbstractDataTreeTip
ModifiedNode is an implementation detail of a particular
InMemoryDataTreeModification, as that is the entry where DataTree
meets DataTreeModification.
Move AbstractDataTreeTip implementations to
InMemoryDataTreeModification, eliminating getRootModification(),
so state management is completely orchestrated between
InMemoryDataTreeModification and ModifiedNode.
JIRA: YANGTOOLS-1651
Change-Id: I304ae91eca16e186093efa269a94fea9672fe9d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 9 Jan 2025 02:13:52 +0000 (03:13 +0100)]
Simplify checkIdentifierReferencesData()
YangInstanceIdentifier.getLastPathArgument() returns null only when
isEmpty() is true. Do not check isEmpty() and fill in root name if we do
not get a PathArgument.
Change-Id: Ib174f06b2382ec834bfd62bf020928514fb7b2a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
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>