yangtools.git
23 months agoRelease yangtools v8.0.6
jenkins-releng [Wed, 25 May 2022 13:18:41 +0000 (13:18 +0000)]
Release yangtools

23 months agoNormalize Decimal64 to fraction-digits 88/101288/2
Robert Varga [Mon, 23 May 2022 18:19:57 +0000 (20:19 +0200)]
Normalize Decimal64 to fraction-digits

When parsing a Decimal64, we need to scale it to fraction-digits
to ensure the input matches the expected range.

JIRA: YANGTOOLS-1437
Change-Id: I535eab4a20d30a742e94c3a6342e113cb569d0bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 415dfd816cdbefe5088ee62046f372690ab89aa7)

23 months agoAdd Decimal64.scaleTo() 87/101287/2
Robert Varga [Wed, 25 May 2022 08:27:47 +0000 (10:27 +0200)]
Add Decimal64.scaleTo()

Decimal64.valueOf(String) results in variable-scale results, based on
the input string. This is sub-optimal when we want to compare values
of particular type -- those should be governed by fraction-digits and
hence, for example "2.00" and "2.0" should be normalized to the same
scale.

Introduce Decimal64.scaleTo(), which can be used to adjust the scale
of an existing Decimal64.

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

23 months agoAdd AbstractConstraint.toString() 86/101286/1
Robert Varga [Wed, 25 May 2022 09:18:08 +0000 (11:18 +0200)]
Add AbstractConstraint.toString()

Resolved constraints do not have a nice toString() method, making
debugging harder than it needs to be. Add a toString() method which
exposes allowed ranges, which is usually what we need to know.

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

23 months agoUse diamond notation for ClassValue subclass 85/101285/1
Robert Varga [Wed, 25 May 2022 08:39:29 +0000 (10:39 +0200)]
Use diamond notation for ClassValue subclass

Our Java version can now infer the type, remove redundant specifier.

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

23 months agoUse Long.{MIN,MAX}_VALUE instead of open-coded value 84/101284/1
Robert Varga [Tue, 24 May 2022 19:18:18 +0000 (21:18 +0200)]
Use Long.{MIN,MAX}_VALUE instead of open-coded value

Java is giving us convenient constants, use them.

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

23 months agoImprove Decimal64 scale check 83/101283/1
Robert Varga [Tue, 24 May 2022 17:42:05 +0000 (19:42 +0200)]
Improve Decimal64 scale check

Add a proper message to the IllegalArgumentException reported.

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

23 months agoFix Decimal64.toString() 74/101274/1
Robert Varga [Tue, 24 May 2022 12:21:26 +0000 (14:21 +0200)]
Fix Decimal64.toString()

intPart() does not carry the sign when the leading part is zero, hence
we need to adjust for that.

JIRA: YANGTOOLS-1438
Change-Id: I5049650b0997e6543455542d48b3f2dcdd02bc4c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 59b48fd2b49f11a6381fa0e1cacb20e447a23924)

23 months agoUpdate javadoc links 53/101253/1
Robert Varga [Thu, 19 May 2022 18:28:50 +0000 (20:28 +0200)]
Update javadoc links

We have some out-dated links, update them.

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

23 months agoFix statement prerequisites and materialization 57/101157/1
Robert Varga [Tue, 17 May 2022 10:57:32 +0000 (12:57 +0200)]
Fix statement prerequisites and materialization

We are firing onStatementAdded() when copying statements, which means
that:
a) a new inference requirement may be created during inferred
   statemenent materialization
b) the inference requirement may be immediately available in effective
   model

In order to deal with this, ModifierImpl has to always go through a
bootstrap, so that it prerequisites only trigger once an action is
registered.

Furthermore InferredStatementContext needs always instantiate the map
for partial instantiations so as to deal with namespace-driven
instantiations happening while full instantiation is going on.

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

23 months agoReturn ReactorStmtCtx from ensureCompletedPhase() 90/101190/1
Robert Varga [Tue, 17 May 2022 18:44:15 +0000 (20:44 +0200)]
Return ReactorStmtCtx from ensureCompletedPhase()

We end up casting things around the verification done by
ensureCompletedPhase(). Just return the verified statement, which allows
us to tighten the signature of buffer collections.

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

23 months agoIntegrate cast into verifyStatement() 89/101189/1
Robert Varga [Tue, 17 May 2022 18:39:38 +0000 (20:39 +0200)]
Integrate cast into verifyStatement()

We end up casting the statement in most cases, integrate it into
verifyStatement().

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

23 months agoShortcut statement completion 88/101188/1
Robert Varga [Tue, 17 May 2022 18:33:49 +0000 (20:33 +0200)]
Shortcut statement completion

We know we have a ReactorStmtCtx, there is no need to verify it again.

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

23 months agoBump versions to 8.0.6-SNAPSHOT 59/101059/1
Robert Varga [Wed, 11 May 2022 09:12:38 +0000 (11:12 +0200)]
Bump versions to 8.0.6-SNAPSHOT

This starts the next development iteration.

Change-Id: I1b49631c32ff580a02f4cc9f2a6621d25159f185
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoFix nested augmentations 57/101057/1
Robert Varga [Tue, 10 May 2022 06:01:21 +0000 (08:01 +0200)]
Fix nested augmentations

