yangtools.git
2 years agoSpecialize GroupingEffectiveStatement 57/98857/6
Robert Varga [Mon, 6 Dec 2021 11:50:56 +0000 (12:50 +0100)]
Specialize GroupingEffectiveStatement

We can save a field if the argument matches the declared value, which
translates to some tiny savings.

JIRA: YANGTOOLS-1316
Change-Id: Id232da26c1acbfad74373d6605b1a9fdd1c86b2e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse a dedicated map for schema/data tree namespace 54/98854/3
Robert Varga [Mon, 6 Dec 2021 09:50:52 +0000 (10:50 +0100)]
Use a dedicated map for schema/data tree namespace

Heap analysis shows that we have roughly 52K SingletonImmutableMaps,
each of which costs 48 bytes. We can store the equivalent information
with a dedicated structure.

JIRA: YANGTOOLS-652
Change-Id: I18d1f247fb6a03e6964efaca4a612917eb89a6c9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSpecialize ChoiceEffectiveStatement implementations 55/98855/3
Robert Varga [Mon, 6 Dec 2021 10:12:26 +0000 (11:12 +0100)]
Specialize ChoiceEffectiveStatement implementations

We can shift default case and argument to a separate class, saving a few
bytes in the usual case.

JIRA: YANGTOOLS-1316
Change-Id: I2520846f65c3cca908282c3ca7696e974b953a38
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse EmptyLeafEffectiveStatement in copyLeaf() 53/98853/2
Robert Varga [Mon, 6 Dec 2021 08:52:05 +0000 (09:52 +0100)]
Use EmptyLeafEffectiveStatement in copyLeaf()

If the arguments match, we can reuse empty leaf, as there is no other
state we keep.

JIRA: YANGTOOLS-1316
Change-Id: Ia822beba18834d291c33db0007c3686427d1069c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse a linear TypedefNamespace 51/98851/5
Robert Varga [Mon, 6 Dec 2021 07:17:42 +0000 (08:17 +0100)]
Use a linear TypedefNamespace

We do not access TypedefNamespace in our code and it usually is empty,
implement it as a linear search map.

JIRA: YANGTOOLS-1375
Change-Id: I231dfc297bca6e85a2e998d3a2fe1b2bc83e7ad4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSpecialize ContainerEffectiveStatementImpl 52/98852/2
Robert Varga [Mon, 6 Dec 2021 08:42:47 +0000 (09:42 +0100)]
Specialize ContainerEffectiveStatementImpl

We can improve class layout by omitting the argument if it was unchanged
relative to declaration. Split the implementation into two classes.

JIRA: YANGTOOLS-1316
Change-Id: I2852f35d9f22cbdad70fa3a4786cfba7cc9c5faf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDefer mutatesEffectiveCtxPath() hookOnto() 66/98666/5
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>
2 years agoExpose conformance type from module 49/98849/3
Robert Varga [Sun, 5 Dec 2021 19:39:04 +0000 (20:39 +0100)]
Expose conformance type from module

RFC7950 indirectly defines various conformance types. Make sure we
expose that from ModuleEffectiveStatement. The actual value still needs
to be determinated.

JIRA: YANGTOOLS-837
Change-Id: I20d0b5800b50eaa7fed126e867895da5545d4175
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove TypDefinition creation 48/98848/3
Robert Varga [Sun, 5 Dec 2021 18:49:50 +0000 (19:49 +0100)]
Move TypDefinition creation

TypedDataSchemaNode has getType(), which we can provide externally as a
utility method. Move the implementation, so we can reconsider caching
this value in future.

Change-Id: I300ce6b9deb739a8120b13ed990c8a6504acf036
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoOptimize LeafListEffectiveStatement layout 47/98847/3
Robert Varga [Sun, 5 Dec 2021 18:26:01 +0000 (19:26 +0100)]
Optimize LeafListEffectiveStatement layout

We can save a field in case the declared statement's argument matches
the effective argument.

