yangtools.git
2 years agoRelease yangtools v7.0.12
jenkins-releng [Wed, 19 Jan 2022 07:06:39 +0000 (07:06 +0000)]
Release yangtools

2 years agoBump odlparent to 9.0.12 66/99366/1
Robert Varga [Tue, 18 Jan 2022 18:59:04 +0000 (19:59 +0100)]
Bump odlparent to 9.0.12

Used a fixed-up version of compiler-maven-plugin.

Change-Id: Ia1dadae7b4af8ba6936b25a8f1a50258a2162de6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 9.0.11 40/99340/3
Robert Varga [Mon, 17 Jan 2022 21:22:34 +0000 (22:22 +0100)]
Bump odlparent to 9.0.11

Pick up latest upgrades from upstream.

Change-Id: I94e66ee818a39828e0df3d541a6817c2b304720d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate ImmutableNodes.fromInstanceId() with deepestElement 60/99260/1
Robert Varga [Mon, 10 Jan 2022 12:25:59 +0000 (13:25 +0100)]
Deprecate ImmutableNodes.fromInstanceId() with deepestElement

The two methods allowing an override of the deepest element have only a
single user, which is broken by their semantics. Deprecate them for
removal, so that we flush out anyone else still relying on them.

JIRA: YANGTOOLS-1389
Change-Id: I52e8bdebc5488d095645a7bfb45a5c9cf400ecb0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit faf7ce6d1e3acb2af2b846746e8495749301b484)

2 years agoBump versions to 7.0.12-SNAPSHOT 36/99236/1
Robert Varga [Mon, 10 Jan 2022 08:27:02 +0000 (09:27 +0100)]
Bump versions to 7.0.12-SNAPSHOT

This starts the next development iteration.

Change-Id: Ia09424786bcfb92b8e1d5330790ce34b4e789b29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate SemVer import mode 38/99038/1
Robert Varga [Thu, 21 Oct 2021 08:48:35 +0000 (10:48 +0200)]
Deprecate SemVer import mode

Semantic version imports are not used by anyone and have a rather
convoluted implementation. Deprecate them along with their supporting
elements.

JIRA: YANGTOOLS-1354
Change-Id: I6b41c3407d51833cb13445517e896be39b371ac8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1fff58dc4bee0df39b9c600f2291f98b18d7dc55)

2 years agoBump odlparent to 9.0.10 26/99226/1
Robert Varga [Sun, 9 Jan 2022 17:04:52 +0000 (18:04 +0100)]
Bump odlparent to 9.0.10

Pick up latest upgrades from upstream.

Change-Id: Idb182da59822f408640750cc6c5cb4d09ea3fc5c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd SchemaNodeIdentifier-based constructor 35/99135/1
Robert Varga [Wed, 22 Dec 2021 07:25:29 +0000 (08:25 +0100)]
Add SchemaNodeIdentifier-based constructor

We are deprecating SchemaPath, provide a proper constructor allowing
downstreams to use it instead of the SchemaPath-driven one.

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

2 years agoCorrect and/or/div/mod in path expressions 32/99032/1
Robert Varga [Sun, 19 Dec 2021 09:35:17 +0000 (10:35 +0100)]
Correct and/or/div/mod in path expressions

The grammar is creating implicit lexer tokens for and/or/div/mod, which
take precedence overt NCName. Make sure we define these tokens
explicitly and allow them to be an alternative wherever NCName is
valid.

JIRA: YANGTOOLS-1387
Change-Id: I4f4f26fe0f8bc27614b769b465a76696a49ad7c2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1a7e93a50d22944771fe2ea4fc18c24fcf3aae11)

2 years agoBump versions to 7.0.11-SNAPSHOT 16/99116/1
Robert Varga [Sun, 19 Dec 2021 08:16:29 +0000 (09:16 +0100)]
Bump versions to 7.0.11-SNAPSHOT

This starts the next development iteration.

Change-Id: I11c4612de5f1246e8d57a8dfa5fbeee709afe854
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 7.0.10-SNAPSHOT 15/99115/1
Robert Varga [Sun, 19 Dec 2021 08:15:54 +0000 (09:15 +0100)]
Bump versions to 7.0.10-SNAPSHOT

Missing bump since previous release, fix that.

Change-Id: Ibc41fd5a0c56c6db1ca3d7890c0b407252f1ad1f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 9.0.9 07/99107/1
Robert Varga [Sun, 19 Dec 2021 07:49:16 +0000 (08:49 +0100)]
Bump odlparent to 9.0.9

Pick up latest upgrades from upstream.

Change-Id: Ic3c88f0feb1cfa89c1ebaffa2e467579929db075
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoTrigger onStatementAdded() for replicas 86/99086/1
Robert Varga [Wed, 15 Dec 2021 17:22:27 +0000 (18:22 +0100)]
Trigger onStatementAdded() for replicas

When a statement is introduced through StmtContext.replicaAsChildOf(),
the corresponding statement support should be notified of this fact, so
it can properly do its thing. This makes it consistent with
Mutable.childCopyOf().

JIRA: YANGTOOLS-1386
Change-Id: Ic947ea5fc822a29ff915d47db1cc591a2a18fd44
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b0aea307301907059ea1d82ca39d7d257d28e1c6)

2 years agoDeviations should get disabled if target is unsupported 59/99059/1
Robert Varga [Fri, 17 Dec 2021 07:16:25 +0000 (08:16 +0100)]
Deviations should get disabled if target is unsupported

