Robert Varga [Wed, 12 Jun 2024 17:18:57 +0000 (19:18 +0200)]
Use switch with patterns in YangInstanceIdentifierWriter
Do not use and if/else instanceof cascade, just switch with patterns.
Change-Id: Ic763d0a29ccbc8f1f877ff0958ec19c9760bacb4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 12 Jun 2024 16:59:59 +0000 (18:59 +0200)]
Use switch pattern in NormalizedNodePrettyTree
Use a type dispatch on the node instead of the usual if/else cascade.
Change-Id: Id23d55cf9a8b99db683f737cb5b37054957fb119
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 12 Jun 2024 16:51:05 +0000 (18:51 +0200)]
Use switch with patterns in NormalizedNodeWriter
Instead if/else cascade of instanceof checks, use a switch with pattern
matching to dispatch.
Change-Id: Ide0cee6168ea419f4584e4dc0074a27acf3fe44f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 12 Jun 2024 16:29:04 +0000 (18:29 +0200)]
Use pattern match in PotassiumDataOutput.writePathArgumentInternal()
Using a switch with patterns guarantees exhaustiveness and is more
readable.
Change-Id: I2afeff389d6b9a68ba6f3bc903a6ebbbe4ca493b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 12 Jun 2024 16:19:35 +0000 (18:19 +0200)]
Use pattern matching in PotassiumDataOutput.writeObject()
Rather than having an if/else cascade, use a switch with pattern
matching to dispatch on value type.
Change-Id: I801739b9f138cefe8272d6634532d9854c78469c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 12 Jun 2024 12:01:57 +0000 (14:01 +0200)]
Use patterns in InstanceIdentifierJSONCodec
Rather that doing an if/else cascade, use a switch with instanceof
patterns to dispatch.
Change-Id: I361dba4acfc18265bef9463121ad46cdb4ad4aa9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 12 Jun 2024 12:00:58 +0000 (14:00 +0200)]
Use pattern match in JsonParserStream
Rather than doing an if/else, use a switch with patterns to adapt the
parent node.
Change-Id: I69791ccb2441a1a3d3ff6f50e086dd4955734d3e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 28 May 2024 17:08:11 +0000 (19:08 +0200)]
Adopt odlparent-14.0.0-SNAPSHOT
odlparent-14 allows us to target Java 21. This patch adopts a snapshot
version to allow us to deliver subsequent changes.
Change-Id: Ida26a3e50b3d27bd9c10fed06f9d610ad85f8b36
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 12 Jun 2024 09:44:19 +0000 (11:44 +0200)]
Remove SourceIdentifier.LOG
This field is not used anywhere, remove it.
Change-Id: I913c1ad5e1e1d93312d6566694fca8c7ccd287b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Jun 2024 10:54:09 +0000 (12:54 +0200)]
Centralize 'cannot interpret'
Sonar is complaining about duplicates, centralize exception allocation
to keep it happy.
Change-Id: If383e924561a9b9c41d9f90593369008d4495758
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Jun 2024 10:53:28 +0000 (12:53 +0200)]
Centralize unexpect token literal
Sonar complains about duplication, centralize allocation.
Change-Id: Ia1fc1b5cc8dd71c3fd5358b1dde7d31993c2037f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Jun 2024 10:43:10 +0000 (12:43 +0200)]
Centralize 'unsupported original' IAE
Sonar complains about literal duplication, let's fix that by using a
dedicated method for IAE allocation.
Change-Id: I2ceac05839c0e43c25c898d2643a0244c65174d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Jun 2024 10:38:33 +0000 (12:38 +0200)]
Centralize IAE message
Sonar is complaining about us using the same literal three times. Fix
that by allocating the exception in a dedicated method.
Change-Id: I5636943c75fbc0b8e6bea7b069485c724e150973
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Jun 2024 10:33:41 +0000 (12:33 +0200)]
Yet another round of Sonar issue fixes
Fix more unused throws declarations and unused variables.
Change-Id: I17d6c584e761347bb2098c2bd2ddbbe9fd1c337d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Jun 2024 09:07:06 +0000 (11:07 +0200)]
Another round of Sonar warnings fixes
Eliminate unused exception declarations.
Change-Id: I951e0911e754d3e7e455938b276c473a598cbc62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 4 Jun 2024 14:21:11 +0000 (16:21 +0200)]
Clean up more Sonar warnings
This removes unused exception throws and similar minor complaints.
Change-Id: Idf43b899700e875f164c3a8e763b0c82c47664de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 4 Jun 2024 13:09:31 +0000 (15:09 +0200)]
Remove unused throws declarations
SonarCloud is reporting a ton of unused throws declarations. This patch
makes a dent in them.
Change-Id: Iff2e75a2126dfb3b63a72401688c9ed50631f197
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 4 Jun 2024 12:46:04 +0000 (14:46 +0200)]
Remove ContainerSchemaNodes
This class has been deprecated for quite some time, with replacements
directly integrated into {Notification,Operation}Definition. Remove it
now.
Change-Id: I576e5c8f129038219b091f98415d08a7d694fe6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 4 Jun 2024 12:36:10 +0000 (14:36 +0200)]
Remove deprecated YangVersion methods
Both parse() and getReference() have been deprecated since
yangtools-11.0.0. Remove them now.
Change-Id: Ifd2ddf31f529026cae571ad73c51403fe313aa23
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 4 Jun 2024 12:34:10 +0000 (14:34 +0200)]
Remove Revision.Proxy
This is the legacy serialization proxy, which has been superseded in
last major release. This patch removes it.
Change-Id: I880ea5cdac71668fac82c53742c38463ad0ae331
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 4 Jun 2024 12:32:55 +0000 (14:32 +0200)]
Remove deprecated QNameModule methods
We have a number for deprecated .create() methods, remove them.
Change-Id: I61c5c8b38037abb3b80e922498c3329d97c951e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 8 Dec 2023 16:39:50 +0000 (17:39 +0100)]
Remove ListenerRegistration and ListenerRegistry
This interface has been deprecated. ListenerRegistry has been replaced
with ObjectRegistry.
Remove both these classes and all of the supporting scenery.
JIRA: YANGTOOLS-1552
Change-Id: Ie583ce23c5bd645845ea979b047731ad82ab43f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 3 Jun 2024 16:45:32 +0000 (18:45 +0200)]
Remove Listener{Registration,Registry} and related classes
ListenerRegistration has tight coupling to EventListener, which we are
not using anywhere. Remove this interface along with its
implementations.
ListenerRegistry relies on it, but has a more powerful replacement in
ObjectRegistry, so we remove that as well.
JIRA: YANGTOOLS-1552
Change-Id: Iba4da09f4a76615c643b266fc293e5f99afb4204
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 2 Apr 2024 08:56:42 +0000 (10:56 +0200)]
Specialize JSONCodec to JSONValueWriter
Completely disconnect JSONCodec from JsonWriter, eliminating the
deprecated method.
JIRA: YANGTOOLS-1568
Change-Id: I41f7426a11e76e90d717a898dfc916141e05ebf4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 1 Apr 2024 18:36:39 +0000 (20:36 +0200)]
Specialize JSONCodec to Void input
We do not take any input, not some vague Object. Specialize to
java.lang.Void, of which there is only the null instance.
JIRA: YANGTOOLS-1568
Change-Id: Ia7cda3f485b07d56b9986f689635fbcca1025a65
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 4 Apr 2024 00:47:24 +0000 (02:47 +0200)]
Remove UnknownTypeDefinition
This type is not really used anywhere, remove all references to it.
Change-Id: If2ae1b89144419adf1115235e840145169f40392
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 3 Jun 2024 15:16:32 +0000 (17:16 +0200)]
Bump versions to 14.0.0-SNAPSHOT
This starts the next major development iteration.
Change-Id: I716788d312e1b1240f7861a59646c4333373992e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 3 Jun 2024 15:15:37 +0000 (17:15 +0200)]
Bump versions to 13.0.7-SNAPSHOT
This starts the next development iteration.
Change-Id: I93fea828d23b4038b7700a0f949d4fa5920aebe9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Mon, 3 Jun 2024 14:03:05 +0000 (14:03 +0000)]
Release yangtools
Robert Varga [Mon, 3 Jun 2024 09:08:27 +0000 (11:08 +0200)]
Rework antlr suppression
We can now exclude packages from analysis, use that facility instead of
a @SuppressFBWarnings.
Change-Id: I37ce23351b29f0370658f7e52c032ffbeb635f5a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 3 Jun 2024 07:05:50 +0000 (09:05 +0200)]
Migrate model-* artifacts to bnd-parent
Ditch the use bundle-parent in model/*, resulting in fewer warnings and
better metadata.
Change-Id: I33af0d5f81880127791550df9479223698f8eab8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 31 May 2024 17:08:55 +0000 (19:08 +0200)]
Clean up codec-xml's module-info
Use proper order of requires.
Change-Id: I21f66c9818629731cdc779f7e7e82bb51577370a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 28 May 2024 20:05:38 +0000 (22:05 +0200)]
Migrate openconfig-model-api to bnd-parent
This is as easy as they come.
Change-Id: I6a7d4d2ec9121cca8bc2a566e69f2362b5526df4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 28 May 2024 19:23:46 +0000 (21:23 +0200)]
Improve bundle manifests
Our bnd-based bundles are carrying excess manifest entries and end up
having a differt Bundle-SymbolicName.
Fix this by introducing a default bnd.bnd to inherit from, and also fix
Bundle-DocURL to point to our GitHub mirror.
Change-Id: I83329ac59d84fcd49559d4f8ca938518571f90c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
tobias.pobocik [Thu, 23 May 2024 13:16:28 +0000 (15:16 +0200)]
Fix NormalizedNodeStreamWriterStack root handling
When we are attempting to startListEntry(), we really need to be looking
also at the root, as we may have been instantiated at the list itself.
Introduce a dedicated method to return that and use it also when
checking for choices.
JIRA: YANGTOOLS-1575
Change-Id: If4f4afa758d9edd358e9a8e7f1f7665b0156d8b2
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 28 May 2024 14:54:56 +0000 (16:54 +0200)]
Remove more unused @SuppressFBWarnings
Upgraded SpotBugs no longer reports a few false positives. Remove
a few more of the superfluous suppressions.
Change-Id: I4274a18c3d75a768a55ff80df9baf85095510af1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 28 May 2024 14:54:56 +0000 (16:54 +0200)]
Remove unused @SuppressFBWarnings
Upgraded SpotBugs no longer reports a false positive, fix that up,
eliminating the dependency from yang-test-util.
Change-Id: Ib3ad5125fac3d8b2c360a10bf0eb3572b87e7c35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 14 May 2024 11:30:57 +0000 (13:30 +0200)]
Bump odlparent to 13.1.3
Adopt latest upgrades.
Change-Id: Ia126d5848ce88bd30084e8cc4cce9e6bb934c01f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 5 May 2024 11:59:29 +0000 (13:59 +0200)]
Define a feature-parent
We have quite a bit of repetition going on, centralize what we can
in a common pom.xml.
Change-Id: Ia42f26e9043a47a918e60c2c7b18d6fecfbfff16
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 5 May 2024 11:03:45 +0000 (13:03 +0200)]
Convert features to template-feature-parent
We are getting warnings from maven-install-plugin for our feature
artifacts. Migrate them to template-feature-parent, which does not have
this problem.
Change-Id: Ibc7bbfb6675e3f010511020d4387492eef133f66
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 4 May 2024 22:36:33 +0000 (00:36 +0200)]
Bump versions to 13.0.6-SNAPSHOT
This starts the next development iteration.
Change-Id: Ia4f239c6acbb073ef16710c4ed13a4b1fc0f91b5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Sat, 4 May 2024 20:11:06 +0000 (20:11 +0000)]
Release yangtools
Robert Varga [Sat, 4 May 2024 05:29:23 +0000 (07:29 +0200)]
Bump odlparent to 13.1.2
Pick up upgrades and fixes from upstream.
Change-Id: Idb89c3c6c156a0368e0d14105043f35cdbe195a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 4 May 2024 05:46:57 +0000 (07:46 +0200)]
Fix checkstyle
Upgraded checkstyle finds a new violation, fix it up.
Change-Id: Id7445bd7adc83b5bc776122ca5be213830f06b85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 17 Apr 2024 14:34:50 +0000 (16:34 +0200)]
Bump versions to 13.0.5-SNAPSHOT
This starts the next development iteration.
Change-Id: Ia43d33c287acf9c46301ecb2a131ac0f782366c2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Wed, 17 Apr 2024 11:50:58 +0000 (11:50 +0000)]
Release yangtools
Robert Varga [Tue, 16 Apr 2024 14:03:32 +0000 (16:03 +0200)]
Fix DependencyResolver
We have a problem with submodules: a submodule cannot be resolved until
its belongs-to module is resolved -- but a module cannot be resolved
until its include submodules are resolved.
Fix this by partially restoring previous logic -- i.e. we consider
submodules resolved without considering belongs-to. We then add a
separate pass to invalidate resolved modules.
JIRA: YANGTOOLS-1572
Change-Id: I3b54912fe0b9ed86b98037b0ce4551a021663199
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Apr 2024 13:23:24 +0000 (15:23 +0200)]
Hide DependencyResolverTest methods
The methods are needlessly public, hide them.
Change-Id: I00d9715948fbc3832acc4fb73e20aee0fb4983b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Apr 2024 15:20:19 +0000 (17:20 +0200)]
Bump versions to 13.0.4-SNAPSHOT
This starts the next development iteration.
Change-Id: Id7dcb8271faef8d6d4a90586b8a4dcc91569e1ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Mon, 15 Apr 2024 12:38:14 +0000 (12:38 +0000)]
Release yangtools
Robert Varga [Sun, 3 Mar 2024 06:22:41 +0000 (07:22 +0100)]
Bump odlparent to 13.1.1
Pick up improments from upstream.
Change-Id: I8f43c3f6da7abea981712197cd0e99d2f3123b6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 14 Apr 2024 20:43:39 +0000 (22:43 +0200)]
Ditch logback from yang-parser-rfc7950 tests
Use slf4j-simple, as that is what we get by default. Also prevents a
warning about multiple providers being present.
Change-Id: I29d77f7ca1094cd773650c711167e1d42dcbf5ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 10 Apr 2024 13:50:16 +0000 (15:50 +0200)]
Defeat potential singleton pollution attacks
yang.common.Empty is a Serializable, which has no state beside its class
hierarchy. It therefore lends itself to having a singleton value object
-- except SpotBugs flags this as a violation MSC07-J rule in SEI CERT
Oracle Coding Standard for Java.
Digging into this, the readResolve() guard could be defeated via
hand-crafted serialization -- and thus could in theory have more than
once instance. Doing so would allow to have two Empty instances which
have the same Class, but do not compare as equal.
This patch erases that possibility, fixing a possibility of the error.
Also update documentation a bit to remove the word 'singleton', so users
are not tempted to use '==' for comparison -- which is already a bad
idea anyway.
Change-Id: Ibccd2909790e7a46d002d80f7b36280ff27fb724
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 8 Apr 2024 01:10:31 +0000 (03:10 +0200)]
Modernize mocking in yang-data-api
We are testing utility classes with incomplete mocks. Enforce complete
mocking and drop FIXMEs for improvement.
Change-Id: Ifa17b12d5c6d801705b11e3685f53ec1c937ceab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 8 Apr 2024 01:33:41 +0000 (03:33 +0200)]
Fix a requires warning
We are using Immutables for the default implementation, which leaks the
dependency. We should therefore import it transitively.
Change-Id: Ib9493744b0617c2ee7193cc3b6ff692e59ec6b57
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 5 Apr 2024 09:49:23 +0000 (11:49 +0200)]
Allow emission of operation input/output
Both XML and JSON codecs should be in a place where they can emit
RPC/action input/outputs -- except NormalizedNodeStreamWriterStack
cannot initialize there.
Rework NormalizedNodeStreamWriterStack internal tracking to work on
EffectiveStatements and lift this restriction.
JIRA: YANGTOOLS-1570
Change-Id: If45bb096ee30cc35bf2a40ec26e12217f71ca06c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 4 Apr 2024 00:49:48 +0000 (02:49 +0200)]
Rename JSONInstanceIdentifierCodec
This class is oddly named, it should be called
InstanceIdentifierJSONCodec.
Change-Id: I479475fb63e151f2756e44d62bf388d83bae01f2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 4 Apr 2024 00:36:03 +0000 (02:36 +0200)]
Deprecate UnknownTypeDefinition
This is just a stray API element, causing problems to downstreams of
model.api.type. Deprecate it for removal.
Change-Id: Ib8ac000ca8fbb533483bda5f3e7430db52d3a327
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 2 Apr 2024 17:54:08 +0000 (19:54 +0200)]
Add JSONValue and JSONCodec.unparseValue()
RESTCONF use case requires serializing values using JSON encoding --
without having a document ready.
Introduce JSONValue to encapsulate what sort of values we can have along
with JSONCodec.unparseValue() -- which produces such values.
JIRA: YANGTOOLS-1569
Change-Id: I398af058b5c017803a9dc4c61d3f7cfbc45cca5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 2 Apr 2024 08:49:01 +0000 (10:49 +0200)]
Disconnect JSONCodec from JsonWriter
We have a use case where we would like to JSON-encode values without a
JsonWriter. Introduce JSONValueWriter to enable the values to be
intercepted.
JIRA: YANGTOOLS-1569
Change-Id: I8cabe490a78effb78d6d4bfaf0bb62238bd1b809
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 2 Apr 2024 08:29:14 +0000 (10:29 +0200)]
Use JsonWriter.nullValue()
We are passing a null String, which ends up calling to nullValue().
Short-circuit this.
Change-Id: I75423bee13cb2d73ef1b817b975a9cb155721c02
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 2 Apr 2024 08:21:13 +0000 (10:21 +0200)]
Writeout primitive boolean
We know the value is non-null, hence we can short-circuit to
JsonWriter.value(boolean).
Change-Id: I9340c2ebd8adfe34323e13f35a74ae78d24c2ce2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 1 Apr 2024 18:12:36 +0000 (20:12 +0200)]
Add JSONCodec.parseValue(String)
JSONCodec's parsing does not have a document context, add convenience
a convenience method.
JIRA: YANGTOOLS-1567
Change-Id: Iae1329be54bcb2f9249d0a159b4aa316be2e8d3d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 12 Mar 2024 21:53:21 +0000 (22:53 +0100)]
Improve Revision.toString() javadoc
Revision.toString() has a few guarantees, make sure we document them.
Change-Id: I80ba05c9ac99ab8928e48eb33ad9e9216bddf61e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 12 Mar 2024 14:31:59 +0000 (15:31 +0100)]
Bump versions to 13.0.3-SNAPSHOT
This starts the next development iteration.
Change-Id: I41edd29c96e94e531aa973e2ebf1ff28a571aefc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Tue, 12 Mar 2024 10:39:59 +0000 (10:39 +0000)]
Release yangtools
Robert Varga [Sun, 3 Mar 2024 19:53:22 +0000 (20:53 +0100)]
Fix Guava javadoc reference
We have a down-revved reference, fix it up.
Change-Id: I88daa1d63919885e4cb1e0e4a26d6aa563e33e24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 1 Mar 2024 21:32:28 +0000 (22:32 +0100)]
Bump odlparent to 13.0.11
Pick up latest upgrades from upstream.
Change-Id: I2b9e3d9f9e9b80d563f7004bb3558f3767817e2e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 23 Feb 2024 07:58:55 +0000 (08:58 +0100)]
Improve YangParserTestUtils
Annotate method returns with @NonNull and ditch the use of
checkArgument().
Change-Id: I62b0da68bffb5cd50dc6dcb3bb755454a9575b52
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 31 Jan 2024 08:57:36 +0000 (09:57 +0100)]
Make Empty hashcode deterministic
All our YANG value types have a deterministic hash code, except Empty.
Fix that by assigning a hard-coded value.
Change-Id: I35d5b7a8d3bf653a2e85fc5e8fcbfe6baadc06b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 Jan 2024 01:13:27 +0000 (02:13 +0100)]
Add Empty.{completed,immediate}Future()
A number of downstream users are using Empty as a result of a future
which should only report empty success without relying on
java.lang.Void.
Since we are not playing favorites, let's expose two versions in keeping
with Java/Guava naming conventions:
- completedFuture() is the CompletionStage
- immediateFuture() is the ListenableFuture
JIRA: YANGTOOLS-1566
Change-Id: I5897ef561f562440e5d81fa7b0711e139dc6d6ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 13:37:05 +0000 (14:37 +0100)]
Migrate users of ImmutableNodes
This is a simple clean up of the remaining users.
Change-Id: If5b96ad0d7fb73b98e1e5b19358d3c308004c2dd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 12:28:18 +0000 (13:28 +0100)]
Migrate users of deprecated QNameModule methods
Mass-migrate to replacement methods, reducing quite a bit of verbosity.
Change-Id: I0ae704fbc7c753e4767134840b134ad72077a37e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 12:30:23 +0000 (13:30 +0100)]
Fix deprecation marker
We have the wrong version here -- 12.0.1 will never ship, it should be
13.0.1.
Change-Id: Icf2b2cbfae56885231f997b3745d9c152f7f3fe3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 5 Jan 2024 14:35:28 +0000 (15:35 +0100)]
Use RevisionUnion in QNameModule
QNameModule holds an optional Revision, which is inconvenient. This
patch retrofits RevisionUnion into it.
Since we are in this area, improve instantiation api, introducing of()
and ofRevision() convenience methods and deprecate create() methods.
Since QNameModule is a WritableObject composed of XMLNamespace and
RevisionUnion, make the two also WritableObjects and delegate to them.
Change-Id: Ib5349ef324d73340b285e9634e579825e55ab95d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 26 Jan 2024 20:12:15 +0000 (21:12 +0100)]
Add QNameModule hash code tests
We need to ensure hash code is stable, add explicit tests for that.
Change-Id: Ibd4266c7f5f70363fc6d1e3cedbc1225d20550f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 23 Jan 2024 23:43:24 +0000 (00:43 +0100)]
Modernize UniqueValidator
Use local variable type inference and instanceof patterns to reduce
verbosity and explicit casts.
Change-Id: I6f8a3a8fd96037d127c091aa16a705a31775d96f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 24 Jan 2024 00:03:17 +0000 (01:03 +0100)]
Modernize UniqueValidation a bit
Use local variable type inference and instanceof patterns to reduce
clutter.
Change-Id: I79717c6b41e6510464838d36b81158fcb26e51ea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 23 Jan 2024 23:53:12 +0000 (00:53 +0100)]
Add a UniqueValues design note.
Change-Id: I10602a6eef1aba3b6550d747f69805daa8e4a614
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 18 Jan 2024 10:40:46 +0000 (11:40 +0100)]
Bump versions to 13.0.1-SNAPSHOT
This starts the next development iteration.
Change-Id: If46f6589ffb359b9706d0cce40299e10be7bd987
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Thu, 18 Jan 2024 08:11:08 +0000 (08:11 +0000)]
Release yangtools
Robert Varga [Mon, 15 Jan 2024 22:45:54 +0000 (23:45 +0100)]
Fix ImmutableLeaf(SetEntry)Node.toString()
Allow the class identity of AbstraectNormalizedNode subclass to be
overridden, so that we can have externally-invisible class hierarchy.
Since we want to assert stable toString(), this patch also addresses
NodeWithValue.toString().
In both cases byte[] values are encoded with 'b64:' prefix followed by
base-64 encoded value.
JIRA: YANGTOOLS-1562
JIRA: YANGTOOLS-1563
Change-Id: I686eeb4769d9ebdcf21f7c11b314ccc85fe943fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 12 Jan 2024 00:53:49 +0000 (01:53 +0100)]
Fix Javadoc 21 violations
Java 21 seems to have a more aggresive warning set, make sure these do
not crop up where we enforce javadoc.
Change-Id: Iae3e82a11848aeb404a4058ad4cc43d8c47225f3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 11 Jan 2024 08:04:45 +0000 (09:04 +0100)]
Convert yang-model-spi to bnd-parent
This is a simplistic conversion.
Change-Id: I72bfc0b7e4d41285078e1d446848de2e8dcb6a5a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 11 Jan 2024 07:58:57 +0000 (08:58 +0100)]
Convert rfc7952-model-api to bnd-parent
This is a simplistic conversion.
Change-Id: I801723ed502c0571f81a0631d9ae33f867816ebd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 10 Jan 2024 11:55:03 +0000 (12:55 +0100)]
Silence javadoc by default
Clean up build by disabling missing documentation linting or switching
enforcement on where we have zero warnings already.
Change-Id: I0da0d630b81d7090383cb608bdca56fb793e1ce4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 10 Jan 2024 03:06:53 +0000 (04:06 +0100)]
Simplify SchemaNodeIdentifier class hierarchy
Use instanceof checks to eliminate the need for dedicated subclasses of
Absolute/Descendant.
Change-Id: I9ac512037c0930e5bc81d4ebbaa13f8b151dd8ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 10 Jan 2024 12:33:11 +0000 (13:33 +0100)]
Cleanup mockito-configuration
Provide a MoreAnwers class, which exposes an THROWS_UNSTUBBED_METHOD
answer.
Also split out implementation into org.opendaylight.mockito, so that we
do not risk a class name collision.
Change-Id: I20c61b5ca7b83fba9da6fe16594c69bfc46b71ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 10 Jan 2024 12:23:53 +0000 (13:23 +0100)]
Modernize ArgumentsExtractorVerifier
Refactor methods to keep the flow simpler.
Change-Id: I079aae8c738ace034bf01579f998cbbfcc879675
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 8 Jan 2024 01:37:25 +0000 (02:37 +0100)]
Use instanceof pattern
Simplify equals() implementation a bit.
Change-Id: I2c0070df979e9d81b98445b3e166a457fb851225
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 8 Jan 2024 01:39:27 +0000 (02:39 +0100)]
Bump versions to 13.0.1-SNAPSHOT
This starts the next development iteration.
Change-Id: Ie812e95612992cf7c9dbcd7fefde6dd460aaf460
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Sun, 7 Jan 2024 22:27:34 +0000 (22:27 +0000)]
Release yangtools
Robert Varga [Sun, 7 Jan 2024 18:30:11 +0000 (19:30 +0100)]
Switch yang-ir to bnd-parent
This is a simplistic bundle, switch to to bnd-parent so we get control
over exported packages.
Change-Id: I77cc05d2cca5b4e4084e407ff83a2e6cb9914def
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 7 Jan 2024 18:13:13 +0000 (19:13 +0100)]
Rename YangIRSchemaSource
YangIRSource is a more concise name. Also add a bit of documentation.
Change-Id: I259c41c2defd0418854e8766f730dda83e3cb4cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 7 Jan 2024 18:06:32 +0000 (19:06 +0100)]
Cleanup dependencies
The movement of {Yin,Yang}TextSource has implications on dependencies,
clean them up.
JIRA: YANGTOOLS-1561
Change-Id: I4bdc5522b8a4135352a8de494f36ecbf3a11531d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 7 Jan 2024 18:08:27 +0000 (19:08 +0100)]
Use plain AssertionError
AssertionFailedError introduces an unneeded dependency, remove its users.
Change-Id: I66a8e812fb914f76812e01b58101ca847fe4046b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 7 Jan 2024 17:28:58 +0000 (18:28 +0100)]
Move YangTextSource
YangTextSource is something defined in RFC6020, really, expose this
construct at yang-model-api level.
JIRA: YANGTOOLS-1561
Change-Id: Ic1f0d5c37fe66d216749cfbafe0efa798bcd83f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 7 Jan 2024 16:55:03 +0000 (17:55 +0100)]
Expose FileYangTextSource
Rather than having a plethora static factory methods, just expose
FileYangTextSource and use it as appropriate.
JIRA: YANGTOOLS-1561
Change-Id: I0efbd6bdcff32bb0079a5b974797320cbc3c88fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 7 Jan 2024 15:51:24 +0000 (16:51 +0100)]
Expose URLYangTextSource
Rather than having a plethora of static factory methods, expose only a
few constructors.
JIRA: YANGTOOLS-1561
Change-Id: I4dee89e9243191bdf4d6bf2f1d6e5f1f71a5fd68
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 7 Jan 2024 15:16:48 +0000 (16:16 +0100)]
Move YinTextSource to yang.model.api.source
YinTextSource is something defined in RFC6020, really, expose this
construct at yang-model-api level.
JIRA: YANGTOOLS-1561
Change-Id: Icbfa6a96a11090031c95595da14e92b888f06f23
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>