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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Robert Varga [Tue, 15 Feb 2022 21:36:56 +0000 (22:36 +0100)]
Verify map lookups
SpotBugs is pointing out a number of unsafe lookups which could (in
theory) lead to a NPE. In reality they cannot, as they are pre-filled.
Add verifyNotNull() guards to keep SpotBugs happy.
Change-Id: I7d342709aba03fd51d0a27c1676cba8a89fc5374
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 15 Feb 2022 21:15:23 +0000 (22:15 +0100)]
Cleanup docs dependencies
Use broken-out annotations instead of osgi.{annotation,cmpn}.
Change-Id: I5946c90eae29de072534fcc611b6c18e8be6475d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 15 Feb 2022 20:59:38 +0000 (21:59 +0100)]
Do no use osgi.cmpn
org.osgi.service.component.annotations provides a properly-broken out
annotations, use those instead of the entire compendium.
Change-Id: Idba9b56a392843bc65543b430829a25d7d629979
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 11 Feb 2022 22:16:07 +0000 (23:16 +0100)]
Add OrderedByAwareEffectiveStatement
Add OrderedByAwareEffectiveStatement and UserOrderedAware interfaces to
capture inquiries about how child data nodes are to be ordered.
JIRA: YANGTOOLS-1399
Change-Id: I52e4da6bc86593730f7927e8b5435dd9a80e4677
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 11 Feb 2022 16:01:33 +0000 (17:01 +0100)]
Push out NormalizedNodeContainer.body() specializations
We do not have the prerequisites needed to specialize body()
specification, push the FIXMEs out to the next release.
Change-Id: I47ac366215ec6ae72bb6d15039d302b93913c658
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 11 Feb 2022 15:55:24 +0000 (16:55 +0100)]
Update SystemLeafSetNode documentation
The previous refactor failed to update the documentation to reflect
the difference from UserLeafSetNode. Fix that.
Change-Id: I46f749f6a88833c8cd893a22b194fc416138fdac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Feb 2022 19:29:23 +0000 (20:29 +0100)]
Address XPath unicode range TODO
This is a port of
https://github.com/antlr/grammars-v4/commit/
3edc28b7a1f1ff4a40ef1ebb8c14bb28848d34bf
addressing a leftover omission.
Change-Id: Ic5460c1ec2dd4865fb25f858f107da89e0be284b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Feb 2022 17:13:05 +0000 (18:13 +0100)]
Remove unneeded dependency declaration
bnd-parent is pulling in all the interesting OSGi annotations, hence we
do not need to declare them.
Change-Id: I8561949f039b6fd6ec7e6e12014734c25f097624
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Feb 2022 17:07:41 +0000 (18:07 +0100)]
Do not depend on osgi.annotation
We are using split-out OSGi bundles, make sure our dependencies are
correct.
Change-Id: Iddec9156698f26919c45dabe98d27e16c9480d3c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Feb 2022 15:53:00 +0000 (16:53 +0100)]
Do not export yang.parser.rfc7950.{namespace,stmt}
These packages are not used anywhere in ODL proper, do not export them
to further isolate implementation internals.
Change-Id: Ic3a224eea07a49703fff9668ecb7b35e02b78611
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Feb 2022 15:36:01 +0000 (16:36 +0100)]
Remove yang-parser-antlr
The antlr grammar is an implementation-internal detail which we broke
out to keep spotbugs happy. It turns out we can keep it happy with a
simple suppression.
Move the grammar and eliminate its artifact, making things a bit
smoother.
JIRA: YANGTOOLS-1395
Change-Id: If6ea5b3f7940423361f115e3f807c7a3ed7b1f67
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Feb 2022 15:13:49 +0000 (16:13 +0100)]
Remove yang-xpath-antlr
The antlr grammar is an implementation-internal detail which we broke
out to keep spotbugs happy. It turns out we can keep it happy with a
simple suppression.
Move the grammar and eliminate its artifact, making things a bit
smoother.
JIRA: YANGTOOLS-1395
Change-Id: I3632549f9039a28866895ffaa7ffd7d9774c06a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Feb 2022 15:06:21 +0000 (16:06 +0100)]
Migrate yang-xpath-impl to bnd-parent
bnd-parent is a more modern replacement for bundle-parent, use that.
Change-Id: Ib20d9a709afade8a328db20400938299f3b6db5c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Feb 2022 14:57:22 +0000 (15:57 +0100)]
Migrate yang-xpath-antlr to bnd-parent
bnd-parent is a more modern replacement, migrate to use it.
Change-Id: I9c2545098f23609512cef7a4c4715d56872eb1ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Feb 2022 14:53:09 +0000 (15:53 +0100)]
Migrate yang-xpath-api to bnd-parent
Use bnd-parent instead of bundle-parent, so we end up with cleaner
integration.
Change-Id: Ic32867bf8fe9cfeca7b4fdff02d74efb1de7d6ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Feb 2022 13:38:45 +0000 (14:38 +0100)]
Migrate common/util to bnd-parent
We have a better-integrated parent, use that instead of the old felix
plugin. Also add a bit of documentation.
Change-Id: Id400abd10892fd350f3f50119f5247d09f6e5fe4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Feb 2022 13:24:14 +0000 (14:24 +0100)]
Add a uses/refine test
Improve the test model to also check refine target.
JIRA: YANGTOOLS-1393
Change-Id: Ie9a45310112ad4fea9f2ff7ffd5d7eaf088596b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Feb 2022 10:30:37 +0000 (11:30 +0100)]
Add a @return
javadoc does not like us not documenting @return, fix that.
Change-Id: I8704a50316d9c090f542a102073d5b58361d263d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 3 Feb 2022 08:41:44 +0000 (09:41 +0100)]
Do not subclass XMLUnit
We just want an assert, eliminate an Eclipse warning by using XMLAssert
directly.
Change-Id: I14443c83c473ee18c25e894c51a391c3c285a375
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Feb 2022 12:15:52 +0000 (13:15 +0100)]
Hide JsonParserStream.read()
This method seems to be mistakenly exposed, hide it from outside world.
Change-Id: I9bed2ee56774f918fd74468b831a10c156f8a87a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 8 Feb 2022 07:57:45 +0000 (08:57 +0100)]
Fix YangTextSchemaSource error report
Exception arguments are mismatched, fix that up.
Change-Id: Ic77d78c50ea8c98d8070d6d2ccd1d0cba996f7bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 1 Feb 2022 12:28:53 +0000 (13:28 +0100)]
Do not enforce augments in unsupported nodes
If our parent uses node is not supported by features, we should not be
trying to enforce the augmentation dependency, as it will not be
present.
JIRA: YANGTOOLS-1393
Change-Id: I4b9cff536f4bbd33314f8befb1d70151a5f4f5de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 6 Feb 2022 18:28:26 +0000 (19:28 +0100)]
Disable uses/augment statements of unsupported paths
Uses statements should propagate unsupported-by-features statements
as unsupported-to-build statements.
JIRA: YANGTOOLS-1393
Change-Id: Ie373b3f0cf7539219b68d1e7b52f6d348ff246e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 30 Jan 2022 00:32:54 +0000 (01:32 +0100)]
Fix javadoc build
We have merge job failing on javadocs, make sure we repair that.
Change-Id: I6c0513bde22aa02ce0685e4b40d4c28ea7d777b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 29 Jan 2022 23:15:12 +0000 (00:15 +0100)]
Bump odlparent to 9.0.13
Pick up latest fixes from upstream.
Change-Id: I5f62f890e019d5b0b14b384b61344ec61a506c8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 26 Jan 2022 10:04:39 +0000 (11:04 +0100)]
Add SoftSchemaSourceCache
GuavaSchemaSourceCache has a rather ugly design, which cannot be easily
scaled. Introduce a simpler SoftSchemaSourceCache as its replacement.
JIRA: YANGTOOLS-1391
Change-Id: I0de9092885ede3efff9d76d48ec14b85a69818b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
0cd2c12e31e8bdf3463b8282a6c6cc2e6995c140)
Robert Varga [Tue, 25 Jan 2022 15:49:50 +0000 (16:49 +0100)]
Clean up GuavaSchemaSourceCacheTest
This is a rather ancient test, clean it up with try-with-resources
block plus a few other niceties.
Change-Id: I1965446d501ab5ddb57657efbd6b2e242fdad2b6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 24 Jan 2022 16:35:30 +0000 (17:35 +0100)]
Simplify GuavaSchemaSourceCache.offer() a bit
We do not have to access the source id multiple times and can lower
cognitive load with an early return.
Change-Id: I418769fb17bb0f1b82107aa644c103d06b9c4a03
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 24 Jan 2022 16:30:54 +0000 (17:30 +0100)]
Use representation class for casting
We have an unchecked cast supressed here. Use Class.cast() to get
rid of it.
Change-Id: Ie39f9d21095a438a72dc88945e54d1846becf01d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 19 Jan 2022 12:51:22 +0000 (13:51 +0100)]
Migrate yang-common to bnd-parent
yang-common is a simple component, migrate it to bind-plugin. Also make
sure package-info.java is correctly named.
Change-Id: I5a16bab7056ea6d6124773d1ab71ddc752e0b7a9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 26 Oct 2021 15:25:17 +0000 (17:25 +0200)]
Migrate concepts to bnd-parent
A straightforward migration to use bnd-maven-plugin.
Change-Id: Ie8bb442046b611eeec072a3e4f18eb98f955ef80
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Jan 2022 11:42:49 +0000 (12:42 +0100)]
Do not instantiate JsonParser
JsonParser.parse() should not be used, but rather its equivalent static
methods should be invoked. Migrate tests to do so, fixing a few warnings
in the process.
Change-Id: I6bbfad51c584a5dc0e752bcbb1ed2ec3cdff483f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Jan 2022 10:35:08 +0000 (11:35 +0100)]
Use try-with-resources in TestUtils
Eclipse is pointing out we should be managing resources properly, fix
that.
Change-Id: I34e8040bca7c5003e4830134ccc37d0cd44d2387
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Jan 2022 10:28:17 +0000 (11:28 +0100)]
Update XXX to a FIXME
Promote a simple note to a full-blown FIXME, as it seems we should be
able to convert BigDecimal more efficiently than we do today.
Change-Id: I50b84a68c961e1bd2f8c8284e3f0f196c6717900
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Jan 2022 08:55:29 +0000 (09:55 +0100)]
Do no use Builder concept in RpcResultBuilder
The concept as such will be removed in a future release, make sure we do
not use it internally.
JIRA: YANGTOOLS-1328
Change-Id: Ic9a128a9ae62b97e9346630f53fe822050a2b5b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Jan 2022 08:52:20 +0000 (09:52 +0100)]
Disconnect QNamePredicatedBuilder from Builder
The Builder concept is going away, make sure we do not use it.
JIRA: YANGTOOLS-1328
Change-Id: Icdd771fe3694b3df07f2ab8edbf667714ae48155
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Jan 2022 08:49:11 +0000 (09:49 +0100)]
Disconnect yang-data-util from concepts.Builder
The Builder concept is going away, do not use it during XPath parsing.
JIRA: YANGTOOLS-1328
Change-Id: I4f9547d38d8786f7b9b771f264f6e941c11fb089
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Jan 2022 08:08:45 +0000 (09:08 +0100)]
Do not use concepts.Builder in parser-rfc7950
The Builder concept is going away, do not use it.
JIRA: YANGTOOLS-1328
Change-Id: If58b3912e5cc6696c306b3140e4ed213d80e2def
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Jan 2022 07:28:49 +0000 (08:28 +0100)]
Disconnect rfc7952-data-util from concepts.Builder
The Builder concept is going away, do not use it in
ImmutableNormalizedMetadata.
JIRA: YANGTOOLS-1328
Change-Id: I150c64320212bac82c2c0e19b48989818c344dd1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Jan 2022 21:22:34 +0000 (22:22 +0100)]
Bump odlparent to 9.0.11
Pick up latest upgrades from upstream.
Change-Id: I94e66ee818a39828e0df3d541a6817c2b304720d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Jan 2022 07:23:48 +0000 (08:23 +0100)]
Disconnect yang-datae-tree-ri from concepts.Builder
concepts.Builder is going away, do not rely on it for our internal
classes.
JIRA: YANGTOOLS-1328
Change-Id: Idc02cfdb4b62a8d4444263b48ab30459bcd21de1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Jan 2022 07:17:10 +0000 (08:17 +0100)]
Disconnect DeclaredStatementFormatter from Builder
concepts.Builder is going away, do not use it for
DeclaredStatementFormatter.Builder.
JIRA: YANGTOOLS-1328
Change-Id: Iaae40f9e0ce95390f67dadad881f5c137aefd403
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Jan 2022 19:32:42 +0000 (20:32 +0100)]
Disconnect DataTreeConfiguration.Builder
concepts.Builder is being removed, make sure we do not use it for
DataTreeConfiguration.
JIRA: YANGTOOLS-1328
Change-Id: Ifdfba8436fb8207e9fa56f20774d7265ebced818
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Jan 2022 15:55:29 +0000 (16:55 +0100)]
Deprecate (Checked)Builder for removal
We do not have any users in yangtools and most downstreams, deprecated
these interfaces for removal.
JIRA: YANGTOOLS-1328
Change-Id: I30cb381a398eb33c2ea8d65d9a89bb279df36ca4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Jan 2022 19:09:57 +0000 (20:09 +0100)]
Disconnect yang-model-ri from Builder
concepts.Builder is going away, remove its use from yang-model-ri.
JIRA: YANGTOOLS-1328
Change-Id: I42dabe2924bffc2d6c60ed70111b7d65735cbee0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Jan 2022 19:04:04 +0000 (20:04 +0100)]
Disconnect CrossSourceStatementReactor.Builder
concepts.Builder is going away, do not use it in
CrossSourceStatementReactor.
JIRA: YANGTOOLS-1328
Change-Id: I45b719963df1909f61446f9b3eacd41970be30d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Jan 2022 17:10:34 +0000 (18:10 +0100)]
Disconnect StatementSupportBundle.Builder from concepts
concepts.Builder is going away, disconnect it from
StatementSupportBundle.
JIRA: YANGTOOLS-1327
Change-Id: I465b1b39b43281dbf4f1ab479036c4cb04a7c2f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Jan 2022 17:05:46 +0000 (18:05 +0100)]
Disconnect YangParserConfiguration.Builder from concepts
concepts.Builder is going away, disconnect it from yang-parser-api.
JIRA: YANGTOOLS-1327
Change-Id: I96c7a07f4589927fd4cee799a4a1ec8791d97d62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Jan 2022 17:00:50 +0000 (18:00 +0100)]
Disconnect SchemaContextFactoryConfiguration.Builder
concepts.Builder is going away, make sure we do not use it for
SchemaContextFactoryConfiguration.
JIRA: YANGTOOLS-1327
Change-Id: I3f0a671362d4a3ef80c4082687507865481309b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Jan 2022 16:28:15 +0000 (17:28 +0100)]
Disconnect NormalizedNodeBuilder from Builder
concepts.Builder is going away, disconnect it from
NormalizedNodeBuilder.
Change-Id: I2e4f07a81695f23bc9833708af5905efc8acb5aa
JIRA: YANGTOOLS-1327
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Jan 2022 16:23:04 +0000 (17:23 +0100)]
Decouple YangInstanceIdentifierBuilder from Builder
concepts.Builder is going away, make sure we decouple it.
JIRA: YANGTOOLS-1327
Change-Id: I7a6e47df5f7a2900574aa8f4ff011429f21dd719
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Jan 2022 16:09:58 +0000 (17:09 +0100)]
Decouple HashCodeBuilder from Builder
We are deprecating Builder concept and HashCodeBuilder does not really
like having to inflate to java.lang.Integer. Ditch the indirection.
JIRA: YANGTOOLS-1327
Change-Id: Ia19d9d97064cb099c25f11dac6aa7c08e983effd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Jan 2022 16:05:57 +0000 (17:05 +0100)]
Remove redundant type arguments
We have Java 11, hence we can use diamond notation for anonymous
subclasses.
Change-Id: I2c30624fde5a9896f98a63d57d6d50b26e009f3f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Jan 2022 13:28:39 +0000 (14:28 +0100)]
Deprecate (Checked)Builder
These interfaces are rather overarching, causing callers of build()
method to be opaque. Deprecate them so downstreams can gradually migrate
away.
JIRA: YANGTOOLS-1327
Change-Id: I204252c9175c4eeb7b960f4d073c32eaca834316
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Jan 2022 12:43:51 +0000 (13:43 +0100)]
Remove overridden ImmmutableNodes.fromInstanceId()
These methods are geared towards NETCONF filter creation, which is being
solved in a different way -- as these do not work form leaves anyway.
Remove the methods to reduce confusion.
JIRA: YANGTOOLS-1390
Change-Id: I52ebe9be906e516ef23447f77e80c56dcf86a8d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>