Deviate's InferenceAction should pay attention to unavailable target
nodes, so we disable the deviation.

JIRA: YANGTOOLS-1370
Change-Id: Id0d8c3a64f91060cb21e807402742341ea98f492
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 70a13e29e0bec19bd48bd3fe48102a465294caf2)

2 years agoAugments should get disabled if target is unsupported 49/98949/2
Robert Varga [Wed, 24 Nov 2021 10:43:31 +0000 (11:43 +0100)]
Augments should get disabled if target is unsupported

AugmentInferenceAction should pay attention to unavailable target
nodes, so we disable the augmentation.

JIRA: YANGTOOLS-1370
Change-Id: Ib1f0bde83a90e4bb45a7c4fa1fc62af205f4ea6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 43fb7cd8d8bd9330988c02566ef376d00eb7b461)

2 years agoImplement ModelStatement.toString() 57/98957/1
Robert Varga [Wed, 8 Dec 2021 11:20:26 +0000 (12:20 +0100)]
Implement ModelStatement.toString()

Make sure we codify hashCode()/equals()/toString() methods in
AbstractModelStatement -- fixing a major usability issue with our
objects and improving consistency.

JIRA: YANGTOOLS-1378
Change-Id: I60c233c978ac4315e9c7c79a2ff96751108671cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 87a0921a2ecdadfabb01f2d47f2c15a3341529a2)

2 years agoDelay modifiers during their processing 56/98956/1
Robert Varga [Sun, 12 Dec 2021 20:11:51 +0000 (21:11 +0100)]
Delay modifiers during their processing

When we are invoking actions, we are also iterating over them, hence
we have to stop modifiers being added -- otherwise we'll get a CME.
Add the minimal machinery to make this work.

JIRA: YANGTOOLS-1381
Change-Id: I44c04d7bdafe9fddb0bddd01e5cbb4912d356723
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3d0ba7cc365c4f8dc2c8e52945e75d20bc3ddd51)

2 years agoCache CopyType.values() 50/98950/2
Robert Varga [Sun, 12 Dec 2021 08:46:45 +0000 (09:46 +0100)]
Cache CopyType.values()

We are on critical path accessing values, which end up being cloned
by the implementation. Let's amortize that by remembering the array.

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

2 years agoDeprecate SchemaNodeUtils for removal 09/98909/1
Robert Varga [Wed, 8 Dec 2021 12:50:44 +0000 (13:50 +0100)]
Deprecate SchemaNodeUtils for removal

This class has been deprecated in 7.0.0, mark that fact and reinforce it
by forRemoval=true.

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

2 years agoDefer mutatesEffectiveCtxPath() hookOnto() 15/98815/1
Robert Varga [Tue, 23 Nov 2021 12:45:27 +0000 (13:45 +0100)]
Defer mutatesEffectiveCtxPath() hookOnto()

When we are resolving statements along schema tree axis we may end up
hitting a statement which is already resolved as unsupported. In that
case we would end up derefencing a known-null action. Defer
initialization until the action is set.

JIRA: YANGTOOLS-1370
Change-Id: I5dbc7c047cbbb78b015c4d09c8b271bb218fef4b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 02d8511d8b1e4277a7069d1cf105269d2305f432)

2 years agoIntern PatternExpressions 11/98811/1
Robert Varga [Fri, 3 Dec 2021 15:14:22 +0000 (16:14 +0100)]
Intern PatternExpressions

Some of the patterns out there are widely duplicated, expecially in
Junos models. Since a PatternExpression is an Immutable object, it can
easily be interned and thus shared across reactors, eliminating ~33K
duplicate objects.

JIRA: YANGTOOLS-1374
Change-Id: I8328d1eab9be07fe87757523543d43f0ea7c64d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d45d5be5094665428b910141b3383fba15ed1b6f)

2 years agoReflect supported features in effective model 32/98632/1
Robert Varga [Mon, 22 Nov 2021 07:14:21 +0000 (08:14 +0100)]
Reflect supported features in effective model

We currently do not capture the set of supported features in
EffectiveModelContext aside from applying their effects. Improve this
by not exposing unsupported features in the effective model, so that
users can understand the set of supported features by simply looking
for all FeatureEffectiveStatements.

JIRA: YANGTOOLS-1368
Change-Id: I8c60705ad96854cd2d4dc5d7b97cc2e51dd5a032
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e4da09169c29d790b3b835a1e88a629758d27435)

2 years agoAdd Empty.value() 09/98509/1
Robert Varga [Sun, 14 Nov 2021 18:32:58 +0000 (19:32 +0100)]
Add Empty.value()

Introduce a more friendly name for returning the empty instance. The new
method is 'value()' and 'getInstance()' is deprecated.

JIRA: YANGTOOLS-1363
Change-Id: Ie74754655247fcf74c1689bbb246fb4035999bb3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit da73a2179571830c2d9da75957fbb664accf26c6)

2 years agoAdd QNameModule documentation 08/98508/1
Robert Varga [Sun, 14 Nov 2021 18:40:49 +0000 (19:40 +0100)]
Add QNameModule documentation

QNameModule is a widely-used class, make sure it is documented.

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

2 years agoCorrect bundle-parent's coordinates 67/98267/1
Robert Varga [Tue, 2 Nov 2021 07:25:55 +0000 (08:25 +0100)]
Correct bundle-parent's coordinates

We are inheriting SCM section from odlparent, make sure we add an
override.

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