When we are entering an augmentation, we need to look at the effective
instantiation. For DataNodeContainers that means using
EffectiveAugmentationSchema to get the correct filter, for choices we do
not have a utility, so just retain the same parent.

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

23 months agoReformulate YangInstanceIdentifierWriterTest 54/101054/2
Robert Varga [Tue, 10 May 2022 16:32:48 +0000 (18:32 +0200)]
Reformulate YangInstanceIdentifierWriterTest

We have SchemaNode mocking going on here, which we really do not need --
just define the corresponding models and use YANG parser to create the
underlying schema.

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

23 months agoFix pom.xml format 53/101053/1
Robert Varga [Tue, 10 May 2022 16:27:39 +0000 (18:27 +0200)]
Fix pom.xml format

We should have four spaces here.

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

23 months agoBump versions to 8.0.5-SNAPSHOT 19/101019/1
Robert Varga [Mon, 9 May 2022 19:48:03 +0000 (21:48 +0200)]
Bump versions to 8.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: Icee82c65daf3fcba48d6db2560a92958f4b9258a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoDeprecate findSemanticVersion() 15/101015/1
Robert Varga [Wed, 4 May 2022 10:07:44 +0000 (12:07 +0200)]
Deprecate findSemanticVersion()

Semantic versions are deprecated pending a fresh sstart, so we do not
need findSemanticVersion().

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

23 months agoDeprecate BasicCodeGenerator's SEMVER_LATEST mode 14/101014/1
Robert Varga [Wed, 4 May 2022 09:41:35 +0000 (11:41 +0200)]
Deprecate BasicCodeGenerator's SEMVER_LATEST mode

The entire class is deprecated, but make sure we mark SEMVER_LATEST
import resolution mode as deprecated for removal.

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

23 months agoFix OpenConfigConstants 13/101013/1
Robert Varga [Mon, 9 May 2022 08:39:19 +0000 (10:39 +0200)]
Fix OpenConfigConstants

The name of the module is not correct, it should be
openconfig-extensions.

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

23 months agoFixup yang-parser-api module a bit 75/100975/1
Robert Varga [Thu, 5 May 2022 00:01:05 +0000 (02:01 +0200)]
Fixup yang-parser-api module a bit

Do not rely on concepts being pulled in, require them explicitly.

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

23 months agoDeprecate getSemanticVersion() for removal 70/100970/1
Robert Varga [Tue, 3 May 2022 21:51:59 +0000 (23:51 +0200)]
Deprecate getSemanticVersion() for removal

NETMOD WG has a versioning proposal which will supersede OpenConfig,
deprecate API elements which are tied to OpenConfig versioning.

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

23 months agoFix if-feature propagation for implicit case statements 53/100953/1
Peter Suna [Tue, 3 May 2022 12:33:42 +0000 (14:33 +0200)]
Fix if-feature propagation for implicit case statements

Implicit statements created during parse must not be propagated
if their child statement is not supported by features or otherwise
unavailable.

This really can only happen when we are creating an implicit declaration
on the parser side, as in other code paths the substatement is already
completely defined.

JIRA: YANGTOOLS-1431
Change-Id: I5797f09c795587c91f10c7f92a6a8c9fd2480213
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit bc84355a85cafb4d8257a0e397c1efb2409aaf2e)

23 months agoFix failure source not being reported 50/100950/1
Robert Varga [Tue, 3 May 2022 17:27:59 +0000 (19:27 +0200)]
Fix failure source not being reported

When the parser fails with a well-known exception, extract the
SourceIdentifier of the failed YANG source.

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

23 months agoPrint out available augmentations 08/100608/1
Robert Varga [Tue, 3 May 2022 14:43:32 +0000 (16:43 +0200)]
Print out available augmentations

We seem to be facing a weird failure to look up augmentations, make
sure we report what is available.

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

23 months agoBump odlparent to 10.0.2 19/100919/1
Robert Varga [Mon, 2 May 2022 15:17:31 +0000 (17:17 +0200)]
Bump odlparent to 10.0.2

Pick up fixed-up jre.properties.

Change-Id: I870e88a432001f156f8b2c9a40fc44aabcadc011
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoBump odlparent to 10.0.1 02/100502/5
Robert Varga [Sat, 9 Apr 2022 19:17:56 +0000 (21:17 +0200)]
Bump odlparent to 10.0.1

Pick up latest upgrades from upstream. This requires fixing up JPMS
module references, as metainf-services added (finally) an
Automatic-Module-Name declaration.

Change-Id: I914ec18ad583e347b7a2707cefbca37d9307741c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix the short option for 'no-warning-for-unkeyed-lists' 95/100595/1
Sangwook Ha [Fri, 22 Apr 2022 16:13:03 +0000 (09:13 -0700)]
Fix the short option for 'no-warning-for-unkeyed-lists'

Dash "-" is not allowed in the short option string. Replace it
with 'K', a single character option consistent with others.

Having two options to control warnings on the unkeyed list,
although mutually exclusive, makes the default behavior unclear
when neither option is used.

