yangtools.git
3 weeks agoCentralize IAE message 61/112061/1
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>
3 weeks agoYet another round of Sonar issue fixes 59/112059/1
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>
3 weeks agoAnother round of Sonar warnings fixes 56/112056/2
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>
4 weeks agoClean up more Sonar warnings 83/111983/2
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>
4 weeks agoRemove unused throws declarations 80/111980/2
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>
4 weeks agoRemove ContainerSchemaNodes 79/111979/2
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>
4 weeks agoRemove deprecated YangVersion methods 78/111978/2
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>
4 weeks agoRemove Revision.Proxy 77/111977/1
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>
4 weeks agoRemove deprecated QNameModule methods 87/103387/3
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>
4 weeks agoRemove ListenerRegistration and ListenerRegistry 28/109228/2
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>
4 weeks agoRemove Listener{Registration,Registry} and related classes 41/111941/2
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>
4 weeks agoSpecialize JSONCodec to JSONValueWriter 75/111175/6
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>
4 weeks agoSpecialize JSONCodec to Void input 60/111160/4
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>
4 weeks agoRemove UnknownTypeDefinition 50/111250/2
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>
4 weeks agoBump versions to 14.0.0-SNAPSHOT 33/111933/1
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>
4 weeks agoBump versions to 13.0.7-SNAPSHOT 32/111932/1
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>
4 weeks agoRelease yangtools v13.0.6
jenkins-releng [Mon, 3 Jun 2024 14:03:05 +0000 (14:03 +0000)]
Release yangtools

4 weeks agoRework antlr suppression 23/111923/3
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>
4 weeks agoMigrate model-* artifacts to bnd-parent 22/111922/2
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>
4 weeks agoClean up codec-xml's module-info 10/111910/2
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>
4 weeks agoMigrate openconfig-model-api to bnd-parent 94/111894/2
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>
4 weeks agoImprove bundle manifests 93/111893/2
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>
4 weeks agoFix NormalizedNodeStreamWriterStack root handling 11/111411/11
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>
5 weeks agoRemove more unused @SuppressFBWarnings 89/111889/1
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>
5 weeks agoRemove unused @SuppressFBWarnings 84/111884/1
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>
5 weeks agoBump odlparent to 13.1.3 86/111686/2
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>
8 weeks agoDefine a feature-parent 19/111619/1
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>
8 weeks agoConvert features to template-feature-parent 18/111618/1
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>
8 weeks agoBump versions to 13.0.6-SNAPSHOT 15/111615/1
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>
8 weeks agoRelease yangtools v13.0.5
jenkins-releng [Sat, 4 May 2024 20:11:06 +0000 (20:11 +0000)]
Release yangtools

8 weeks agoBump odlparent to 13.1.2 11/111611/2
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>
8 weeks agoFix checkstyle 10/111610/1
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>
2 months agoBump versions to 13.0.5-SNAPSHOT 40/111440/1
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>
2 months agoRelease yangtools v13.0.4
jenkins-releng [Wed, 17 Apr 2024 11:50:58 +0000 (11:50 +0000)]
Release yangtools

2 months agoFix DependencyResolver 34/111434/3
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>
2 months agoHide DependencyResolverTest methods 33/111433/1
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>
2 months agoBump versions to 13.0.4-SNAPSHOT 98/111398/1
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>
2 months agoRelease yangtools v13.0.3
jenkins-releng [Mon, 15 Apr 2024 12:38:14 +0000 (12:38 +0000)]
Release yangtools