2 years agoRequire java.compiler in yang-data-api 70/98070/1
Robert Varga [Fri, 29 Oct 2021 11:33:20 +0000 (13:33 +0200)]
Require java.compiler in yang-data-api

We are using immutables.org and allow @Generated to be emitted, hence
we need to ensure it is visible to users.

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

2 years agoUse VarHandle for toStringCache 69/98069/1
Robert Varga [Thu, 28 Oct 2021 12:11:14 +0000 (14:11 +0200)]
Use VarHandle for toStringCache

We are using VarHandle for hashCode, there let's do the same for
toStringCache.

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

2 years agoAllow rebinding the prefix of an UnresolvedQName 71/98171/2
Robert Varga [Wed, 27 Oct 2021 21:12:14 +0000 (23:12 +0200)]
Allow rebinding the prefix of an UnresolvedQName

There are callers who are dealing with prefix being optional, possibly
added (or changed) in a later context. Add the ability to do that
without re-validating the local name.

JIRA: YANGTOOLS-1359
Change-Id: I099589d8a579f854dcc0ae1740027e7af24470bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 840bcc965c8eeb566d8cebd870f35e1be85cc617)

2 years agoAdd SchemaPath.of(SchemaNodeIdentifier) 59/98159/1
Robert Varga [Wed, 27 Oct 2021 00:20:07 +0000 (02:20 +0200)]
Add SchemaPath.of(SchemaNodeIdentifier)

SchemaNodeIdentifier depends on SchemaPath, which is a bad idea from
flexibility perspective. Since the methods are deprecated, add their
non-cached counterparts in SchemaPath.

JIRA: YANGTOOLS-1358
Change-Id: I8fc6897940a172b06cf309f1a40b56e4e00a6030
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4cea93f6402296296b1a0551241eaa4e16ae6f03)

2 years agoFix YANG export with duplicate imports 06/98006/1
Robert Varga [Thu, 26 Aug 2021 15:04:48 +0000 (17:04 +0200)]
Fix YANG export with duplicate imports

When we have two submodules not agreeing on the prefix used to import a
module, we get a nasty splat from StatementPrefixResolver. Fix this by
detecting when this is happens and skip to full resolution magic.

JIRA: YANGTOOLS-1313
Change-Id: I99cc3ebc2f560590d05b51287d08429aaf7d6582
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Dominik Vrbovsky <dominik.vrbovsky@pantheon.tech>
(cherry picked from commit d08e5552beb9180f582bf419fdcf120052876411)

2 years agoBump odlparent to 9.0.8 94/97994/1
Robert Varga [Tue, 19 Oct 2021 20:49:24 +0000 (22:49 +0200)]
Bump odlparent to 9.0.8

Adopt latest fixes from upstream.

Change-Id: I2f5e98a50d07b5b355bdee0540f9db41536478ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 9.0.7 80/97980/1
Robert Varga [Tue, 19 Oct 2021 15:26:34 +0000 (17:26 +0200)]
Bump odlparent to 9.0.7

Adopt latest fixes from upstream.

Change-Id: I3e2af7be36f6c7ac7e95e45dbe3287c9c7eecbbd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump maven-verifier to 1.7.2 63/97963/1
Robert Varga [Sun, 17 Oct 2021 19:18:19 +0000 (21:18 +0200)]
Bump maven-verifier to 1.7.2

This modernizes the components used and removes the need for an
exclusion.

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

2 years agoDeprecate EffectiveStmtCtx.Current.original() 26/97926/1
Robert Varga [Sat, 16 Oct 2021 09:32:28 +0000 (11:32 +0200)]
Deprecate EffectiveStmtCtx.Current.original()

These methods are used to pass information to getOriginal(Definition)
methods, which themselves are deprecated for removal. Mirror that
decision so we do not end up exposing things we do not need.

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

2 years agoDeprecate AddedByUsesAware 25/97925/1
Robert Varga [Sat, 16 Oct 2021 09:28:31 +0000 (11:28 +0200)]
Deprecate AddedByUsesAware

isAddedByUses() is used only by mdsal's binding components, which should
be able to get by without this guidance. Deprecate the interface along
with its support bits.

JIRA: YANGTOOLS-1351
Change-Id: Ic8b07b995f49cece48d1a90ed51723485d88120d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1d4620040587f510d1b5f0ce99b13c54350ef6eb)

2 years agoDeprecate DerivableSchemaNode 24/97924/1
Robert Varga [Sat, 16 Oct 2021 09:05:44 +0000 (11:05 +0200)]
Deprecate DerivableSchemaNode

This interface exposes a single method, which in turn is only used
by mdsal-binding-generator. That component should be able to work
without this method, hence we deprecate it with the intent to remove
as soon as practical.

JIRA: YANGTOOLS-1350
Change-Id: Ie7bd65e5301012bcb24703bd36c0a8d149f62d74
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6edbe2d43f3b16f8dfdbe70bc4808c23b712f619)

2 years agoAdd more deprecations around SchemaPath 23/97923/1
Robert Varga [Sat, 16 Oct 2021 09:13:04 +0000 (11:13 +0200)]
Add more deprecations around SchemaPath

We have a few constructs which provide bridging to SchemaPath, which
are now triggering warnings. Deprecate them, so that we suppress
warnings and give users some time to adjust.

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

2 years agoDeprecate AugmentationSchemaNode.getOriginalDefinition() 22/97922/1
Robert Varga [Sat, 16 Oct 2021 08:56:14 +0000 (10:56 +0200)]
Deprecate AugmentationSchemaNode.getOriginalDefinition()