Simplify the options by removing 'warning-for-unkeyed-lists'
while preserving the original default behavior of warning against
unkeyed lists when neither option is used.

JIRA: YANGTOOLS-1429
Change-Id: I6c37892ae7e39864420a0e6c15dd2fc1cf0ba952
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
(cherry picked from commit db8732c024c02cadb7814149fe23fab85533944b)

2 years agoRemove odl-yangtools-exp-data-xpath-(api) 89/100589/1
Robert Varga [Thu, 14 Apr 2022 07:24:04 +0000 (09:24 +0200)]
Remove odl-yangtools-exp-data-xpath-(api)

These features are no longer built, remove references to them.

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

2 years agoBump versions to 8.0.4-SNAPSHOT 71/100571/1
Robert Varga [Thu, 14 Apr 2022 06:23:03 +0000 (08:23 +0200)]
Bump versions to 8.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: I171cbb7a6d0acdc49d8cfbeaa1ce9b5e90e019ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd a knob to control warnings about unkeyed lists 03/100003/9
Samuel Schneider [Tue, 8 Mar 2022 12:56:24 +0000 (13:56 +0100)]
Add a knob to control warnings about unkeyed lists

Warnings about unkeyed lists with config true are now can now be
enabled (default) or disabled as needed. Also upgrades commons-cli
version to 1.5.0:

https://commons.apache.org/proper/commons-cli/changes-report.html#a1.5.0

JIRA: YANGTOOLS-1397
Change-Id: I8d576b18098421f16a83eb3c31d8c3a80966c4cb
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump argparse4j to 0.9.0 21/100521/2
Robert Varga [Sun, 10 Apr 2022 18:26:20 +0000 (20:26 +0200)]
Bump argparse4j to 0.9.0

https://github.com/argparse4j/argparse4j/releases/tag/argparse4j-0.7.0
https://github.com/argparse4j/argparse4j/releases/tag/argparse4j-0.8.0
https://github.com/argparse4j/argparse4j/releases/tag/argparse4j-0.8.1
https://github.com/argparse4j/argparse4j/releases/tag/argparse4j-0.9.0

Change-Id: I8effcb21fb5cdfaeb63a6c3a20deabaa2ecb54d1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd DefaultSchemaTreeInference.unsafeOf() 14/100414/14
Samuel Schneider [Tue, 5 Apr 2022 11:23:48 +0000 (13:23 +0200)]
Add DefaultSchemaTreeInference.unsafeOf()

SchemaInferenceStack is routinely converted to DefaultSchemaTreeInference
as well as reconstructed from it. This process currently involves
a complete schema tree walk in both directions.

Introduce DefaultSchemaTreeInference.unsafeOf() which nominally trusts
the provided argument, so that we use it as is. The method can be
instructed to verify the provided argument by setting a system property.

On the SchemaInferenceStack side, trust the documented well-formedness
of DefaultSchemaTreeInference.

JIRA: YANGTOOLS-1414
Change-Id: Ifa2f0418c561795595d8dae70f6b0c61a33d8f43
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate DataNodeAggregator for removal 18/100518/1
Robert Varga [Sun, 10 Apr 2022 15:33:52 +0000 (17:33 +0200)]
Deprecate DataNodeAggregator for removal

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

Change-Id: I451dfae18b5511437f960c747a73720698ae29c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not use Byte for test values 10/100510/1
Robert Varga [Sat, 9 Apr 2022 22:21:00 +0000 (00:21 +0200)]
Do not use Byte for test values

We have a number of JDK warnings, make sure we use a dedicated class
for testing.

Change-Id: Ie5e4e68bb8e59c309be729ef0c627e6ac1e408d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove unneeded public keyword 01/100501/1
Robert Varga [Sat, 9 Apr 2022 20:00:22 +0000 (22:00 +0200)]
Remove unneeded public keyword

Upgraded checkstyle is detecting this omission.

Change-Id: Id531602d14557c85c0a57163a4632fa2f7028e97
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFurther cleanup of tests 98/100398/1
Robert Varga [Tue, 5 Apr 2022 01:36:34 +0000 (03:36 +0200)]
Further cleanup of tests

Convert more tests to use AbstractYangTest's assertions.

Change-Id: Ib6efc701ba59d3c5323b8e69cfb51a2d22700e53
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFurther testing cleanup 97/100397/1
Robert Varga [Mon, 4 Apr 2022 23:24:32 +0000 (01:24 +0200)]
Further testing cleanup

Remove more StmtTestUtils duplication.

Change-Id: Icd8798d8f89c6fdd3a526347e0b2a182189c1110
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSimplify createFeaturesSet() 96/100396/1
Robert Varga [Mon, 4 Apr 2022 22:55:39 +0000 (00:55 +0200)]
Simplify createFeaturesSet()

We can express this method in terms of a Stream transformation, saving
us an intermediate HashSet.

Change-Id: I26649e4d9d43bf288053dc76c1324db1d7cf9e1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove unused parseYangSources() methods 95/100395/1
Robert Varga [Mon, 4 Apr 2022 22:52:08 +0000 (00:52 +0200)]
Remove unused parseYangSources() methods

There are no callers of these methods, remove them.

