yangtools.git
2 years agoLock down AbstractResumedStatement.substatements access 02/99002/1
Robert Varga [Wed, 15 Dec 2021 04:23:41 +0000 (05:23 +0100)]
Lock down AbstractResumedStatement.substatements access

We are indirecly using mutableDeclaredSubstatements(), and that method
is not final. It is not overridden anywhere, either. So let us make that
strong assumption by making the method final and accessing substatements
directly for their Stream.

JIRA: YANGTOOLS-1383
Change-Id: I51c025c3195fdb9ca61f5dee394707f72defb854
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoExpose Iterator from effectiveChildrenToComplete() 01/99001/1
Robert Varga [Wed, 15 Dec 2021 04:16:11 +0000 (05:16 +0100)]
Expose Iterator from effectiveChildrenToComplete()

We are only ever iterating here, lower the contract exposed through
here.

Change-Id: Ief041380c5341956e2cf91491bbc05d1c4f08ca7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRefactor StatementFactory.createDeclared() 00/99000/1
Robert Varga [Wed, 15 Dec 2021 03:59:22 +0000 (04:59 +0100)]
Refactor StatementFactory.createDeclared()

Declared statements need to be built from a different source than
StmtContext.declaredStatements(), as those are following a different
structure.

Rather than creating more confusion in StmtContext, feed a
Stream<DeclaredStatement<?>>. Also drop a FIXME for a follow-up patch
to reduce StmtContext proliferation.

JIRA: YANGTOOLS-1383
Change-Id: I94bccc35423cce29ed9a52814827eb561e62e071
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoHide AbstractResumedStatement.walkChildren() 99/98999/2
Robert Varga [Wed, 15 Dec 2021 02:46:40 +0000 (03:46 +0100)]
Hide AbstractResumedStatement.walkChildren()

We have slight (2-line) duplication due to how gadgets are exposed
to StatementContextWriter.

Introduce AbstractResumedStatement.declarationFinished(), which
performs the combination of walking children and calling endDeclared().

This allows us to completely hide endDeclared() and simplify the code a
bit -- including renaming endDeclared() to finishDeclaration().

Change-Id: I5cbc7aa98aa90b2cf92ef603e4b3b0ed34e1dc4c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove StatementContextWriter.exitStatement() 98/98998/2
Robert Varga [Wed, 15 Dec 2021 02:32:16 +0000 (03:32 +0100)]
Move StatementContextWriter.exitStatement()

The logic for entering a declared statement lives in
AbstractResumedStatement, along with the logic to create implicit
parents (i.e. implicit case statements). Also move the code to exit
the declared statement there, so we have all three bits in one place.

Since we have better context for dealing with this, also reshape the
logic, which allows us to move StatementContextBase.endDeclared().

JIRA: YANGTOOLS-1383
Change-Id: Id461464587b997f26624271f9bdf6aa9967f80a9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix a nullness warning 97/98997/1
Robert Varga [Wed, 15 Dec 2021 02:03:32 +0000 (03:03 +0100)]
Fix a nullness warning

getPhase() is required to be non-null, which we are assuring, but do not
have annotated. Add annotation and move the method, as it is a simple
getter.

Change-Id: I71ba333713f8ae25fad0230b5137f025d86faa24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove implicit parent skip code 95/98995/1
Robert Varga [Tue, 14 Dec 2021 21:41:44 +0000 (22:41 +0100)]
Move implicit parent skip code

We have an implicit contract between AbstractResumedStatement and
StatementContextWriter during lookup. Since the structure is defined
in AbstractResumedStatement, we should keep the logic together.

Also fix a slight wart, where we would over-allocate implicit parent's
StatementMap.

JIRA: YANGTOOLS-1383
Change-Id: I167e13015d4fb8d348db140702af89ae005e1077
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUpdate StatementMap javadocs 93/98993/1
Robert Varga [Tue, 14 Dec 2021 21:23:20 +0000 (22:23 +0100)]
Update StatementMap javadocs

We have two undocumented methods, add javadocs.

Change-Id: I5aff94d5e2826bdc1718a725fec23403feab34d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup StatementMap a bit 62/98962/1
Robert Varga [Tue, 14 Dec 2021 00:46:59 +0000 (01:46 +0100)]
Cleanup StatementMap a bit

empty() return a non-null instance and we do not need this. qualifier.

Change-Id: Id68f55c795aaf6ff14a4d3b4920667da1b103743
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd default statementOrigin() implementations 61/98961/2
Robert Varga [Tue, 14 Dec 2021 00:21:03 +0000 (01:21 +0100)]
Add default statementOrigin() implementations

The design of {Model,Declared,Effective}Statement interfaces harks back
to Java 7 days. Refresh it with Java 8's default interface methods,
properly binding them to DeclaredStatement and
EffectiveStatement.getDeclared() methods.

JIRA: YANGTOOLS-1384
Change-Id: I8823b08eb0484fa48024a594081f536ac4b41542
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoHide StatementContextBase 54/98954/2
Robert Varga [Mon, 13 Dec 2021 00:38:15 +0000 (01:38 +0100)]
Hide StatementContextBase