JIRA: YANGTOOLS-1316
Change-Id: I980730aa3272f9c8280f16eaf5f77201d3870f30
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoOptimize ListEffectiveStatement layout 46/98846/3
Robert Varga [Sun, 5 Dec 2021 17:56:49 +0000 (18:56 +0100)]
Optimize ListEffectiveStatement layout

We can save a field in case the declared statement's argument matches
the effective argument.

JIRA: YANGTOOLS-1316
Change-Id: I02842d9dbe741b2d26f3f75948103715707df3b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdjust LeafEffectiveStatement argument storage 45/98845/2
Robert Varga [Sun, 5 Dec 2021 16:11:45 +0000 (17:11 +0100)]
Adjust LeafEffectiveStatement argument storage

For original leaves the argument matches the declared view, hence
we can save a field.

JIRA: YANGTOOLS-1316
Change-Id: I6eb3190ad1fc368faeedd3e2ad60fbbaca526a9f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove DerivableSchemaNode 44/98844/1
Robert Varga [Sun, 5 Dec 2021 15:23:05 +0000 (16:23 +0100)]
Remove DerivableSchemaNode

DerivableSchemaNode.getOriginal() has a rather large storage cost, which
is not required anywhere in our code base. Remove it.

JIRA: YANGTOOLS-1377
Change-Id: I7161710b554928cf88dfbf0d484d3ae9a9be48a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoExtract EffectiveStatementState from schema tree statements 34/98834/5
Robert Varga [Fri, 3 Dec 2021 13:19:21 +0000 (14:19 +0100)]
Extract EffectiveStatementState from schema tree statements

SchemaTree statements are the most common statements we copy around. In
order to store them as efficiently as possible. Take advantage of the
new deduplication facilities by extracting significant state.

JIRA: YANGTOOLS-1214
Change-Id: I7b1b9c5469a25f9df1d490798a0dfd76562253b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRename StmtContext.Mutable.setIsSupportedToBuildEffective() 42/98842/1
Robert Varga [Sat, 4 Dec 2021 10:55:23 +0000 (11:55 +0100)]
Rename StmtContext.Mutable.setIsSupportedToBuildEffective()

This method is a mouthful and is really used to set the flag to false,
rename it and adjust callers.

Change-Id: Ia4a07c4c3e7b82c02bcf686b97ebd844aec092d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoIntern statements along copy axis 78/97378/7
Robert Varga [Thu, 2 Sep 2021 17:39:54 +0000 (19:39 +0200)]
Intern statements along copy axis

When we are inferring statements through grouping/uses, we end up adding
a few bits to record the copy history and effective status/config. This
process does not feed back anything back to the original declaration
site.

This leads to a situation when we can have a number of inferred
statements which are exactly equal, yet each is its own java object --
hence unnecessarily using heap for duplicate objects.

We can improve this by having a deduplication map at the site of
original declaration and updating/consulting it when we find we have an
otherwise-unmodified statement.

This patch adds the prerequisite constructs to yang-parser-spi and
the smarts to perform this deduplication to yang-parser-reactor.

JIRA: YANGTOOLS-1214
Change-Id: I957c6d69d16717759f22a78163c705390e602e22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not retain single-entry RangeSets 39/98839/4
Robert Varga [Fri, 3 Dec 2021 23:21:41 +0000 (00:21 +0100)]
Do not retain single-entry RangeSets

ImmutableRangeSet with a single entry is a tad inefficient: we retain
the set and also a singleton list. Rather than doing that, store only
the single range -- reducing the number of objects we retain.

JIRA: YANGTOOLS-1376
Change-Id: I8a3b497fa4c4b8a0106136f056bb363d6e103930
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoExpose substatement lists 40/98840/1
Robert Varga [Sat, 4 Dec 2021 05:42:33 +0000 (06:42 +0100)]
Expose substatement lists

DeclaredStatement.declaredSubstatements() and
EffectiveStatement.effectiveSubstatements() should be exposing a List
instead of a Collection to make things easier on users.

Also update yang-model-{spi,ri} to promise an ImmutableList, as that
is what they provide.