Change-Id: I8642954e15ee7ff1fe27a5df88839ac8dba239fa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove StmtTestUtils.findModules() 94/100394/1
Robert Varga [Mon, 4 Apr 2022 22:48:24 +0000 (00:48 +0200)]
Remove StmtTestUtils.findModules()

SchemaContext provide findModules(String), which serves the same
purpose, remove the utility method.

Change-Id: I5f2b7cae56f8d1af404117580d1ecced160e0f7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUpdate unicode blocks for Java 11 89/100389/3
Robert Varga [Mon, 4 Apr 2022 21:31:29 +0000 (23:31 +0200)]
Update unicode blocks for Java 11

Java 11 supports Unicode 11, bringing in a number of blocks we have
previously not covered.

JIRA: YANGTOOLS-1419
Change-Id: I15aa6aac9d905840f6387691301fe6ab651c694d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdjust message parsing to account for JDK-8230338 88/100388/2
Robert Varga [Mon, 4 Apr 2022 20:48:14 +0000 (22:48 +0200)]
Adjust message parsing to account for JDK-8230338

JDK14 changed the error reporting string, which makes our algorithm
fail. Make sure we account for it.

JIRA: YANGTOOLS-1418
Change-Id: Iea9866c6f98508851f0d558d7e2422740e91ef87
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSimplify Bug4079Test 87/100387/1
Robert Varga [Mon, 4 Apr 2022 20:03:35 +0000 (22:03 +0200)]
Simplify Bug4079Test

We have a metric ton of duplication here, add a internal utility assert
and clean up the test.

Change-Id: Idedd591b97bafbc172b23ee566b44633a69b0cae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCheck null returns from NamespaceContext 69/100369/1
Robert Varga [Sun, 3 Apr 2022 20:21:49 +0000 (22:21 +0200)]
Check null returns from NamespaceContext

If we have a prefix that is not bould in the NamespaceContext, its
getNamespaceURI() will return null. checkArgument() such return to
provide better diagnostic than the implied NPE from XMLNamespace.

Change-Id: Ia49a9dbdf5dd4a3b8608f1e63dd0390130312897
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix assertion import 64/100364/1
Robert Varga [Sat, 2 Apr 2022 12:13:54 +0000 (14:13 +0200)]
Fix assertion import

Let's not use jupieter.api just yet here.

Change-Id: I4645f4c476f9d2cc544a39b0b1ad5ce6c93873fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix immutable NormalizedNode equality 58/100358/3
Robert Varga [Fri, 1 Apr 2022 21:37:22 +0000 (23:37 +0200)]
Fix immutable NormalizedNode equality

Equality has always been iffy in our immutable implementations, but we
are now making a decent attempt to implement it. There are three gaps in
that effort, where we only consider known subclasses for comparison of
value part of NormalizedNode.

Address this by providing fallback child comparison and add an explicit
test suite.

JIRA: YANGTOOLS-1417
Change-Id: I36e5bcfc6da06c789595b00b7ad86d973cb34703
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not use Optional for augmentation traversal 10/100310/1
Robert Varga [Thu, 31 Mar 2022 20:46:32 +0000 (22:46 +0200)]
Do not use Optional for augmentation traversal

We can skip allocation of an Optional by using nullable return with a
check.

Change-Id: I78cf3316d8d026b32ecb94ece77ae637444d5bb0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove UnionXmlCodec error reporting 87/100287/1
Robert Varga [Tue, 29 Mar 2022 21:54:19 +0000 (23:54 +0200)]
Improve UnionXmlCodec error reporting

Collect the exceptions reported and add them as suppressed in case
we end up rejecting all values.

Change-Id: I6aa6d99d4a60426963dc30a1a5595b8ecd7a3bab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove StmtTestUtils.parseYangSource(String) 60/100260/2
Ivan Hrasko [Fri, 25 Mar 2022 15:36:52 +0000 (16:36 +0100)]
Remove StmtTestUtils.parseYangSource(String)

This deprecated method is no more used.

JIRA: YANGTOOLS-1345
Change-Id: I17f8442073c432e68a6dde2129ae842cce226ee5
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 years agoMigrate yang-common to JUnit5 67/100267/1
Robert Varga [Fri, 25 Mar 2022 18:27:18 +0000 (19:27 +0100)]
Migrate yang-common to JUnit5

This is a rather simple conversion with a slight improvement in
assertions.

Change-Id: I1a17cc0f1f2ffed0e1fb0bbc430f17000546e05d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoReplace calls of StmtTestUtils.parseYangSource(String) two 17/100217/9
Samuel Schneider [Tue, 22 Mar 2022 15:04:56 +0000 (16:04 +0100)]
Replace calls of StmtTestUtils.parseYangSource(String) two

Removes code duplicity in parser unit tests.
Part two of https://git.opendaylight.org/gerrit/c/yangtools/+/100136

JIRA: YANGTOOLS-1345
Change-Id: I31ec3700d425cb1e0732c9225a629d01b6d84b5c
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
2 years agoBump versions to 8.0.3-SNAPSHOT 40/100240/1
Robert Varga [Thu, 24 Mar 2022 12:45:47 +0000 (13:45 +0100)]
Bump versions to 8.0.3-SNAPSHOT