We have an ugly dependency on StatementContextBase in statement
implementations. These should not care about implementation details,
and in fact they do not, as most of the methods involved are already
present in StmtContext.Mutable.

Expose the rest of the required methods and hide the base class. This
has a nice side effect of removing a significant number of unsafe casts.

JIRA: YANGTOOLS-1382
Change-Id: Id44e39dbedcc72089aa276f54ddffee4c60bca4d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDelay modifiers during their processing 52/98952/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>
2 years agoExpose addEffectiveSubstatement() 51/98951/6
Robert Varga [Sun, 12 Dec 2021 15:33:50 +0000 (16:33 +0100)]
Expose addEffectiveSubstatement()

We have partial support for creating effective statements, in the
reactor, but it was not properly structured for all the use cases we
need.

Expose the methods in StmtContext.Mutable and readjust them to allow to
expose statement-agnostic arguments.

JIRA: YANGTOOLS-1372
Change-Id: I1e8806e1c809da2cec82cb92f763002ede78cfdd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate CopyableNode 45/98945/4
Robert Varga [Sun, 12 Dec 2021 06:50:13 +0000 (07:50 +0100)]
Deprecate CopyableNode

// FIXME: add jira issue

Change-Id: Idbd09e698add7e5ae84ab0116591fae7691eb121
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate AddedByUsesAware for removal 44/98944/5
Robert Varga [Sun, 12 Dec 2021 06:47:41 +0000 (07:47 +0100)]
Deprecate AddedByUsesAware for removal

Strenghten deprecation to indicate removal in the next major release.

Change-Id: I5dd08db5ac5ef0cc02284f2ea725913e6430617a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCache CopyType.values() 47/98947/1
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>
2 years agoRemove TreeNodeFactory 43/98943/4
Robert Varga [Sun, 12 Dec 2021 01:19:39 +0000 (02:19 +0100)]
Remove TreeNodeFactory

There is no point in having a single-method utility class, just move
the method to TreeNode instead.

Change-Id: I0a97e9ac8d6e8a938567f581a872ea9653ad57b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMake (Mutable)TreeNode a class 42/98942/4
Robert Varga [Sun, 12 Dec 2021 01:14:38 +0000 (02:14 +0100)]
Make (Mutable)TreeNode a class

A pure interface leads to us having AbstractTreeNode, which is
superfluous. Turn interfaces into abstract classes instead.

Change-Id: Icbf2daf28abb1c7b390006f61989d63d10329ecc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoEliminate yang.data.spi.tree 41/98941/4
Robert Varga [Sun, 12 Dec 2021 01:03:17 +0000 (02:03 +0100)]
Eliminate yang.data.spi.tree

We have tests lurking in the wrong artifact (should be yang-data-api)
and the production code is really implementation detail of
yang-data-tree-ri.

JIRA: YANGTOOLS-1242
Change-Id: I039d10858f86ab07305d9e92841310bbcfdb2863
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit out yang-data-tree-impl 38/98938/8
Robert Varga [Fri, 10 Dec 2021 12:50:58 +0000 (13:50 +0100)]
Split out yang-data-tree-impl

InMemoryDataTree forms a rather large part of yang-data-impl and is
used only for data store implementations. Split it out into its own
component.

JIRA: YANGTOOLS-1242
Change-Id: I0747224e9d8552f03f346b59c9bf8de580e75c48
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit out yang-data-tree-{api,spi} 36/98936/4
Robert Varga [Fri, 10 Dec 2021 09:07:26 +0000 (10:07 +0100)]
Split out yang-data-tree-{api,spi}

In order to split out InMemoryDataTree, we need to first split out
its API components. This patch introduces yang-data-tree-{api,spi},
which hold the basic components defining the API and implementation
helper bits.

JIRA: YANGTOOLS-1242
Change-Id: Ida5383ed6c8820d539f72f8cd5192ccb4a93548a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove StoreTreeNodes.getChild() 37/98937/2
Robert Varga [Fri, 10 Dec 2021 12:34:43 +0000 (13:34 +0100)]
Remove StoreTreeNodes.getChild()

This method is not used anywhere, remove it.

JIRA: YANGTOOLS-1242
Change-Id: Idd5eb7b4ddea5094d87bd0a934ed78c718bc20b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImplement ModelStatement.toString() 26/98926/4
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>
2 years agoRemove SchemaNodeUtils 29/98929/1
Robert Varga [Wed, 8 Dec 2021 12:51:53 +0000 (13:51 +0100)]
Remove SchemaNodeUtils

These utility methods are not used by anyone and have been deprecated in
yangtools-7.0.0. Remove them along with their tests.

JIRA: YANGTOOLS-1380
Change-Id: I90420c0d714fa1aefc8228f2b10beefc964a9c6a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate SchemaNodeUtils for removal 28/98928/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>
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>