This method is on its way out, mark them as deprecated, so downstreams
are aware of that.

JIRA: YANGTOOLS-1349
Change-Id: Id1a4d631d31185567984ed694397f0b871777dd6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c3e7916182012ce9d27aec9af750162b8938e758)

2 years agoFix StatementContextBase.childCopyOf() 70/97870/3
Robert Varga [Mon, 11 Oct 2021 12:15:45 +0000 (14:15 +0200)]
Fix StatementContextBase.childCopyOf()

Most of our StmtContext implementations are derived from
StatementContextBase, but notably ReplicaStatementContext is not -- and
we do not handle it during copy operations.

Update the dispatch code to short circuit to replicaAsChildOf(), which
takes care of the details.

JIRA: YANGTOOLS-1346
Change-Id: I65f9713d5c06bbe251a4b27fb0745dd905c36976
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3b4308a5a4988fb66839c8d2724c13e0ae1b2e9c)

2 years agoAdd a few more utilities to EffectiveModelContext 63/97163/2
Robert Varga [Thu, 30 Sep 2021 14:02:06 +0000 (16:02 +0200)]
Add a few more utilities to EffectiveModelContext

Locating modules by name/namespace is useful, provide a simple bridge on
top of SchemaContext.findModules().

JIRA: YANGTOOLS-1337
Change-Id: I08968d6aebb1569ab8990cd69352c56ddcfe5cc3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit ca3189d0b22aa7fd30a055e7cdd1e604502e620f)

2 years agoIntroduce HierarchicalIdentifier to replace Path 65/97165/1
Robert Varga [Sat, 2 Oct 2021 15:04:00 +0000 (17:04 +0200)]
Introduce HierarchicalIdentifier to replace Path

Path is always combined with Identifier, and it really is an extension
of Identifier contract. Add a new interface to capture that contract
and deprecate Path, so we get out of java.nio.file.Path's way.

JIRA: YANGTOOLS-1344
Change-Id: Ida2f28b1f2d349b67115611eac843e7da8628f42
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit ce393b58bbeebe85e7725f357f9eb73c8cfafe13)

2 years agoImprove SchemaInferenceStack error reporting 84/97684/1
Robert Varga [Wed, 29 Sep 2021 13:34:37 +0000 (15:34 +0200)]
Improve SchemaInferenceStack error reporting

Include a description of parent's identity when we fail to locate
its child. This makes it easier to understand what is going on in most
failure situations.

The message now ends with something like
- not present in schema parent (namespace)parentName
- not present in grouping (namespace)groupingName
- not present in module (namespace)moduleName
or similar.

Also expand the test suite to cover negative scenarios around
enterChoice().

JIRA: YANGTOOLS-1336
Change-Id: I8a642dcd0fe5705f4c33c1a3e9d779c6db91ef24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b13eeb7d98bd4cc1374604a6047e78ed70efd04b)

2 years agoDeprecate concents.{Codec,Deserializer,Serializer} 56/97656/1
Robert Varga [Mon, 27 Sep 2021 15:29:15 +0000 (17:29 +0200)]
Deprecate concents.{Codec,Deserializer,Serializer}

These are not really useful, deprecate them for removal.

JIRA: YANGTOOLS-1335
Change-Id: Ie3fae2c7b82e5292f18dd43d2a3f04603b707d29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate util.Immutables for removal 62/97162/2
Robert Varga [Mon, 27 Sep 2021 13:46:34 +0000 (15:46 +0200)]
Deprecate util.Immutables for removal

This class is rather incompete in its mission and it is not used
anywhere. Deprecate it for removal.

JIRA: YANGTOOLS-1330
Change-Id: I54ad2666e1b7660e5d93d90ff924de1e640df754
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1dc00960a5ccc7434d06688f1140e59ca010192c)

2 years agoPublish identifier matches 56/97156/2
Robert Varga [Thu, 16 Sep 2021 00:59:09 +0000 (02:59 +0200)]
Publish identifier matches

Our private matches are useful for other parsers which need to handle
YANG's identifier ABNF production. Document and publish them from
YangNames.

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

2 years agoDeprecate ClassBasedPropertyBuilder 61/97161/2
Robert Varga [Mon, 27 Sep 2021 12:57:13 +0000 (14:57 +0200)]
Deprecate ClassBasedPropertyBuilder

This interface is not used anywhere, deprecate it for removal.

JIRA: YANGTOOLS-1323
Change-Id: Ic7f6ccc5559d6bb1242f5649d2a84dbf9ba09c3d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit df48bbb0370a339db124296bc2597f914ccb15ce)

2 years agoDeprecate ProductAwareBuilder 60/97160/1
Robert Varga [Mon, 27 Sep 2021 12:57:38 +0000 (14:57 +0200)]
Deprecate ProductAwareBuilder

This interface is not used anywhere, deprecate it for removal.

JIRA: YANGTOOLS-1325
Change-Id: I81afcaabf475453feddf494efc62288a601500f2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c6f00f6b9f04587bc5b9ecab472732693086297b)

2 years agoFix Decima64.valueOf(String) 63/97463/1
Robert Varga [Sun, 12 Sep 2021 17:31:32 +0000 (19:31 +0200)]
Fix Decima64.valueOf(String)

When we have a maximum-length string we end up reporting running out of
fraction limit. Fix this by correctly accounting for the period.