This starts the next development iteration.

Change-Id: I0cfca343a279304221713f855049e4e411e4157f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDeprecate CheckedValue.orElseThrow(Supplier) 33/100233/1
Robert Varga [Thu, 24 Mar 2022 11:26:28 +0000 (12:26 +0100)]
Deprecate CheckedValue.orElseThrow(Supplier)

While this method provides seamless transition from/to Optional, its use
results in the original exception being lost. Deprecate it for removal.

Change-Id: I062ee28917f7a1be583077009307f08c57a67acc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd convenience methods for XML codec 30/100230/5
Robert Varga [Thu, 24 Mar 2022 00:07:31 +0000 (01:07 +0100)]
Add convenience methods for XML codec

Codecs are at yang.data.api layer, add methods to initialize them with
YangInstanceIdentifier.

JIRA: YANGTOOLS-1412
Change-Id: Id9ce9af904fba55a0781a0c5e53ed253484664ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd DataSchemaContextNode/SchemaInferenceStack integration 26/100226/7
Robert Varga [Wed, 23 Mar 2022 13:29:23 +0000 (14:29 +0100)]
Add DataSchemaContextNode/SchemaInferenceStack integration

The removal of SchemaNode.getPath() opens a functionality gap, where it
becomes impossible to initialize a SchemaInferenceStack via use of
DataSchemaContextTree. Add enterChild/enterPath methods which maintain
or return a SchemaInferenceStack, so that cognizant callers can use them
to talk to other schema-informed APIs.

JIRA: YANGTOOLS-1412
Change-Id: Ia3562909e322992a3ee84fd0b3f2f0cc7ce5183d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoReplace calls of StmtTestUtils.parseYangSource(String) 36/100136/5
Samuel Schneider [Wed, 16 Mar 2022 14:58:14 +0000 (15:58 +0100)]
Replace calls of StmtTestUtils.parseYangSource(String)

Removes code duplicity in parser unit tests.

JIRA: YANGTOOLS-1345
Change-Id: I0d20bf4d023a07e87d3d8228e29aa26a6bdb2348
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
2 years agoFix ChoiceNodeContextNode's byQName indexing 27/100227/2
Robert Varga [Wed, 23 Mar 2022 17:31:39 +0000 (18:31 +0100)]
Fix ChoiceNodeContextNode's byQName indexing

When we are traversing by provided QName, we are meant to encounter
each ContextNode significant to PathArgument construction. This works
for all cases except for 'choice->case->choice', where
ChoiceNodeContextNode's internal indexing does not account for itself:
it ends up storing the second ChoiceNodeContextNode under the
ChoiceSchemaNode's QName -- and therefore it fails to find it by its
consituents' QNames.

This has impact primarily on instance-identifier parsers, as evidenced
by the corresponding JSON-based unit test.

Fix this by properly overriding getQNameIdentifiers() to provide the
internal table's keySet().

JIRA: YANGTOOLS-1411
Change-Id: I11df2d4072157e06342c2899dbcf02f74eef8090
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRecognize 'choice' in 'choice' with YANG 1.1 24/100224/3
Robert Varga [Wed, 23 Mar 2022 13:23:10 +0000 (14:23 +0100)]
Recognize 'choice' in 'choice' with YANG 1.1

RFC7950 allows for 'choice' to appear directly in another 'choice'.
Make sure we allow for that possibility. This also requires
disconnecting shorthands from global state -- they are version-specific
after all.

JIRA: YANGTOOLS-1410
Change-Id: Id86cc8226d4e02d754317f840b9eadfe03949a9c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove DataSchemaContextTreeTest 25/100225/2
Robert Varga [Wed, 23 Mar 2022 13:31:42 +0000 (14:31 +0100)]
Move DataSchemaContextTreeTest

The test is in the wrong package, make sure it is in yang.data.util.

Change-Id: If5e4c3b963d790dde6a9aa38d012331a1e604f91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoClean up DataSchemaContainerTree 10/100210/4
Robert Varga [Mon, 21 Mar 2022 17:52:03 +0000 (18:52 +0100)]
Clean up DataSchemaContainerTree

Clean up the class hierarchy and mark things for future improvement,
deprecating unintentionally-public methods and providing guidance.

Change-Id: I9d4a2005714c964880198b9e0bde5e1401c4cb41
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMigrate concepts to Jupiter API 20/100220/1
Robert Varga [Wed, 23 Mar 2022 05:29:03 +0000 (06:29 +0100)]
Migrate concepts to Jupiter API

These are simple tests, use JUnit5 for them.

Change-Id: Idec56d9cd729834804ba5188fb6a6cdbfcff8552
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove unneeded throws 55/100155/1
Robert Varga [Sat, 19 Mar 2022 15:02:49 +0000 (16:02 +0100)]
Remove unneeded throws

AssertionErrors are unchecked, do not declare them to keep noise down.

Change-Id: I390a48f56ebb30f5bdb5f0d3cbf4cf187bdd204f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix SchemaTreeNamespace population via augment 37/100137/3
Sangwook Ha [Wed, 16 Mar 2022 16:39:14 +0000 (09:39 -0700)]
Fix SchemaTreeNamespace population via augment