2 months agoBump odlparent to 13.1.1 42/110442/9
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>
2 months agoDitch logback from yang-parser-rfc7950 tests 86/111386/1
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>
2 months agoDefeat potential singleton pollution attacks 48/111348/1
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>
2 months agoModernize mocking in yang-data-api 18/111318/4
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>
2 months agoFix a requires warning 17/111317/1
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>
2 months agoAllow emission of operation input/output 79/111279/5
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>
2 months agoRename JSONInstanceIdentifierCodec 49/111249/1
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>
2 months agoDeprecate UnknownTypeDefinition 48/111248/1
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>
2 months agoAdd JSONValue and JSONCodec.unparseValue() 11/111211/4
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>
3 months agoDisconnect JSONCodec from JsonWriter 74/111174/4
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>
3 months agoUse JsonWriter.nullValue() 72/111172/1
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>
3 months agoWriteout primitive boolean 71/111171/1
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>
3 months agoAdd JSONCodec.parseValue(String) 59/111159/1
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>
3 months agoImprove Revision.toString() javadoc 85/110685/1
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>
3 months agoBump versions to 13.0.3-SNAPSHOT 68/110668/1
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>
3 months agoRelease yangtools v13.0.2
jenkins-releng [Tue, 12 Mar 2024 10:39:59 +0000 (10:39 +0000)]
Release yangtools

4 months agoFix Guava javadoc reference 62/110462/1
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>
4 months agoBump odlparent to 13.0.11 31/110431/1
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>
4 months agoImprove YangParserTestUtils 10/110310/1
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>
5 months agoMake Empty hashcode deterministic 94/110094/1
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>
5 months agoAdd Empty.{completed,immediate}Future() 89/110089/2
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>
5 months agoMigrate users of ImmutableNodes 28/110028/1
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>
5 months agoMigrate users of deprecated QNameModule methods 27/110027/3
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>
5 months agoFix deprecation marker 26/110026/1
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>
5 months agoUse RevisionUnion in QNameModule 42/109642/16
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>
5 months agoAdd QNameModule hash code tests 25/110025/1
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>
5 months agoModernize UniqueValidator 41/109941/3
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>
5 months agoModernize UniqueValidation a bit 43/109943/2
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>
5 months agoAdd a UniqueValues design note. 42/109942/2
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>
5 months agoBump versions to 13.0.1-SNAPSHOT 31/109831/1
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>
5 months agoRelease yangtools v13.0.1
jenkins-releng [Thu, 18 Jan 2024 08:11:08 +0000 (08:11 +0000)]
Release yangtools

5 months agoFix ImmutableLeaf(SetEntry)Node.toString() 89/109789/2
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>
5 months agoFix Javadoc 21 violations 51/109751/1
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>
5 months agoConvert yang-model-spi to bnd-parent 04/109704/1
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>
5 months agoConvert rfc7952-model-api to bnd-parent 03/109703/1
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>
5 months agoSilence javadoc by default 99/109699/4
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>
5 months agoSimplify SchemaNodeIdentifier class hierarchy 93/109693/2
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>
5 months agoCleanup mockito-configuration 98/109698/1
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>
5 months agoModernize ArgumentsExtractorVerifier 97/109697/1
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>
5 months agoUse instanceof pattern 71/109671/2
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>
5 months agoBump versions to 13.0.1-SNAPSHOT 73/109673/1
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>
5 months agoRelease yangtools v13.0.0
jenkins-releng [Sun, 7 Jan 2024 22:27:34 +0000 (22:27 +0000)]
Release yangtools

5 months agoSwitch yang-ir to bnd-parent 68/109668/3
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>
5 months agoRename YangIRSchemaSource 67/109667/3
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>
5 months agoCleanup dependencies 65/109665/2
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>
5 months agoUse plain AssertionError 66/109666/2
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>
5 months agoMove YangTextSource 55/109655/10
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>
5 months agoExpose FileYangTextSource 64/109664/4
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>
5 months agoExpose URLYangTextSource 63/109663/3
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>
5 months agoMove YinTextSource to yang.model.api.source 62/109662/4
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>
5 months agoExpose FileYinTextSource 61/109661/4
Robert Varga [Sun, 7 Jan 2024 15:00:22 +0000 (16:00 +0100)]
Expose FileYinTextSource

Rather than having static factory methods, expose FileYinTextSource.