JIRA: YANGTOOLS-1321
Change-Id: I40b70400004d39a923b536db8b47784d3659bd4a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5d46adb7935241534c69b00a13593f3e8d4ec7d6)

2 years agoFix CanonicalValueViolation.getMessage() 62/97462/1
Robert Varga [Mon, 13 Sep 2021 02:32:11 +0000 (04:32 +0200)]
Fix CanonicalValueViolation.getMessage()

We should not be looking at the tag but rather at message. This fixes
anonymous exceptions being thrown from Decimal64's value support.

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

2 years agoFix EmptyLeafListEffectiveStatement.getOriginal() 57/97457/1
Robert Varga [Sun, 12 Sep 2021 15:44:12 +0000 (17:44 +0200)]
Fix EmptyLeafListEffectiveStatement.getOriginal()

We should not be referencing LeafSchemaNode, but LeafListSchemaNode.

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

2 years agoBump versions to 7.0.9-SNAPSHOT 48/97448/1
Robert Varga [Sat, 11 Sep 2021 13:16:36 +0000 (15:16 +0200)]
Bump versions to 7.0.9-SNAPSHOT

This starts the next development iteration.

Change-Id: I9529682d5171dcd4b126e709aa80a0b23346c0c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix YangErrorInfo.value 47/97447/1
Robert Varga [Sat, 11 Sep 2021 09:20:50 +0000 (11:20 +0200)]
Fix YangErrorInfo.value

YangErrorInfo is transporting a child of a container, which means it
should not be a plain NormalizedNode, but DataContainerChild instead.

Change-Id: Iec207864854ac3d9afd961635170967bd5cc73aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 9.0.6 27/97427/1
Robert Varga [Wed, 8 Sep 2021 14:41:25 +0000 (16:41 +0200)]
Bump odlparent to 9.0.6

Adopt latest upgrade.

Change-Id: I4a58797bd45c98d4cea5114415d1a4a0ec9c6773
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate UnknownSchemaNode.getExtensionDefinition() 55/97155/2
Robert Varga [Mon, 6 Sep 2021 22:34:25 +0000 (00:34 +0200)]
Deprecate UnknownSchemaNode.getExtensionDefinition()

This method is not really useful, as its equivalent can easily be
achieved via SchemaContext lookup. Deprecate it for removal.

JIRA: YANGTOOLS-1319
Change-Id: Ia8f04e4843438988c999d966b72cb078b3f905e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 21591c31b5ac5e09697f3da891363b8b9a1c0cf8)

2 years agoCorrect argument type documentation 05/97405/1
Robert Varga [Mon, 6 Sep 2021 14:43:20 +0000 (16:43 +0200)]
Correct argument type documentation

We have switched to using yang.common.Empty instead of java.lang.Void
due to nullability. Unfortunately not all javadocs were correct updated,
this corrects that mistake.

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

2 years agoUse DefaultWithDataTree.WithSubstatements for lists 02/97402/1
Robert Varga [Mon, 6 Sep 2021 11:25:59 +0000 (13:25 +0200)]
Use DefaultWithDataTree.WithSubstatements for lists

AbstractListEffectiveStatement is duplicating WithSubstatements
functionality, make sure we inherit it.

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

2 years agoDo not retain reference to StatementMap 54/97154/1
Robert Varga [Thu, 2 Sep 2021 16:28:38 +0000 (18:28 +0200)]
Do not retain reference to StatementMap

Once we have finished iterating, we do not need to retain a reference to
the StatementMap. Promote Regular's iterator to a named class and clear
the reference as soon as we are done. Eliminates a YKP's report of a
possible leak.

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

2 years agoFix a javadoc typo 58/97358/1
Robert Varga [Mon, 30 Aug 2021 12:02:45 +0000 (14:02 +0200)]
Fix a javadoc typo

The word is 'schema', not 'screma'.

Change-Id: I2509b6708f47b583019cbfc002d5fe6011771eb6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd support for yang-data inference 56/97356/6
Robert Varga [Mon, 30 Aug 2021 09:46:53 +0000 (11:46 +0200)]
Add support for yang-data inference

We will be needing inference abilities across yang-data. Add support for
entering in yang-data and also navigating within it.
YAngDataEffectiveStatement is updated to fully support schema tree and
data tree lookups.

JIRA: YANGTOOLS-1297
Change-Id: I1a10165017070a9430d5c9e43b3a705bc75c4d02
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove SchemaInferenceStack test coverage 57/97357/2
Robert Varga [Mon, 30 Aug 2021 10:30:16 +0000 (12:30 +0200)]
Improve SchemaInferenceStack test coverage

Add a few unit tests to improve coverage. Also fix error reporting and
javadoc.

Change-Id: I8338829a89e3fe07e944cf4eb3c576a48f87d3fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate SchemaPath 54/97354/2
Robert Varga [Mon, 30 Aug 2021 08:54:26 +0000 (10:54 +0200)]
Deprecate SchemaPath

SchemaPath has only a few remaining users, with two different concepts
added to cover the two significant use cases. Add pointers to
replacements and deprecate SchemaPath.

JIRA: YANGTOOLS-1238
Change-Id: I21b98fef8112b0773c342fc83356cca9f3b64188
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoTerminally deprecate SchemaNode.getPath() 53/97353/1
Robert Varga [Sun, 29 Aug 2021 09:01:21 +0000 (11:01 +0200)]
Terminally deprecate SchemaNode.getPath()