Change-Id: I459e98a1072f1ad9f720b9aa1614ac9b75d7328b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoIntern PatternExpressions 36/98836/2
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>
2 years agoDecouple choice/case statements 59/98759/2
Robert Varga [Tue, 30 Nov 2021 21:52:39 +0000 (22:52 +0100)]
Decouple choice/case statements

Use StatementSupportNamespace to perform on-demand lookup of
CaseStatementSupport instead of hard-wiring it at instantiation time.

JIRA: YANGTOOLS-1371
Change-Id: Id6d2b8185918c206659447b58341edfb4860f349
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd StatementSupportNamespace 58/98758/2
Robert Varga [Tue, 30 Nov 2021 20:21:49 +0000 (21:21 +0100)]
Add StatementSupportNamespace

Expose StatementSupports registered for a particular root from a new
namespace, StatementSupportNamespace. SourceSpecificContext already has
all the knowledge and wiring required to make this work, so it is a
rather straightforward exercise.

This immediately allows us to loosen couplig betwen action/rpc and
input/output supports. Unfortunately choice/case coupling still remains
as we do not get a reference to the statement context in execution path.

JIRA: YANGTOOLS-1371
Change-Id: Iccf8fd394c5bf172cda73c820f1a483b04bbc7a4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove ModulesDeviatedByModules.SupportedModules 31/98631/3
Robert Varga [Mon, 22 Nov 2021 07:30:29 +0000 (08:30 +0100)]
Remove ModulesDeviatedByModules.SupportedModules

We require only a non-null key, there is no point in defining an
enumeration for that -- just use yang.common.Empty, just as we do in
other places.

Change-Id: I22d83d51436636078946840f1eb6bb33d3f95ccb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove SupportedFeaturesNamespace.SupportedFeatures 30/98630/3
Robert Varga [Mon, 22 Nov 2021 07:26:01 +0000 (08:26 +0100)]
Remove SupportedFeaturesNamespace.SupportedFeatures

We require only a non-null key, there is no point in defining an
enumeration for that -- just use yang.common.Empty, just as we do in
other places.

Change-Id: I9d0541243a29e5f860566e2a922e30309f0375a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoReflect supported features in effective model 29/98629/3
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>
2 years agoRemove Empty.getInstance() 06/98506/2
Robert Varga [Sun, 14 Nov 2021 18:34:51 +0000 (19:34 +0100)]
Remove Empty.getInstance()

Remove deprecated method. Also promote Empty to stable status by
removing @Beta annotation.

JIRA: YANGTOOLS-1364
Change-Id: I7fac9e6f652abf3655f809d634c65a34c35ed44e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd QNameModule documentation 07/98507/2
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>
2 years agoAdd Empty.value() 05/98505/2
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>
2 years agoCorrect bundle-parent's coordinates 55/98255/2
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>
2 years agoUse Map.entry() in ModuleNamespaceContext 09/98009/4
Robert Varga [Wed, 20 Oct 2021 17:58:38 +0000 (19:58 +0200)]
Use Map.entry() in ModuleNamespaceContext

This is simpler and does not need identity in future.

Change-Id: I902405b2f8367f3da01d18c4c949571960ff4620
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix mandatory enforcer failure on augmented nodes 96/96596/12
Tibor Král [Tue, 22 Jun 2021 14:28:27 +0000 (08:28 -0600)]
Fix mandatory enforcer failure on augmented nodes

Changes the way mandatory nodes are extracted from the schema.
Previously all mandatory nodes were approached as direct children of
the parent node. Even if they came from an augmentation which caused
"missing mandatory descendant" exceptions. This patch preserves both
options of building data nodes containing augmented mandatory nodes:
- setting the mandatory node as a direct child of the parent node
- setting the mandatory node as an AugmentationNode to the parent node

However the former option seems to be incorrect and might be removed
in the future major release.

This patch also covers the case where the mandatory leaf is deeper in
the augmented subtree.

JIRA: YANGTOOLS-1276
Change-Id: Ic5cd1950b935720bf56f52cfbc24c0f9e776a474
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
2 years agoRevert "Revert "Fix mandatory enforcer failure on augmented nodes"" 25/96625/5
Tibor Kr�l [Wed, 21 Jul 2021 07:52:22 +0000 (07:52 +0000)]
Revert "Revert "Fix mandatory enforcer failure on augmented nodes""