This change adds 4 test cases to reproduce:
  - Deviation of a case node with case statement
  - Deviation of a case node without case statement
  - Deviation of an augmented case node with case statement
  - Deviation of an augmented case node without case statement

The only test case fails is the last one (deviation of an augmented
case node without case statement). There is another way to depreduce
the root cause, which is to use 'augment' instead of deviate.

The problem is that the implicit case statement does not trigger
onStatementAdded() and hence it does not get registered in the
namespace.

Fixing this issue changes behaviour in testDuplicityInAugmentTarget2(),
i.e. the schema tree overlap previously reported through
SchemaTreeIndexingException (when we are already building effective
view) gets flagged earlier with a SourceException, pointing to both the
place where the conflict occurs and which source statement is causing
it.

JIRA: YANGTOOLS-1408
Change-Id: I7c26399b07aaa142b5ab8191dab97e738118a14a
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix inferred statements over undeclared statements 19/100119/3
Robert Varga [Mon, 14 Mar 2022 12:29:08 +0000 (13:29 +0100)]
Fix inferred statements over undeclared statements

We must not assume we can access declared() statement. In order to do
that, we need to change how createInferredEffective() operates and push
it down to ReactorStmtCtx.

JIRA: YANGTOOLS-1407
Change-Id: I56823cb2ad497adcccaffa3e3386e45b0bb08089
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 8.0.2-SNAPSHOT 10/100110/1
Robert Varga [Sun, 13 Mar 2022 21:48:27 +0000 (22:48 +0100)]
Bump versions to 8.0.2-SNAPSHOT

This starts the next development iteration.

Change-Id: I7e579d904ad556c4ab3daac96756a94a6760f1a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix BaseDecimalType scales 09/100109/1
Robert Varga [Sun, 13 Mar 2022 21:38:55 +0000 (22:38 +0100)]
Fix BaseDecimalType scales

We fail to generate range contraint for fraction-digits=18, fix that.

JIRA: YANGTOOLS-1406
Change-Id: Ieafd48ba6b63c160f01b163e7b6786f4a5833fb5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 8.0.1-SNAPSHOT 05/100105/1
Robert Varga [Sun, 13 Mar 2022 15:17:50 +0000 (16:17 +0100)]
Bump versions to 8.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: I78aabd3376243f9fc7f70ed2d90502c2e8559c46
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoConvert BigDecimal/Decimal64 in yang-data-codec-binfmt 04/100104/1
Robert Varga [Sun, 13 Mar 2022 15:06:43 +0000 (16:06 +0100)]
Convert BigDecimal/Decimal64 in yang-data-codec-binfmt

Our internal representation is Decimal64, make sure we adjust it as
we are reading data in and handle it on writeout.

JIRA: YANGTOOLS-556
Change-Id: Ie83b26467ac987a21c6b2dbd6726559db4e6169d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRequire scale for integral conversions and RoundingMode for float 02/100102/4
Robert Varga [Sun, 13 Mar 2022 13:04:24 +0000 (14:04 +0100)]
Require scale for integral conversions and RoundingMode for float

Integral conversions need to check range and take the intended scale,
otherwise we are left guessing as to what we need to do.

Similarly, float/double need to take RoudingMode, so that they can
figure out what to do with excess precision.

JIRA: YANGTOOLS-1405
Change-Id: I2a6eef9c987dcceec8de7e2aa5bbf43062301cf9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse Decimal64.{min,max}ValueIn() in BaseDecimalType 03/100103/1
Robert Varga [Sun, 13 Mar 2022 14:32:51 +0000 (15:32 +0100)]
Use Decimal64.{min,max}ValueIn() in BaseDecimalType

Now that we have centralized range numbers, let's use them in
in yang-model-ri.

JIRA: YANGTOOLS-1405
Change-Id: Id8367366d6b11a10894ff88e3614024ce62b7050
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd Decimal64.{min,max}ValueIn(scale) 01/100101/1
Robert Varga [Sun, 13 Mar 2022 12:19:17 +0000 (13:19 +0100)]
Add Decimal64.{min,max}ValueIn(scale)

There are few places where we are interested in limits supported by
Decimal64, make sure to expose them.

JIRA: YANGTOOLS-1405
Change-Id: I7629e6996d6743628188141f9587c20e565736ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoExpose scale and unscaled value from Decimal64 00/100100/2
Robert Varga [Sat, 12 Mar 2022 10:41:11 +0000 (11:41 +0100)]
Expose scale and unscaled value from Decimal64

Exposing these two details, along with a factory method allows users
to transport this class using these components.

JIRA: YANGTOOLS-1405
Change-Id: I9685f25171434ddd787ea605579f4e5f852bca45
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd YangInstanceIdentifierWriter 50/99550/14
Robert Varga [Tue, 1 Feb 2022 17:14:32 +0000 (18:14 +0100)]
Add YangInstanceIdentifierWriter

Add a utility that allows us to emit a number of enter events
into a NormalizedNodeStreamWriter, so we dont have to create
the whole normalized node structure prior to writing into the
stream.