This method has been on its slow way out. An alternative addressing
construct is presented through EffectiveStatementInference and
SchemaInferenceStack, so all downstreams should be able to migrate with
relative ease now. Add a stern warning with terminal deprecation with
the intent to remove in yangtools-8.

JIRA: YANGTOOLS-1071
Change-Id: Idfbff326eff741fb53af74f35238b999b812993e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCorrect EffectiveStatementMixins documentation 52/97352/2
Robert Varga [Sat, 28 Aug 2021 14:44:57 +0000 (16:44 +0200)]
Correct EffectiveStatementMixins documentation

The correct type to use for no argument is Empty, not Void.

Change-Id: I68456096336d7e0d93139600375c9d8479dbb6ab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove InferredStatementContext.childCopyType 24/95224/12
Robert Varga [Thu, 18 Feb 2021 08:18:41 +0000 (09:18 +0100)]
Remove InferredStatementContext.childCopyType

This field is costing us object size in both 32bit and uncompressed
64bit mode. Since the field only encodes 2 bits, move this storage
to StatementContextBase.copyHistory, saving 8/8/0/0 bytes.

JIRA: YANGTOOLS-1256
Change-Id: Ifeb2cefd0449a4d9112f31a4c511a63dc5b0fb10
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRequire SCR in yang-{data,parser}-impl 04/96704/2
Robert Varga [Mon, 28 Jun 2021 19:35:00 +0000 (21:35 +0200)]
Require SCR in yang-{data,parser}-impl

We need OSGi with SCR, otherwise we end up without activated services.
Make sure we have the appropriate annotation.

Change-Id: I5c7e67a531bb7b4e4c48de1872bcfc320557073f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd support for RFC8639 extensions 48/97348/5
Robert Varga [Fri, 27 Aug 2021 12:18:29 +0000 (14:18 +0200)]
Add support for RFC8639 extensions

We have an internal YANG extension defined in rfc8639. Teach the parser
to correctly recognize it.

JIRA: YANGTOOLS-1314
Change-Id: I96c30c9728e61cadbc550b0b96d925719593c0d6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 7.0.8-SNAPSHOT 14/97314/1
Robert Varga [Tue, 24 Aug 2021 11:08:42 +0000 (13:08 +0200)]
Bump versions to 7.0.8-SNAPSHOT

This starts the next development iteration.

Change-Id: Ibf0ccd22eb887cb73d5fd0aafc36705d53262f0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 9.0.5 11/97311/1
Robert Varga [Tue, 24 Aug 2021 11:07:18 +0000 (13:07 +0200)]
Bump odlparent to 9.0.5

Pick up the stray fixup for bcutil.

Change-Id: Ibcc8b09b92c1530175f6a08c7a273fe1b41fc786
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 7.0.7-SNAPSHOT 99/97299/1
Robert Varga [Mon, 23 Aug 2021 16:36:30 +0000 (18:36 +0200)]
Bump versions to 7.0.7-SNAPSHOT

This starts the next development iteration.

Change-Id: I838d40475d06cc0c490b3943c121926f6b885746
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 9.0.4 98/97298/1
Robert Varga [Mon, 23 Aug 2021 16:22:48 +0000 (18:22 +0200)]
Bump odlparent to 9.0.4

Pick up latest fixes from upstream.

Change-Id: I0504633d43bf8d39f18fbd226da06bb4244c8dfa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 7.0.6-SNAPSHOT 62/97262/3
Robert Varga [Thu, 19 Aug 2021 13:47:48 +0000 (15:47 +0200)]
Bump versions to 7.0.6-SNAPSHOT

This starts the next development iteration.

Change-Id: I29e015353b17caa388834d59c30ff8c36da1f4b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 9.0.3 60/97260/1
Robert Varga [Thu, 19 Aug 2021 13:26:49 +0000 (15:26 +0200)]
Bump odlparent to 9.0.3

Pick up latest fixes from upstream.

Change-Id: Ib9d74aa33ada2e5108f9725cbb62eca75c24720b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAllow refine to change 'default' in leaf-list 57/97257/2
Robert Varga [Thu, 19 Aug 2021 12:36:51 +0000 (14:36 +0200)]
Allow refine to change 'default' in leaf-list

RFC7950 allows 'default' to be specified for 'leaf-list's, which we
recognize. Unfortunately the definition of refine statement does not
take this into account. Fix that and add an explicit test.

JIRA: YANGTOOLS-1312
Change-Id: I0c3ba7ca7cabba486c7226d520ce82a7ec2d194b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRetrofit YangNetconfError for {min,max} elements 48/97248/3
Robert Varga [Wed, 18 Aug 2021 21:53:33 +0000 (23:53 +0200)]
Retrofit YangNetconfError for {min,max} elements

We pretty much everything we need for a proper report, add the basic
infrastructure.

JIRA: YANGTOOLS-1311
Change-Id: I9ac9b0a8000c2862ac4f4b50abd7ffdca118149a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoExpand UniqueConstraintTest 56/97256/1
Robert Varga [Thu, 19 Aug 2021 10:11:22 +0000 (12:11 +0200)]
Expand UniqueConstraintTest

Add a few asserts for the YangNetconfError reported.

JIRA: YANGTOOLS-1306
Change-Id: I262d85b910ec12729fb44bf2bfbb843dcab8d15b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup TestModel a bit 55/97255/1
Robert Varga [Thu, 19 Aug 2021 10:08:11 +0000 (12:08 +0200)]
Cleanup TestModel a bit