This reverts commit 7c0832aec2141aa95dd2b6a2d2dcc5501410c2ad. The correct
solution is built on top of this change.

JIRA: YANGTOOLS-1276
Change-Id: Id560049304cf37d62050fbf5ad59c995d11939a5
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
2 years agoRevert "Move SchemaNodeIdentifier to yang-common" 48/98248/1
Robert Varga [Sat, 30 Oct 2021 22:47:05 +0000 (00:47 +0200)]
Revert "Move SchemaNodeIdentifier to yang-common"

This reverts commit e8049b7d125af0f60c608623683a31d0f366a462, as it is
not the right thing to do. The problem is that it increases exposure of
SchemaNodeIdentifier to components (Binding, for example), where it is
causing cognitive pollution.

JIRA: YANGTOOLS-1358
Change-Id: If48dc77accf2d24f1eb62822499ba5d1a634bbc8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRequire java.compiler in yang-data-api 21/98221/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>
2 years agoNote future YangErrorInfo evolution 46/98146/2
Robert Varga [Tue, 26 Oct 2021 21:19:37 +0000 (23:19 +0200)]
Note future YangErrorInfo evolution

We need to evolve this contract based on experience gained during
implementation.

Change-Id: I20597ae15830386c13d9b4df4cc0a5942d77ff0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse VarHandle for toStringCache 01/98201/4
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>
2 years agoMove SchemaNodeIdentifier to yang-common 52/98152/5
Robert Varga [Wed, 27 Oct 2021 00:31:08 +0000 (02:31 +0200)]
Move SchemaNodeIdentifier to yang-common

SchemaNodeIdentifier has not further ties to yang-model-api and maps out
a well-defined core YANG construct. Move it to yang-common.

JIRA: YANGTOOLS-1358
Change-Id: Ia94e990a4eb1b5033440b5d1e6783b19a48385ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAllow rebinding the prefix of an UnresolvedQName 69/98169/1
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>
2 years agoRemove SchemaNodeIdentifier.asSchemaPath() 51/98151/3
Robert Varga [Wed, 27 Oct 2021 00:18:00 +0000 (02:18 +0200)]
Remove SchemaNodeIdentifier.asSchemaPath()

Disconnect SchemaNodeIdentifier from SchemaPath. The replacement
lives as SchemaPath.of() family of methods.

Change-Id: Ia1e41eb412c0f80562ae38354b7cd7bc7a238366
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd SchemaPath.of(SchemaNodeIdentifier) 50/98150/3
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>
2 years agoImprove UnresolvedQNameReferent 94/98094/1
Robert Varga [Sat, 23 Oct 2021 22:33:39 +0000 (00:33 +0200)]
Improve UnresolvedQNameReferent

We now have UnresolvedQName, use it to mark that the required return
type. Since the two specializations now clash on return type, the two
interfaces cannot be implemented even without QNameReferentBehavior
magic.