This allows us to ditch InstanceIdTo*Nodes classes, as the creation
of NormalizedNode structure can easily be performed through streaming
events.

JIRA: YANGTOOLS-1392
Change-Id: Iea17a27559573d523cc17683e56b41faafa54f31
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd FormattingNormalizedNodeStreamWriter 53/100053/2
Robert Varga [Wed, 9 Mar 2022 19:58:07 +0000 (20:58 +0100)]
Add FormattingNormalizedNodeStreamWriter

We will need some sort of quick validation for
YangInstanceIdentifierWriter and Strings seem to be convenient. Expose a
FormattingNormalizedNodeStreamWriter for other users as well.

Change-Id: I2383b4e206f593f0b6568e31fa0c6b829b7dd3f1
JIRA: YANGTOOLS-1392
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFixup OpenConfigRegexpPosixStatement definition 18/100018/2
Robert Varga [Wed, 9 Mar 2022 09:30:44 +0000 (10:30 +0100)]
Fixup OpenConfigRegexpPosixStatement definition

We should be using Empty instead of Void.

Change-Id: I1dcd442ca20053e2fa3e3214cc240e5b68d28dbc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoExpose SchemaValidationFailedException 10/100010/1
Robert Varga [Wed, 9 Mar 2022 06:28:25 +0000 (07:28 +0100)]
Expose SchemaValidationFailedException

This exception is used by downstreams, make sure they gen access to it.

Change-Id: Idc62321e197483469b7dfe0bcc0618f962297b98
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoExport org.opendaylight.yangtools.yang.data.tree.impl.di 06/100006/1
Robert Varga [Tue, 8 Mar 2022 18:45:01 +0000 (19:45 +0100)]
Export org.opendaylight.yangtools.yang.data.tree.impl.di

Downstreams are not ready for us shutting down access to this package
in OSGi world. Make sure it is exported.

Change-Id: Iadce73e45f622a7bb496ba29643f4f84baff9150
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove AugmentationSchemaNode.getOriginalDefinition() 96/97896/6
Robert Varga [Fri, 15 Oct 2021 08:13:16 +0000 (10:13 +0200)]
Remove AugmentationSchemaNode.getOriginalDefinition()

There is only one user of this method and it is able to cope with
it being gone. Remove it along with parser methods it needs to work.

JIRA: YANGTOOLS-1379
Change-Id: I3d0ef9378975b140ff5c9dc61eab3fa77a4dfdcd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 10.0.0 67/99767/14
Robert Varga [Tue, 15 Feb 2022 20:54:54 +0000 (21:54 +0100)]
Bump odlparent to 10.0.0

Adopt odlparent-10, addressing a few issues flushed out.

Change-Id: I1b9f2500548ab6193e660cbef04ccaf9a0649679
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRename {Data,Schema}TreeAwareEffectiveStatement.Namespace 34/99934/2
Robert Varga [Wed, 2 Mar 2022 13:43:48 +0000 (14:43 +0100)]
Rename {Data,Schema}TreeAwareEffectiveStatement.Namespace

These two namespaces are related and are often used together, yet their
naming gets into way. Rename them to {Data,Schema}TreeNamespace and
adjust users.

Change-Id: I1978bb31cb19856ba10006f0c891f8c16c694292
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove EffectiveAugmentationSchema.create() 32/99932/2
Robert Varga [Wed, 2 Mar 2022 11:30:57 +0000 (12:30 +0100)]
Remove EffectiveAugmentationSchema.create()

This is a simple class, there is no need to have a static method, just
a constructor suffices.

Change-Id: I0eeff5c1f5dbcefe6f0b356323762cb2a3152b9f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoTolerate children not being present 30/99930/4
Robert Varga [Wed, 2 Mar 2022 08:15:03 +0000 (09:15 +0100)]
Tolerate children not being present

Augment's children are subject to deviations at augment target, hence
we need to check for their presence. Also add some sorely-missing
documentation as to what this class actually does.

JIRA: YANGTOOLS-1404
Change-Id: I98cce6b2a8bff74658a16553f93eb8049dd038b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMark StmtContextUtils.isInExtensionBody() FIXME 29/99929/1
Robert Varga [Wed, 2 Mar 2022 00:00:19 +0000 (01:00 +0100)]
Mark StmtContextUtils.isInExtensionBody() FIXME

This methods dates back as far as April 2015, and probably does things
we do not really want to do. Drop a FIXME for a follow-up.

Change-Id: I3372171606ecb26b742de3fa772ece65df4b693b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix {Data,Schema}TreeAwareEffectiveStatement.Namespace 26/99926/4
Robert Varga [Tue, 1 Mar 2022 22:44:24 +0000 (23:44 +0100)]
Fix {Data,Schema}TreeAwareEffectiveStatement.Namespace

These two namespaces should not be generic, but rather specialized
to the corresponding wildcard statement. This fixes a number of
usability issues where type inference would not work correctly.

Change-Id: I0b4a2461df58265ae2db795c0c81e2b4e5972e41
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix AugmentEffectiveStatement javadoc 24/99924/1
Robert Varga [Tue, 1 Mar 2022 20:42:12 +0000 (21:42 +0100)]
Fix AugmentEffectiveStatement javadoc