Add two FIXMEs and inline a unneeded constant.

Change-Id: Ic19101dff22b4953d45df110a8209593bd49fbe3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRetrofit YangNetconfError into Unique*Exception 88/96688/8
Robert Varga [Sun, 27 Jun 2021 19:20:21 +0000 (21:20 +0200)]
Retrofit YangNetconfError into Unique*Exception

Add a basic bridge to YangNetconfError. This allows NETCONF WG
protocols, like NETCONF and RESTCONF, to report unified complete
information about failure causes.

JIRA: YANGTOOLS-1306
Change-Id: Id8134275fe1b304db88466ad2c6733a48871503e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd DataTreeCandidateInputOutputTest 36/97236/2
Robert Varga [Tue, 17 Aug 2021 11:54:19 +0000 (13:54 +0200)]
Add DataTreeCandidateInputOutputTest

We have completely untested DataTreeCandidateInputOutput, add some
coverage.

Change-Id: Ib9691949f05678415f8d6c6ec35ae9eb2e3bf29d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix yang-data-codec-binfmt dependencies 37/97237/1
Robert Varga [Tue, 17 Aug 2021 19:35:37 +0000 (21:35 +0200)]
Fix yang-data-codec-binfmt dependencies

There is slight confusion between model-api and data-api, we should be
using the latter.

Change-Id: Ib61e43df0e922565ee8b43c2b2dc3ff31431a784
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd NormalizedNodeDataOutputTest 35/97235/2
Robert Varga [Tue, 17 Aug 2021 11:01:59 +0000 (13:01 +0200)]
Add NormalizedNodeDataOutputTest

We have a few lines which are not covered by tests, make sure we cover
them.

Change-Id: If36df82225381edeafaf1f4d0d935fe8cf78a5a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoReduce strings duplication 34/97234/1
Robert Varga [Tue, 17 Aug 2021 10:52:01 +0000 (12:52 +0200)]
Reduce strings duplication

Sonar is complaining about duplicate strings, make sure it complains a
bit less.

Change-Id: I12cd6d8b1bd8a4abb300c75e578f45a1d176f7d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd a 9.0.0 FIXME 11/97211/1
Robert Varga [Fri, 13 Aug 2021 23:26:16 +0000 (01:26 +0200)]
Add a 9.0.0 FIXME

It seems we want to reverse nullability, add a FIXME for investigation.

Change-Id: I6fe89b5f8cd2dda5ac060e95d3fdf8ffb192cc58
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd ErrorTag.MALFORMED_MESSAGE 32/97032/3
Robert Varga [Mon, 26 Jul 2021 23:09:48 +0000 (01:09 +0200)]
Add ErrorTag.MALFORMED_MESSAGE

This is an error-tag defined by RFC6241, as that is an update to
semantics we know about.

JIRA: YANGTOOLS-1310
Change-Id: I3d7961dcfb8bf903a2ce232bd7aae60abd34c68f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoErrorTag should be Serializable 31/97031/2
Robert Varga [Mon, 26 Jul 2021 22:55:47 +0000 (00:55 +0200)]
ErrorTag should be Serializable

We want to transport ErrorTag as a type-safe string. Add the infra
to do that. Note that the serialization format places an upper bound
of 64K -- and that is very reasonable for an ErrorTag.

JIRA: YANGTOOLS-1309
Change-Id: Ib0049fbddc92e9b8ec9e1b37851e0de6f6faaad6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 7.0.5-SNAPSHOT 15/97015/1
Robert Varga [Sat, 24 Jul 2021 17:24:30 +0000 (19:24 +0200)]
Bump versions to 7.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: I692630c4ed1c33743ac33bdf3c69a8f632d4bc36
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not cache parent refcount during inference 14/97014/1
Robert Varga [Sat, 24 Jul 2021 17:05:11 +0000 (19:05 +0200)]
Do not cache parent refcount during inference

When we are processing uses statements with refines we end up expanding
effective statements, which has effects on refcount mechanics. One
notable problem is that we may be observing a world where not all of
reference have been established yet.

We therefore must not use parentRef cache until all of our ancestors
have completed ModelProcessingPhase.EFFECTIVE_MODEL.

JIRA: YANGTOOLS-1308
Change-Id: I3e26244899ada796f380fad72bb040cff42dd667
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd refcount to ReactorStmtCtx 12/97012/1
Robert Varga [Thu, 22 Jul 2021 11:57:56 +0000 (13:57 +0200)]
Add refcount to ReactorStmtCtx

Having a reference count is nice tool for debugging liveness. Add it
to toString(), as it costs nearly nothing.

Change-Id: Iad1762c037715834c8fd27c1c6090d80bb490679
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate yang.common.YangError 87/96687/17
Robert Varga [Fri, 25 Jun 2021 20:42:40 +0000 (22:42 +0200)]
Deprecate yang.common.YangError

YangError is quite lacking in terms of having the ability to express
errors. We have YangNetconfError as a better replacement, hence
deprecate YangError for removal.

Also retrofit YangNetconfError into the only exception which is
currently using YangError.

JIRA: YANGTOOLS-1305
Change-Id: I881444f1680e61c8f603fea9ab4d70fe01673ad1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd YangNetconfError 83/96883/1
Robert Varga [Wed, 14 Jul 2021 09:05:58 +0000 (11:05 +0200)]
Add YangNetconfError

This is a yang-data-api specialization of a well-known RFC4741/6020
construct, which we have tried to model in yang.common.RpcError and
then via yang.common.YangError.