JIRA: YANGTOOLS-1561
Change-Id: I02399316cb1d9f009f299abffbf1c31cf666e418
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoExpose URLYinTextSource 60/109660/2
Robert Varga [Sun, 7 Jan 2024 14:49:59 +0000 (15:49 +0100)]
Expose URLYinTextSource

Eliminate YinTextSource static methods in favor of exposing
URLYinTextSource.

JIRA: YANGTOOLS-1561
Change-Id: I444478a417988f4532310f52d1e73bed236932e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoExpose DelegatedYinTextSource 59/109659/3
Robert Varga [Sun, 7 Jan 2024 14:37:23 +0000 (15:37 +0100)]
Expose DelegatedYinTextSource

Eliminate YinTextSource static methods in favor of making
DelegatedYinTextSource visible.

JIRA: YANGTOOLS-1561
Change-Id: I77b5223facb3de7ed216fd556ae0bd9d95fb6927
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoExpose DelegatedYangTextSource 58/109658/2
Robert Varga [Sun, 7 Jan 2024 14:13:40 +0000 (15:13 +0100)]
Expose DelegatedYangTextSource

Eliminate YangTextSource static methods in favor of making
DelegatedYangTextSource visible. This also eliminates the slew of
possibilitiess down to the bare bones -- users can cope with the trivial
conversions from ByteSource and file name.

JIRA: YANGTOOLS-1561
Change-Id: I2321e9d936489fefe059399a750393b76730e297
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoBump versions to 13.0.0-SNAPSHOT 57/109657/2
Robert Varga [Sun, 7 Jan 2024 13:38:19 +0000 (14:38 +0100)]
Bump versions to 13.0.0-SNAPSHOT

This starts the next major development iteration.

Change-Id: Ib7947413210db54a81f298caee9716800c504c84
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRehost SourceIdentifier methods 56/109656/1
Robert Varga [Sun, 7 Jan 2024 12:46:51 +0000 (13:46 +0100)]
Rehost SourceIdentifier methods

SourceIdentifier is aware of .yang, expand its capabilities to also
parse file names to extract revision and handle .yin.

JIRA: YANGTOOLS-XXX
Change-Id: I5c41707677a9b8b75d81987f740a48162e2c8689
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoExpose NotRevision 51/109651/2
Robert Varga [Sat, 6 Jan 2024 01:45:38 +0000 (02:45 +0100)]
Expose NotRevision

Having RevisionUnion.none() exposing a type-safe object is useful.
Expose NotRevision and improve the test suite.

Change-Id: I0217ade57c73c65d6ce903c07b696246881aec4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoMigrate YangVersionTest 50/109650/1
Robert Varga [Sat, 6 Jan 2024 00:53:22 +0000 (01:53 +0100)]
Migrate YangVersionTest

Use non-deprecated methods and upgrade the deprecation.

Change-Id: Ia9875471fd3bdfed1586319af317d57ca35ca9b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoConvert yang-model-api to bnd-parent 46/109646/2
Robert Varga [Fri, 5 Jan 2024 17:57:49 +0000 (18:57 +0100)]
Convert yang-model-api to bnd-parent

Modernize packaging and embrace the wonderful world of
explicitly-controlled exports.

Change-Id: Ied805ae32dcb72ba501e29c0733007a4407cb9c1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoClean up yang-model-api mocking 45/109645/2
Robert Varga [Fri, 5 Jan 2024 17:32:06 +0000 (18:32 +0100)]
Clean up yang-model-api mocking

Use mockito-configuration and MockitoExtension to be really crisp about
mocking.

Change-Id: I9102c75f15ef7cd114f656d28c94c92c54e4bd60
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoBump versions to 12.0.1-SNAPSHOT 47/109647/1
Robert Varga [Fri, 5 Jan 2024 19:41:20 +0000 (20:41 +0100)]
Bump versions to 12.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: I7736a158ad4ae7111708045c990a09d9921f4b24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRelease yangtools v12.0.0
jenkins-releng [Fri, 5 Jan 2024 18:15:14 +0000 (18:15 +0000)]
Release yangtools