We have leading + signs here, remove them.

Change-Id: Iff1c28e7b6fce061bbe10b1c50fedd21c3cfb71d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoTolerate null return from execution 18/99918/1
Robert Varga [Tue, 1 Mar 2022 12:06:05 +0000 (13:06 +0100)]
Tolerate null return from execution

We have inconsistent handling of null, fix that up.

Change-Id: I3357162f85fb41dc2ea94bd1819f6731d53b8c77
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix eclipse warnings 16/99916/1
Robert Varga [Tue, 1 Mar 2022 10:30:29 +0000 (11:30 +0100)]
Fix eclipse warnings

We have a warning about nullability mismatch, fix that through local
variable type inference.

Change-Id: Id0512b52b42ae04e2ffa311fb6ca3e0406c9776c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove unneeded constant 86/99886/1
Robert Varga [Mon, 28 Feb 2022 21:59:22 +0000 (22:59 +0100)]
Remove unneeded constant

We do not need the Splitter anymore, remove it.

Change-Id: I6715a730540457d244b5859a3ddafd0f527c640e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix javadoc warnings in ImmutableOffsetMap 71/99871/2
Robert Varga [Fri, 25 Feb 2022 07:22:54 +0000 (08:22 +0100)]
Fix javadoc warnings in ImmutableOffsetMap

We have undocumented K/V parameters, fix that.

Change-Id: I2dee30f7ed0cf0ad9d8124f6bd3029a15bc52156
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix javadoc warnings in ExecutorServiceUtil 70/99870/2
Robert Varga [Fri, 25 Feb 2022 07:21:12 +0000 (08:21 +0100)]
Fix javadoc warnings in ExecutorServiceUtil

A few undocumented parameters, fix that.

Change-Id: I35d48729869196eaed472eaf3d16e759ad3fbfdc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix javadoc warnings in DurationStatisticsTracker 69/99869/2
Robert Varga [Fri, 25 Feb 2022 07:18:48 +0000 (08:18 +0100)]
Fix javadoc warnings in DurationStatisticsTracker

There are a number of missing @return directives, add them.

Change-Id: I6965b4ec9e8ca01cc9192fa067cce0edcc84cd2e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix spotbugs issues in yang-parser-spi 00/88500/11
Robert Varga [Thu, 17 Feb 2022 11:16:36 +0000 (12:16 +0100)]
Fix spotbugs issues in yang-parser-spi

SpotBugs is correctly pointing out that we could in theory end
up with a null dereference here. Make sure we verifyNotNull() it
and produce a correct message.

Change-Id: Ib4097986c3e329046be273a4992a7b7112951c5c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix InstanceIdentifier.getAncestor() implementations 94/88494/9
Robert Varga [Wed, 18 Mar 2020 14:10:37 +0000 (15:10 +0100)]
Fix InstanceIdentifier.getAncestor() implementations

SpotBugs is touchy about nulls here, all of which are guaranteed
to work out due to verification logic -- but that is not quite
obvious. Fix this up by adding explicit verifies -- which do not
hurn that much.

Change-Id: I92a120c9f8d4fced2bf3e8a859772cf6d41798df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAugmentEffectiveStatement should be SchemaTreeAware 80/99780/3
Robert Varga [Wed, 16 Feb 2022 22:27:07 +0000 (23:27 +0100)]
AugmentEffectiveStatement should be SchemaTreeAware

Design of downstream users' classes is somewhat hampered by
AugmentEffectiveStatement not exposing the fact it roots schema tree
addressable components. Fix that and eliminate AbstractDataNodeContainer
as it is no longer needed.

JIRA: YANGTOOLS-1400
Change-Id: I8c34d64e61efbf18780975718d017d12284763d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSimplify Abstract{Declared,Undeclareds}EffectiveStatement 79/99779/2
Robert Varga [Wed, 16 Feb 2022 22:10:13 +0000 (23:10 +0100)]
Simplify Abstract{Declared,Undeclareds}EffectiveStatement

We have a superfluous argument of the EffectiveStatement representation.
Remove it to simplify user verbosity.

Change-Id: I203431817313b8325a3599b29cffb85af7a11c4b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove YangNames annotations a bit 73/99773/2
Robert Varga [Wed, 16 Feb 2022 08:42:06 +0000 (09:42 +0100)]
Improve YangNames annotations a bit

We guarantee a @NonNull return and have a well-defined behaviour
on null arguments.

Change-Id: I42532863520529c07b026176acf05c8000626f48
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAlign odlparent version 69/99769/1
Robert Varga [Tue, 15 Feb 2022 22:13:47 +0000 (23:13 +0100)]
Align odlparent version

bnd-parent is a new addition and we missed a version bump here. Fix
that.

Change-Id: Icdf022e2bae88d694962cff76b0fdbcb6f741b53
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoVerify exclusion consistency 68/99768/1
Robert Varga [Tue, 15 Feb 2022 21:57:15 +0000 (22:57 +0100)]
Verify exclusion consistency

SpotBugs warns on null here, make sure to add verifyNotNull(). Also
used import static for Verify and Preconditions methods.

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