Change-Id: I1da5a8df89c5dfe64c815a1cd5158d2f60c0b1da
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix YANG export with duplicate imports 44/97344/4
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>
2 years agoBump odlparent to 9.0.8 95/97995/1
Robert Varga [Tue, 19 Oct 2021 20:49:55 +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 79/97979/1
Robert Varga [Tue, 19 Oct 2021 15:25:56 +0000 (17:25 +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 agoGenerate an execution report from yang-maven-plugin-it 60/97960/6
Robert Varga [Mon, 18 Oct 2021 16:15:18 +0000 (18:15 +0200)]
Generate an execution report from yang-maven-plugin-it

Adjust our wiring to pass down failsafe argLine to our individual
maven invocations. This ends up producing correct execution reports.

The second part end up merging these partial reports into a single
execution report.

The third part is to unpack yang-maven-plugin and its dependencies,
which means classes can be looked up and jacoco thinks this is coming
from us. Yeah, not nice, but works.

JIRA: YANGTOOLS-1167
Change-Id: I4179b96d8a0039041160f9143798b785a74fb932
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump maven-verifier to 1.7.2 59/97959/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>
2 years agoUpdate ANTLR grammar documentation 30/97930/1
Robert Varga [Sat, 16 Oct 2021 14:37:07 +0000 (16:37 +0200)]
Update ANTLR grammar documentation

We have a mis-reference and its parser section needs point out that
the end result is not a complete YANG structure as per ABNF, but rather
the equivalent of lexer stream, which is interpreted in Java code.

Change-Id: I36619c864feba8b1583c83bc2ab2cab465b6bba5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate EffectiveStmtCtx.Current.original() 21/97921/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>
2 years agoDeprecate AddedByUsesAware 20/97920/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>
2 years agoAdd more deprecations around SchemaPath 19/97919/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>
2 years agoDeprecate DerivableSchemaNode 18/97918/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>
2 years agoDeprecate AugmentationSchemaNode.getOriginalDefinition() 17/97917/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>
2 years agoImprove AbstractYangTest a bit 66/97866/3
Robert Varga [Mon, 11 Oct 2021 12:40:39 +0000 (14:40 +0200)]
Improve AbstractYangTest a bit

Do not declare Exception as thrown but turn it into an assertion.

Change-Id: Ifd069e41e3b28a7c8d3b178d7149f52214c2772a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup code duplication 69/97869/2
Robert Varga [Mon, 11 Oct 2021 15:08:40 +0000 (17:08 +0200)]
Cleanup code duplication

We have a conditional parent sweep block repeated twice, add a private
method to host it.

Change-Id: Id69f00787ad47ca8c15e53e354f318e4ad1d90b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix StatementContextBase.childCopyOf() 65/97865/2
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>
2 years agoFix yang-export warnings 48/97748/2
Robert Varga [Tue, 5 Oct 2021 12:07:18 +0000 (14:07 +0200)]
Fix yang-export warnings

We have a number of tests using deprecated methods, migrate them
to silence warnings. Also schedule those methods for removal.

Change-Id: I189c3c6dad4110413cb33d2d713a6b65aafa6cf4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoValidate cross-revision imports and includes 97/97697/11
Robert Varga [Fri, 1 Oct 2021 13:37:27 +0000 (15:37 +0200)]
Validate cross-revision imports and includes

We are not performing no YANG version validation during include/import
linkage. RFC7950 section 12 specifically forbids a number of cases which
are invalid. Make sure we are enforcing them.

This flushes out a few violations in our test suite, which is also
updated.

JIRA: YANGTOOLS-1339
Change-Id: I7799f08291f9ffc9646b19922af512e28a2c7589
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix a mis-import 47/97747/1
Robert Varga [Tue, 5 Oct 2021 11:13:45 +0000 (13:13 +0200)]
Fix a mis-import

We do not want to be importing checker.qual.K here, and eclipse warns
about shadowing. Fix that.

Change-Id: I9f7b09c8cee3281a62095b22c440d1cc8e082005
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup Bug6870Test 27/97727/3
Robert Varga [Mon, 4 Oct 2021 09:05:59 +0000 (11:05 +0200)]
Cleanup Bug6870Test

Use AbstractYangTest to reduce verbosity and duplication.

JIRA: YANGTOOLS-1345
Change-Id: I973b7c91f3fb33bc315fd6022eea1209e7bde22b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup Bug6897Test 20/97720/4
Robert Varga [Sat, 2 Oct 2021 22:17:20 +0000 (00:17 +0200)]
Cleanup Bug6897Test

Migrate to AbstractYangTest and perform general housekeeping.

Change-Id: Ib2b5c1e22d904a28442995ab6ac5c533a64b1fcd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd AbstractYangTest 19/97719/6
Robert Varga [Sat, 2 Oct 2021 20:51:21 +0000 (22:51 +0200)]
Add AbstractYangTest

We have a number of common assertion patterns, let's start creating a
library.

Change-Id: Ieeccf260c638905fb7bdb77369ced8f845b01ca7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove printing utilities out of StmtTestUtils 18/97718/4
Robert Varga [Sat, 2 Oct 2021 20:09:06 +0000 (22:09 +0200)]
Move printing utilities out of StmtTestUtils

These are used by a single test, move them there.

Change-Id: Ib70dadeed4339a316ac6e12c5df59730f920644a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove more TestUtils classes 17/97717/5
Robert Varga [Sat, 2 Oct 2021 19:56:53 +0000 (21:56 +0200)]
Remove more TestUtils classes

We have some duplication still and some assert code which should be with
its users in AugmentTest.

Change-Id: Ic0df63afaf8f2a5003339b8315a85aaea08de1b5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup TestUtils.parseYangSources() 16/97716/6
Robert Varga [Sat, 2 Oct 2021 19:04:28 +0000 (21:04 +0200)]
Cleanup TestUtils.parseYangSources()

We are being needlessly indirect here, as we are always loading
resources. Clean that up.

Change-Id: I050f5255b50445d348a4e760c7dbedb9c5a33dd8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove unused TestUtils methods 15/97715/5
Robert Varga [Sat, 2 Oct 2021 18:37:26 +0000 (20:37 +0200)]
Remove unused TestUtils methods

We have some code duplication and unused code paths, clean that up.

Change-Id: If3b675420179b285417114a59e386fb57684926c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove {Bug394,TwoRevisions}Test 14/97714/4
Robert Varga [Sat, 2 Oct 2021 18:32:31 +0000 (20:32 +0200)]
Improve {Bug394,TwoRevisions}Test

Improved loading and layout.

Change-Id: I12c617e70c9da1af0ecfbab370007ebfc3a4b416
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove TestUtils.parseYangSources 13/97713/5
Robert Varga [Sat, 2 Oct 2021 17:47:51 +0000 (19:47 +0200)]
Remove TestUtils.parseYangSources

We have loadModules() used more widely, eliminate code duplication. Also
cleanup callers with better assertions.

Change-Id: Iad5a6121dba2c0ea7008a948923c23ce33ad548a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd AbstractModelTest 12/97712/2
Robert Varga [Sat, 2 Oct 2021 16:44:59 +0000 (18:44 +0200)]
Add AbstractModelTest

We have a number of tests which are sharing same EffectiveModelContext,
conceptrate loading and constants and subclass the test. Results in
faster execution and quite cleaner tests.

Change-Id: Ia0c7756c5222c6b736e921be2f16fe8029ccb807
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup ParsingExtensionValueTest 11/97711/2
Robert Varga [Sat, 2 Oct 2021 16:07:56 +0000 (18:07 +0200)]
Cleanup ParsingExtensionValueTest

Simpler loading and better asserts.

Change-Id: I789cbf27e3fb226040babdfa599be614cd885b8a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSpeed up YangParserTest 10/97710/2
Robert Varga [Sat, 2 Oct 2021 16:04:56 +0000 (18:04 +0200)]
Speed up YangParserTest

We have multiple tests sharing the same context, use @BeforeClass
and cleanup loading.

Change-Id: Icfc1f08f8b781b76cdf9c1881f306efdbf093048
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSpeed up YangParserSimpleTest 09/97709/2
Robert Varga [Sat, 2 Oct 2021 16:01:44 +0000 (18:01 +0200)]
Speed up YangParserSimpleTest

Use new loading to load a constant context, shared between the test
cases.

Change-Id: I267d3b17a15108d47591e421b5b6cef0fa3289b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove UsesAugmentTest 08/97708/2
Robert Varga [Sat, 2 Oct 2021 15:56:31 +0000 (17:56 +0200)]
Improve UsesAugmentTest

We have two tests sharing the reactor, use beforeClass() build it only
once and use better loading method to do that.

Change-Id: I82993ea04087c2ee90da40f2aee786a0cde95ee8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup SubstatementValidatorTest 07/97707/2
Robert Varga [Sat, 2 Oct 2021 15:35:18 +0000 (17:35 +0200)]
Cleanup SubstatementValidatorTest

We have a ton of missing asserts and try/catch checking, clean all of
that up.

Change-Id: I9a3fcc050656ddba33e375c84956cfdb2f7ca693
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse java.nio.file.Path in YangTextFileSchemaSource 02/97702/8
Robert Varga [Fri, 1 Oct 2021 16:33:14 +0000 (18:33 +0200)]
Use java.nio.file.Path in YangTextFileSchemaSource

Switching to NIO seems to be a better strategy, as we ned up using it to
access content anyway.

JIRA: YANGTOOLS-1342
Change-Id: I066f1494327b8e4e6007cb3f620aec30a5b94c0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove concepts.Path 06/97706/2
Robert Varga [Sat, 2 Oct 2021 15:06:29 +0000 (17:06 +0200)]
Remove concepts.Path

We have a replacement in HierarchicalIdentifier. Users should have
adapted since last release, remove Path now.

JIRA: YANGTOOLS-1343
Change-Id: I3d030f27947f82f35eb2f1512cf14ab26f0e6a97
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoIntroduce HierarchicalIdentifier to replace Path 05/97705/2
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>
2 years agoInline Bug7480Test model assembly 04/97704/7
Robert Varga [Fri, 1 Oct 2021 20:51:35 +0000 (22:51 +0200)]
Inline Bug7480Test model assembly

We have a few utilities which are noize in StmtTestUtils, move them to
heir sole user. This makes it wee bit more obvious what is going on.
This creates a very useful litte utility in TestUtils.

Change-Id: Ic6fe1a9e36eafc1cde1e42c3b1c2895ccef3e5fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup Bug6874Test 01/97701/2
Robert Varga [Fri, 1 Oct 2021 15:01:46 +0000 (17:01 +0200)]
Cleanup Bug6874Test

We are using ugly asserts and try-catch blocks, clean that up.

Change-Id: Id1e0982f41d5557198152b6f7837340ab345a963
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove a superfluous line 96/97696/2
Robert Varga [Fri, 1 Oct 2021 14:00:45 +0000 (16:00 +0200)]
Remove a superfluous line

Empty line, remove it.

Change-Id: Ifa5c51cf15e05c19bf43345a6868888dd735159c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd a few more utilities to EffectiveModelContext 88/97688/1
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>
2 years agoImprove SchemaInferenceStack error reporting 83/97683/5
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>
2 years agoDeprecate IllegalArgumentCodec for removal 55/97655/1
Robert Varga [Mon, 27 Sep 2021 15:11:40 +0000 (17:11 +0200)]
Deprecate IllegalArgumentCodec for removal

As previously noted, this interface encourages bad patterns. All
downstream users are better served with their domain-specific
interfaces. Deprecate it with the intent to remove.

JIRA: YANGTOOLS-1334
Change-Id: If0e56b2ff575d101dbd090112f22e80565e5e6bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFlatten IllegalArgumentCodec class hierarchy 54/97654/3
Robert Varga [Mon, 27 Sep 2021 14:39:02 +0000 (16:39 +0200)]
Flatten IllegalArgumentCodec class hierarchy

IllegalArgumentCodec is the only specialization which is seeing a
wide use. Integrate all its superinterfaces and superclasses of
AbstractIllegalArgumentCodec into these two constructs.

JIRA: YANGTOOLS-1333
Change-Id: I75078910693e912d5313b7eec43c14ca22eefe2f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoIntroduce UnresolvedQName 46/97646/5
Robert Varga [Mon, 27 Sep 2021 11:38:09 +0000 (13:38 +0200)]
Introduce UnresolvedQName

Our AbstractQName hierarchy has either a resolved QName, or two
unresolved {Qualified,Unqualified}QNames. The quality of being resolved
vs. unresolved is not modeled.

Introduce UnresolvedQName as the only AbstractQName alternative to
QName, so that it can be used to model this distinction. This allows,
for example, yang-xpath-api to be specified better.

JIRA: YANGTOOLS-1329
Change-Id: I9893850cea27bdd98d08b00ceb8c1f288dcc2778
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove util.Immutables 53/97653/3
Robert Varga [Mon, 27 Sep 2021 13:48:45 +0000 (15:48 +0200)]
Remove util.Immutables

This class has been deprecated for removal in a previous release, remove
it now.

JIRA: YANGTOOLS-1331
Change-Id: Iccbba68c82a0f876f230041f02a3519c979995e0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate util.Immutables for removal 52/97652/3
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>
2 years agoRemove ProductAwareBuilder 51/97651/1
Robert Varga [Mon, 27 Sep 2021 12:59:27 +0000 (14:59 +0200)]
Remove ProductAwareBuilder

This interface has been deprecated in 7.0.9, remove it in version 8.0.0.

JIRA: YANGTOOLS-1326
Change-Id: I487914805a00953f1b7ec17c70bd310cef322ae2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate ProductAwareBuilder 50/97650/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>
2 years agoRemove ClassBasedPropertyBuilder 49/97649/1
Robert Varga [Mon, 27 Sep 2021 12:58:25 +0000 (14:58 +0200)]
Remove ClassBasedPropertyBuilder

This interface has been deprecated in 7.0.9, remove it in 8.0.0.

JIRA: YANGTOOLS-1324
Change-Id: I794d7c8350f21997d0b9f65ca028fca3f2ba414b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate ClassBasedPropertyBuilder 48/97648/1
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>
2 years agoMark MutationBehaviour evolution 47/97647/1
Robert Varga [Mon, 27 Sep 2021 12:53:53 +0000 (14:53 +0200)]
Mark MutationBehaviour evolution

We want to nail seal and potentially hide this interface.

Change-Id: Ic496ed97971dec3a0ab52d87e0516608b50ef879
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoPublish identifier matches 01/97501/1
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>
2 years agoUse yang.common.Decimal64 for decimal64 58/97458/4
Robert Varga [Sun, 12 Sep 2021 16:48:44 +0000 (18:48 +0200)]
Use yang.common.Decimal64 for decimal64

We now have a dedicated class for carrying decimal64 values, use that
instead of BigInteger.

JIRA: YANGTOOLS-556
Change-Id: Ifdb672383f73c5845499b55e307c60b1c30ddbd5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix Decima64.valueOf(String) 60/97460/4
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>
2 years agoFix CanonicalValueViolation.getMessage() 61/97461/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>
2 years agoFix DerivableSchemaNode.getOriginal() 56/97456/5
Robert Varga [Sun, 12 Sep 2021 15:45:05 +0000 (17:45 +0200)]
Fix DerivableSchemaNode.getOriginal()

We should be returning a type capture here, fix that up, which prompts
us having to retrofit the interface properly into concrete SchemaNodes
-- making it obvious where we have some overlap.

Change-Id: Ia8648c203f8e1560008711954febb815aecb1b6a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse ErrorTag for RpcError.getTag() 54/97454/4
Robert Varga [Sun, 12 Sep 2021 15:14:48 +0000 (17:14 +0200)]
Use ErrorTag for RpcError.getTag()

We have a dedicated class (and constants) to cover error-tag, use it
instead of plain String.

Change-Id: I3b6776365ec7fcd3769ff485a4a01f5e038f4c1b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove deprecated NETCONF error interfaces 53/97453/5
Robert Varga [Sun, 12 Sep 2021 14:43:52 +0000 (16:43 +0200)]
Remove deprecated NETCONF error interfaces

RpcError.Error{Severity,Type} as well as YangError have their
replacements, hence remove them.

Change-Id: Ib90f3d63ee85524fd03e1f81fd5c4e0fd74a1d78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix EmptyLeafListEffectiveStatement.getOriginal() 55/97455/3
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>
2 years agoFix YangErrorInfo.value 45/97445/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 agoDocument PrettyTreeIndent.INDENT_STRINGS_SIZE 42/97442/1
Robert Varga [Sat, 11 Sep 2021 01:30:20 +0000 (03:30 +0200)]
Document PrettyTreeIndent.INDENT_STRINGS_SIZE

Explain what we are doing here, so that our future selves can properly
update the constant in the future.

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