Unlike YangError, which is directly glued to exceptions,
YangNetconfError has a builder-based immutable implementation, which can
be attached to other objects via YangNetconfErrorAware.

JIRA: YANGTOOLS-1305
Change-Id: I7aa1b587ea74c552996b62514861b4b8b262361e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd YangErrorInfo 82/96882/1
Robert Varga [Wed, 14 Jul 2021 08:54:42 +0000 (10:54 +0200)]
Add YangErrorInfo

Add YangErrorInfo class to hold NormalizedNode-based additional
information for RpcError-like constructs. Also add YangErrorInfos, which
makes it super easy to create well-known error infos like bad-element et
al.

JIRA: YANGTOOLS-1304
Change-Id: If2f45fb0c617396531de7592e29d4e09a1c06f3a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd yang.common.Error{Severity,Tag,Type} constructs 82/96682/22
Robert Varga [Sat, 26 Jun 2021 14:45:21 +0000 (16:45 +0200)]
Add yang.common.Error{Severity,Tag,Type} constructs

There is a number of error-reporting constructs which are defined across
RFC4741, RFC6020, RFC6241 and RFC8040. These originate from NETCONF, but
are quite integrated in the YANG enforcement specification.

- NetconfLayer to identify the NETCONF layer involved
- ErrorSeverity to discern errors and warnings
- ErrorType to express error-types reported
- ErrorTag to extensibly identify error-tag reported

Also add proper RFC4741/RFC6241 namespace anchors and use them as
appropriate.

JIRA: YANGTOOLS-1303
Change-Id: Idbb0d7ac4a2b58f930b06d14522872a18e7037d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix two sonar issues 06/96806/1
Robert Varga [Mon, 5 Jul 2021 14:50:54 +0000 (16:50 +0200)]
Fix two sonar issues

Rather than using a boolean constant in a ?: expression, use a simple
logical or, which does the same thing, but more densely.

Change-Id: If0ce9e755f1323cd28926f4f03f4c8168f7ce8b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup NormalizedNodeStreamReaderWriterTest 65/96765/1
Robert Varga [Thu, 1 Jul 2021 14:33:42 +0000 (16:33 +0200)]
Cleanup NormalizedNodeStreamReaderWriterTest

Use assertThrows() and make a few cleanups.

Change-Id: Idd87668118569881c3c4cda43451c152f89a15f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRequire SCR from yang-xpath-impl 02/96702/1
Robert Varga [Mon, 28 Jun 2021 18:06:04 +0000 (20:06 +0200)]
Require SCR from yang-xpath-impl

The jar cannot work in OSGi without SCR, make sure annotate as such.

Change-Id: I1281094adc161aed606ed1937ae6999f50f79e9f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd missing spotbugs annotations in xpath-impl 01/96701/1
Robert Varga [Mon, 28 Jun 2021 18:04:59 +0000 (20:04 +0200)]
Add missing spotbugs annotations in xpath-impl

Somehow we have been missing this annotation import, fix that up.

Change-Id: Ib39814bca421b6518f7e1bb0e8c8ec38350747fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd YangError.getErrorTag() 78/96678/2
Robert Varga [Fri, 25 Jun 2021 16:00:14 +0000 (18:00 +0200)]
Add YangError.getErrorTag()

Error tags are well-defined and mandatory-to-include in NETCONF/YANG
error handling model. Make sure we expose this information from
YangError (and by extension from YangInvalidValueException).

JIRA: YANGTOOLS-1301
Change-Id: Ie914fda40b04facf56c5d644c41b3c91a8948dcd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoReport ErrorType.APPLICATION from codecs 77/96677/1
Robert Varga [Fri, 25 Jun 2021 15:27:39 +0000 (17:27 +0200)]
Report ErrorType.APPLICATION from codecs

Codecs are cross-referencing an already-parsed value with YANG
constraints, which puts them squarely to Content layer of NETCONF
protocol -- and that implies ErrorType.APPLICATION.

JIRA: YANGTOOLS-1300
Change-Id: Icd6d2fbfbda554bc09978725d33f927d87d526ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 7.0.4-SNAPSHOT 63/96563/1
Robert Varga [Fri, 18 Jun 2021 15:37:46 +0000 (17:37 +0200)]
Bump versions to 7.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: Ia48f9eb26c25d1d6dc53f482553f5e1e3cc049c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRevert "Fix mandatory enforcer failure on augmented nodes" 62/96562/1
Robert Varga [Fri, 18 Jun 2021 14:23:43 +0000 (16:23 +0200)]
Revert "Fix mandatory enforcer failure on augmented nodes"

This reverts commit 7862271a33b14d21ebf1e72aacd05d3e4687c6b1, as it is
an incomplete solution. Specifically it fails to understand differences
in augmentations.

JIRA: YANGTOOLS-1276
Change-Id: I8dc581449e17cba04b741970e53c8545fc95d973
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd DistinctNodeContainer.getChildByArg() 32/96532/1
Robert Varga [Tue, 15 Jun 2021 17:30:06 +0000 (19:30 +0200)]
Add DistinctNodeContainer.getChildByArg()

There are a number of places where there is an implied assertion
that the child must exist, but the caller does not care about the
exception being reported.  These are using
findChildByArg().orElseThrows() today, could use a more expressive
alternative.

Add getChildByArg() as a default method, which wraps a call to
childByArg() with a verifyNotNull(), neatly expressing the intent.

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