yangtools.git
4 months agoUse switch expressions in PathExpressionParser 37/109637/1
Robert Varga [Thu, 4 Jan 2024 19:56:38 +0000 (20:56 +0100)]
Use switch expressions in PathExpressionParser

We have two cases of trivially switch() statements, convert them to
switch expressions.

Change-Id: If5212d5e53dc12677e4973288d7ecd80c4192f3e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRefactor ExplicitStatement 36/109636/7
Robert Varga [Thu, 4 Jan 2024 16:00:06 +0000 (17:00 +0100)]
Refactor ExplicitStatement

Rather than having a superclass, just create StatementDeclarations as a
host for the two factory methods. Implementations are completely
internal and do not leak outside of this class.

We also optimize memory footprint by using two versions of each class --
one storing file/line as ints, the other one as shorts. This ends up
saving a few bytes of memory.

Eliminate the InFile specialization, as it is not used anywhere really.
Also renale atPosition() to inText() to more closely align naming.

JIRA: YANGTOOLS-1150
Change-Id: Ib5a20e45f645f00fac8d1d27c48dd4dcab16fb17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoAdd StatementDeclaration 32/109632/8
Robert Varga [Thu, 4 Jan 2024 15:41:46 +0000 (16:41 +0100)]
Add StatementDeclaration

We have only StatementInText capturing
StatementSourceReference+DeclarationReference. Add an explicit class to
hold this combination at model.api.meta level.

Also pull in the implementation of toHumanReadable() and add the
appropriate hooks.

JIRA: YANGTOOLS-1150
Change-Id: Ia6685a1a8d0d48ad12d223eefada2a2c527cb944
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove an explicit cast 31/109631/3
Robert Varga [Thu, 4 Jan 2024 11:51:41 +0000 (12:51 +0100)]
Remove an explicit cast

Use an instanceof pattern instead.

Change-Id: I4a8dcf3ba43fbf07cf6e79b805ebf59c327914a7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoMove message formatting to StatementSourceException 28/109628/2
Robert Varga [Thu, 4 Jan 2024 09:53:18 +0000 (10:53 +0100)]
Move message formatting to StatementSourceException

It would be nice to have consistent formatting relevant things -- and
SourceException already does something nice for typing message and
source together.

JIRA: YANGTOOLS-1150
Change-Id: Ib4b941fe4035edf887d9644a6b68570747b9d937
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoPrefixResolver operates on non-null 25/109625/1
Robert Varga [Thu, 4 Jan 2024 09:17:17 +0000 (10:17 +0100)]
PrefixResolver operates on non-null

The prefix cannot legally be null, annotate that.

Change-Id: Iae55e8a450a3dd70eef11932f4f9f84f73a3b85d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoAdd SourceDependency.isSatisfiedBy() 24/109624/3
Robert Varga [Thu, 4 Jan 2024 03:57:07 +0000 (04:57 +0100)]
Add SourceDependency.isSatisfiedBy()

Checking SourceDependency satisfaction can easily be centralized.

JIRA: YANGTOOLS-1150
Change-Id: I783380421cbf387bbdf25e89881b62cb4fcb4db0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoAssert serialized Revision size 22/109622/1
Robert Varga [Thu, 4 Jan 2024 05:05:38 +0000 (06:05 +0100)]
Assert serialized Revision size

We have a serialization test, add an assertion on how big a string is.

Change-Id: Ia7b205d8e965cb8d86813cd1c662621748ea86c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoImprove serialization defensiveness of Revision 21/109621/1
Robert Varga [Thu, 4 Jan 2024 03:59:52 +0000 (04:59 +0100)]
Improve serialization defensiveness of Revision

Revision should never get serialized, hence it cannot be read in.

Change-Id: Icdc377ddf617e45973522d6ec237ece2b9c01ce9

4 months agoAdd @java.io.Serial 20/109620/1
Robert Varga [Thu, 4 Jan 2024 03:58:26 +0000 (04:58 +0100)]
Add @java.io.Serial

Annotate serialization field.

Change-Id: I24d9a8f19de3c39d49c68bb10a1a9b06d01b25b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoEliminate YangModelDependencyInfo 17/109617/6
Robert Varga [Wed, 3 Jan 2024 20:54:34 +0000 (21:54 +0100)]
Eliminate YangModelDependencyInfo

ModuleImport is a completely different concept to what we want to
express.

We already have SourceIdentifier, which matches the fields, but
unfortunately it has slightly different co-notations -- for a dependency
a missing revision says it is a wildcard.

We therefore create a dedicated construct, SourceDependency, which
really is a model.api.source contract.

This clarifies a lot of details about SourceInfo and DependencyResolver,
leading to complete elimination of YangModelDependencyInfo, making
DependencyResolve work on SourceInfo.

The extraction logic is hosted in YangIRSourceInfoExtractor, but we
expect it to mvoe to YangIRSchemaSource, once we have dealt with the
code structors within yang-parser-rfc7950.

JIRA: YANGTOOLS-1150
Change-Id: I913a03d2b2486e566d06f11b7f5f0d496f30c98f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up YangModelDependencyInfo 96/109596/2
Robert Varga [Wed, 3 Jan 2024 20:43:53 +0000 (21:43 +0100)]
Clean up YangModelDependencyInfo

Bring the two subclasses to the front of the file and annotate returns,
enforcing non-null as appropriate.

JIRA: YANGTOOLS-1150
Change-Id: Ic33c52d4d54de03243e6eb9ad1d1df9a96d5718c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up dependency declarations 95/109595/3
Robert Varga [Wed, 3 Jan 2024 19:20:03 +0000 (20:20 +0100)]
Clean up dependency declarations

Code movement we have made allows us to clean up dependencies. This
patch does that.

Change-Id: Ia01ead4410a421e0b1c0e8fe7d89377dc622720d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoImplement SourceInfo extraction 94/109594/2
Robert Varga [Wed, 3 Jan 2024 18:10:09 +0000 (19:10 +0100)]
Implement SourceInfo extraction

Create SourceInfo extractor and use it in YangModelDependencyInfo.

JIRA: YANGTOOLS-1150
Change-Id: I11a8912cd2b0abb05c0f6ee5ff0f3bc87ebe3947
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up DataTreeCandidateNodesTest 86/109586/2
Robert Varga [Tue, 2 Jan 2024 18:43:58 +0000 (19:43 +0100)]
Clean up DataTreeCandidateNodesTest

Use MockitoExtension instead of explicit mocks. Also pull in
ImmutableNodes to ditch mocking of NormalizedNodes.

Change-Id: Iea956a411bce741fd7ae39b0d42621c166441ee2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoSeal YangModelDependencyInfo 93/109593/2
Robert Varga [Wed, 3 Jan 2024 18:02:16 +0000 (19:02 +0100)]
Seal YangModelDependencyInfo

We have two implementations, both of which are internal. Seal it.

Change-Id: Iacc9b5c39eba8fb7098d0596fdff08714bc5e170
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoAdd SchemaSourceInfo 76/109576/32
Robert Varga [Tue, 2 Jan 2024 19:01:02 +0000 (20:01 +0100)]
Add SchemaSourceInfo

We typically need to organize SchemaSourceRepresentations in some way
and make consistency inferences against their linkage.

The RFCSs do not specifically call this out, but the information is kept
at the top of the YANG file, so that even a simple text parser can find
it quickly.

Our YANG text processing pipeline has this information available
whenever we need to build a YangModelDependencyInfo -- which is an
optional operation, but the implementation only needs IRSchemaSource.

This patch introduces SchemaSourceInfo, which is a RFC-based opinionated
version YangModelDependencyInfo.

JIRA: YANGTOOLS-1150
Change-Id: I5043f2be3138c6cf599cb8ca29c5bfb0c829625e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoMigrate tests to use node.spi.ImmutableNodes 91/109591/3
Robert Varga [Wed, 3 Jan 2024 14:36:39 +0000 (15:36 +0100)]
Migrate tests to use node.spi.ImmutableNodes

We have a few stragglers, migrate them.

JIRA: YANGTOOLS-1259
Change-Id: Ie21d13359c7ec8d4b10f3ca4193460c478acefc3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoSchemaSourceException should carry SourceIdentifier 81/109581/15
Robert Varga [Tue, 2 Jan 2024 05:37:25 +0000 (06:37 +0100)]
SchemaSourceException should carry SourceIdentifier

We have two classes that already do this, codify this fact.

JIRA: YANGTOOLS-1150
Change-Id: I63bb778b21a063346bfa432734bc60fbb0bc1560
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoAdd ImmutableNode.newXYXBuilder() methods 70/109570/6
Robert Varga [Mon, 1 Jan 2024 14:42:39 +0000 (15:42 +0100)]
Add ImmutableNode.newXYXBuilder() methods

Add convenience methods forwarding to BuilderFactory and migrate most
users of deprecated constructs.

JIRA: YANGTOOLS-1259
Change-Id: I78451bca62503f87422b285c48b5167b6819806a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoAdd StatementSourceException 82/109582/13
Robert Varga [Tue, 2 Jan 2024 05:38:15 +0000 (06:38 +0100)]
Add StatementSourceException

There is a missing link between in model.api.meta, which is an exception
that carries a StatementSourceReference where it occurred.

JIRA: YANGTOOLS-1150
Change-Id: I75c08b90e049b620ba532163694102ef94bbd5a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoPromote SchemaSourceRepresentation 85/109585/11
Robert Varga [Tue, 2 Jan 2024 09:04:51 +0000 (10:04 +0100)]
Promote SchemaSourceRepresentation

SchemaSourceRepresentation is an extensible framework for identifying
and working with sources of YANG schema, which eventually can become
yang.model.api constructs.

SchemaSourceRepresentation and its two immediate specializations are
landing in yang.mode.api.source, the actual implementations in
yang.model.spi.source.

JIRA: YANGTOOLS-1150
Change-Id: I10d0b3afd29f6b96b98ea8ffca0ca1c0b8ec44f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoDo not provide SourceIdentifiers from extensions 84/109584/3
Robert Varga [Tue, 2 Jan 2024 08:33:14 +0000 (09:33 +0100)]
Do not provide SourceIdentifiers from extensions

These constants are artificially holding down yang-repo-api and are not
used anywhere. remove them and clean up dependencies.

JIRA: YANGTOOLS-1150
Change-Id: I7a7b3cb410e815257bd8949ba2a948a39512551d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoPromote StatementSourceReference to model.api.meta 80/109580/4
Robert Varga [Tue, 2 Jan 2024 04:57:08 +0000 (05:57 +0100)]
Promote StatementSourceReference to model.api.meta

This class simply captures a few model.api.meta constructs, host it
where its brethren are.

JIRA: YANGTOOLS-1150
Change-Id: I8cd75e3c40ebb05dc7377b09fc9b282f014fd6dd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove EffectiveModelContext{Listener,Provider} 75/109575/5
Robert Varga [Mon, 1 Jan 2024 19:48:07 +0000 (20:48 +0100)]
Remove EffectiveModelContext{Listener,Provider}

These are useless things that introduce verbosity.

At the end of the day, EffectiveModelContextProvider is someone who has

  EffectiveModelContext modelContext()

method -- which is but an idiom.

If we need to throw in a source of ISEs and callbacks, we are modeling
something much different -- better expressed explicitly where needed.

Change-Id: I6b1c11b01a0656a6a373e0d9b940607ee7a20aa0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoModernize ArgumentContextUtils 79/109579/4
Robert Varga [Tue, 2 Jan 2024 02:46:21 +0000 (03:46 +0100)]
Modernize ArgumentContextUtils

Use new language features:
- switch expression for YangVersion parsing
- instanceof patterns for type dispatch
- arrow cases for confiment
- multiline literal for simpler maintenance

Change-Id: Id23bf974f61b3e31abe0191e47192458a43e61ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoMigrate YT1417Test 73/109473/1
Robert Varga [Fri, 29 Dec 2023 07:38:55 +0000 (08:38 +0100)]
Migrate YT1417Test

We have simple interactions here, migrate them to new methods.

JIRA: YANGTOOLS-1529
Change-Id: Ic2ad8122a61690c1ad22a7ef9484a4ea267a0fce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoMigrate ImmutableNodes users 70/109470/1
Robert Varga [Fri, 29 Dec 2023 07:02:00 +0000 (08:02 +0100)]
Migrate ImmutableNodes users

This is a first pass on ImmutableNodes users, migrating them from
yang-data-impl to yang-data-spi version of this class.

JIRA: YANGTOOLS-1529
Change-Id: I7add26830e008f33f281bb1ec065f1f855d1eb55
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up TypeDefinitionAwareCodec 69/109469/1
Robert Varga [Fri, 29 Dec 2023 06:54:22 +0000 (07:54 +0100)]
Clean up TypeDefinitionAwareCodec

Representation class should be the first argument and we should always
require a TypeDefinition.

Change-Id: I1bb1b40de807cd36c2622c8966ab9c4db161f8f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoIntroduce {LeafSet,Map}Node.Builder 52/109452/5
Robert Varga [Fri, 29 Dec 2023 00:13:05 +0000 (01:13 +0100)]
Introduce {LeafSet,Map}Node.Builder

Having an intermediate interface holding common bits between
{System,User}LeafSetNode.Builder is useful. This patch introduces a
sealed class to capture those bits.

JIRA: YANGTOOLS-1259
Change-Id: Ie1aba04a42308cf22054936e12a041ca90888c6f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoPromote ImmutableNodes to yang-data-spi 86/104786/6
Robert Varga [Thu, 28 Dec 2023 12:47:10 +0000 (13:47 +0100)]
Promote ImmutableNodes to yang-data-spi

Immutable implementations of NormalizedNodes are generally useful for
basic operation of other NormalizedNode implementations -- for example
in the case of a lazily-materialized NormalizeNode.

Move Immutable*NodeBuilders to data.spi.node.impl, hiding them from
outside world and splitting out the actual implementations.

Builders are available indirectly through
data.spi.node.ImmutableNodes.builderFactory(), which centralizes access
and allows us to apply globally-configurable policy to builders (in a
future patch).

yang.data.impl.schema.{Builders,ImmutableNodes} are deprecated for
removal.

JIRA: YANGTOOLS-1259
Change-Id: I9eaaebcde5ce1b61e117ac712276d9288249b51a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoSeal NormalizedNode hierarchy 06/109406/13
Robert Varga [Fri, 22 Dec 2023 15:51:48 +0000 (16:51 +0100)]
Seal NormalizedNode hierarchy

This patch ensures that all of NormalizedNode interface hierarchy is
sealed, so users can rely on instanceof exhaustiveness.

As a side-effect of this change, we promote
node.spi.AbstractNormalizedNode into the API package and create a mirror
class hierarchy around it.

This hierarchy is then extende by the immutable implementations. This
adds a bit of code duplication, but it also makes it very clear what the
expectations are.

We have flushed out a couple of bugs in the process -- like
LeafSetEntryNode not protecting byte[] children.

JIRA: YANGTOOLS-1259
Change-Id: I0764278cff74a482c74381e6b5e4787ffc3f87e1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove unused suppression 41/109441/1
Robert Varga [Thu, 28 Dec 2023 11:44:38 +0000 (12:44 +0100)]
Remove unused suppression

Since NormalizedNode.Builder is not generic, we no longer need this
suppression.

JIRA: YANGTOOLS-1259
Change-Id: Ia253daa1ea4c29db12f93ad5a2247db4352b2f07
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRedirect Builders through ImmutableNodes' builder factory 10/109410/6
Robert Varga [Sat, 23 Dec 2023 01:09:21 +0000 (02:09 +0100)]
Redirect Builders through ImmutableNodes' builder factory

Now that we have an intermediate interface for creating builders, we
want to funnel all calls through it.

This disconnects Builders from the actual implementations.

JIRA: YANGTOOLS-1259
Change-Id: Ibc7dc9dc6de9872c1f95e25a3efd2dae50e73d08
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoBump odlparent to 13.0.10 90/109390/2
Robert Varga [Mon, 18 Dec 2023 15:01:13 +0000 (16:01 +0100)]
Bump odlparent to 13.0.10

Pick up latest upgrades.

Change-Id: I3748f701c67f6b750ab0eb08d0005b1138d63ef4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoPromote MandatorLeafEnforcer 11/109411/3
Robert Varga [Sat, 23 Dec 2023 02:40:05 +0000 (03:40 +0100)]
Promote MandatorLeafEnforcer

This is a very useful utility, promote it to data.spi.node, so it is
easily accessible.

JIRA: YANGTOOLS-980
Change-Id: I90c1320b5e3aa8fda19c50e3aeefde493da01341
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoAdd NormalizedNode.BuilderFactory 05/109405/11
Robert Varga [Fri, 22 Dec 2023 01:18:51 +0000 (02:18 +0100)]
Add NormalizedNode.BuilderFactory

Add a centralized interface for creating all know builder types. This
allows us to decouple most call sides from Builders/ImmutableNodes,
directly tying into a provider.

This decoupling can be used to further promote constructs, as their
dependency on ImmutableNodes/Builders can be indirected through this
factory.

JIRA: YANGTOOLS-1259
Change-Id: Ic68d84501b1d0e8ad3110ae8f1ece63c25c59ec1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoPromote InterningLeafSetNodeBuilder 08/109408/1
Robert Varga [Fri, 22 Dec 2023 23:34:06 +0000 (00:34 +0100)]
Promote InterningLeafSetNodeBuilder

This is a useful utility, promote it to data.spi.node, integrating
LeafsetEntryInterner.

JIRA: YANGTOOLS-980
Change-Id: Idd49b9e85fc96d9fb9d80541ce720efb92466225
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoPromote InterningLeafNodeBuilder 07/109407/1
Robert Varga [Fri, 22 Dec 2023 22:50:47 +0000 (23:50 +0100)]
Promote InterningLeafNodeBuilder

This is a useful utility, promote it to data.spi.node.

JIRA: YANGTOOLS-980
Change-Id: Id96fc4281fb39e821c8ab1e0a1132f615215a66a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoIntroduce NormalizedNode.Builder interfaces 99/109399/7
Robert Varga [Thu, 21 Dec 2023 11:58:11 +0000 (12:58 +0100)]
Introduce NormalizedNode.Builder interfaces

Each valid end-user specialization get a Builder interface, which is
then implemented by a immutable builder.

The hierarchy starts at NormalizedNode.Builder and crosses to the legacy
NormalizedNodeBuilder, ending with, for example, ContainerNode.Builder.

This builder hierarchy allows is to improve Builders API accuracy -- and
that accuracy in turn allows us to disconnect
InterningLeaf(Set)NodeBuilder from the immutable hierarchy, becoming
just forwarding implementations of Leaf(Set)Node.Builder.

JIRA: YANGTOOLS-1259
Change-Id: I8dd84914e7aef66619f6a8dfde9aa76b8aec6538
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove NormalizedNode.getIdentifier() 04/109404/2
Robert Varga [Thu, 21 Dec 2023 22:13:03 +0000 (23:13 +0100)]
Remove NormalizedNode.getIdentifier()

This method has been deprecated for removal, remove it now.

JIRA: YANGTOOLS-1559
Change-Id: Ia8f839c0daa60fc64ce20084833f3516869b02a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up DefaultYangParser 98/109398/1
Robert Varga [Thu, 21 Dec 2023 10:54:44 +0000 (11:54 +0100)]
Clean up DefaultYangParser

- remove superfluous @NonNull
- use ImmutableSet for REPRESENTATIONS
- use instanceof patterns

Change-Id: Ifd7a0da2446d2ae7d826cff92079b3ab426c24ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoPromote DefaultYangLibResolver 97/109397/1
Robert Varga [Thu, 21 Dec 2023 10:41:31 +0000 (11:41 +0100)]
Promote DefaultYangLibResolver

This is not a @Beta. Also clean up OSGi activation to be lazy.

Change-Id: If3b7ff8f28556d5d156193b1556b151b29fc26eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoAdd YANG IR I/O support 60/92260/24
Robert Varga [Mon, 24 Aug 2020 16:36:00 +0000 (18:36 +0200)]
Add YANG IR I/O support

Persisting the intermediate representation and restoring it is much
faster and memory-efficient than parsing YANG files from scratch.

This patch adds the smarts to persist/restore an IRStatement to/from
an arbitrary DataOutput/DataInput.

We also complete AbstractIRObject definitions by adding appropriate
hashCode()/equals() methods.

JIRA: YANGTOOLS-1461
Change-Id: Iff10b91c8439d3323ae8c263480f4dfd6c1f1c00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoAdd InputStreamNormalizer 93/109293/13
Robert Varga [Mon, 11 Dec 2023 22:49:54 +0000 (23:49 +0100)]
Add InputStreamNormalizer

This patch adds InputStreamNormalizer interface to act as a unified API
displacing direct use of XmlParserStream/JsonParserStream.

It is modelled after the needs of RFC8040, yet it is useful in general,
as it supports essentially all use cases serviced by the *ParserStreams.

This core implementation logic is in
data.util.AbstractInputStreamNormalizer, which is a subclass of
AbstractCodecFactory.

The JSON-specific part is introduced as well, with the correspondign
NormalizedNodeParserTest.

JIRA: YANGTOOLS-1415
Change-Id: Id95b609257e1a8ab57e3d61896315e3211223176
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoMake NormalizedTuple generic 23/109323/1
Robert Varga [Fri, 15 Dec 2023 01:06:48 +0000 (02:06 +0100)]
Make NormalizedTuple generic

NormalizedTuple should capture the type of NormalizedNode it carries.
This will be useful as we define more normalization APIs, where some
parts guarantee, for example, ContainerNode.

Change-Id: I01a3429c0bb38cd87d293dfbd154be7aa69c411d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoModernize JsonParserStream 16/109316/1
Robert Varga [Thu, 14 Dec 2023 21:28:11 +0000 (22:28 +0100)]
Modernize JsonParserStream

Use local variable type inference, instanceof patterns and explicit
throws to modernize the codebase a bit.

Change-Id: Ib4b5d28b38da2d1797710d4e05ac5d2d792da157
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoBump odlparent to 13.0.9 88/109188/5
Robert Varga [Wed, 6 Dec 2023 22:11:26 +0000 (23:11 +0100)]
Bump odlparent to 13.0.9

Adopt latest fixes and deal with stricter SpotBugs -- mostly by adding
suppressions of false positives.

Change-Id: I992e1ae8b5c0c6926c049230b25acbf1ae7b0272
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoDo not import java.io.Serial 85/109285/2
Robert Varga [Mon, 11 Dec 2023 13:05:36 +0000 (14:05 +0100)]
Do not import java.io.Serial

This annotation is not worth an import, just use fully-qualified
references.

Change-Id: I393c5e13ef89f3ca740f010018288309dad96838
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoFix warnings around Version nullness 78/109278/1
Robert Varga [Mon, 11 Dec 2023 06:38:12 +0000 (07:38 +0100)]
Fix warnings around Version nullness

Version factory methods always return non-null, annotate that.

Change-Id: I388b161c10437fa812f9a30b99ac484e0175f483
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove YangTextSchemaSourceRegistration 29/109229/1
Robert Varga [Fri, 8 Dec 2023 16:56:00 +0000 (17:56 +0100)]
Remove YangTextSchemaSourceRegistration

This interface brings very little to the table, just use a plain
Registration.

JIRA: YANGTOOLS-1551
Change-Id: I69f3fe915c8d35e479ae8fa75313b532ea3b120c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoDeprecate ListenerRegistration for removal 27/109227/1
Robert Varga [Fri, 8 Dec 2023 16:37:15 +0000 (17:37 +0100)]
Deprecate ListenerRegistration for removal

This interface brings very little to the table and binds to
j.u.EventListener as if it were a good idea. Deprecate it for removal,
guiding users towards ObjectRegistration instead.

JIRA: YANGTOOLS-1551
Change-Id: Id621532b52bb7d9d4cea335d6841bf110a68af62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoDeprecate ListenerRegistry for removal 26/109226/2
Robert Varga [Fri, 8 Dec 2023 13:43:52 +0000 (14:43 +0100)]
Deprecate ListenerRegistry for removal

ListenerRegistry is intrinsically tied to EventListener. We have
ObjectRegistry which has the same functionality without the excess
baggage.

Add ObjectRegistryTest and deprecate ListenerRegistry for removal.

JIRA: YANGTOOLS-1551
Change-Id: I10bc98420abe5f760e08f4a05ef189df85cc7ee0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRemove SchemaSourceRegistration 25/109225/3
Robert Varga [Fri, 8 Dec 2023 13:34:15 +0000 (14:34 +0100)]
Remove SchemaSourceRegistration

Previous patch has touched yang.model.repo.spi. Since we are in the
area, also remove SchemaSourceRegistration to keep the API consistent.

JIRA: YANGTOOLS-1551
Change-Id: Iba1ea385c8f72433410c283a523207d2d3d77dfb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoDisconnect StatementContextBase from EventListener 19/109219/4
Robert Varga [Thu, 7 Dec 2023 22:23:30 +0000 (23:23 +0100)]
Disconnect StatementContextBase from EventListener

j.u.EventListener should really be tied to j.u.EventObject, which is not
useful for our purposes. Ditch the reference in StatementContextBase.

JIRA: YANGTOOLS-1551
Change-Id: I3f364e1f41f757d087bb75464f08ab4f8e64474a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoDisconnect SchemaSourceListener from EventListener 18/109218/5
Robert Varga [Thu, 7 Dec 2023 22:19:53 +0000 (23:19 +0100)]
Disconnect SchemaSourceListener from EventListener

j.u.EventListener should really be tied to j.u.EventObject, which is not
useful for our purposes. Ditch the reference in SchemaSourceListener.

This ends up forcing us to abandon AbstractSchemaListenerRegistration,
which is fine, as we can just pull the functionality into an internal
class.

JIRA: YANGTOOLS-1551
Change-Id: Id439e9bac61a4ba991ed75d04c19ead7d94a72c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRemove SchemaContextListener 17/109217/1
Robert Varga [Thu, 7 Dec 2023 22:14:26 +0000 (23:14 +0100)]
Remove SchemaContextListener

This is a holdout of times long past and it references j.u.EventLister.
Remove it.

JIRA: YANGTOOLS-1551
Change-Id: I7855fb188168774f5ee4b45ef5670942fef59c05
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoDisconnect EffectiveModelContextListener from EventListener 15/109215/1
Robert Varga [Thu, 7 Dec 2023 21:56:13 +0000 (22:56 +0100)]
Disconnect EffectiveModelContextListener from EventListener

j.u.EventListener should really be tied to j.u.EventObject, which is not
useful for our purposes. Ditch the reference in
EffectiveModelContextListener.

JIRA: YANGTOOLS-1551
Change-Id: Ifa2078bf2d0a689ded83a57432985a9087a3664b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoDeprecate SchemaContextListener for removal 14/109214/1
Robert Varga [Thu, 7 Dec 2023 21:55:17 +0000 (22:55 +0100)]
Deprecate SchemaContextListener for removal

SchemaContext is superseded by EffectiveModelContext, guide users
towards that by deprecating SchemaContextListeer.

JIRA: YANGTOOLS-1553
Change-Id: I91a821bc5651cdf2167820f549427200c9162c07
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoFix Eclipse nullness errors 81/109181/2
Robert Varga [Wed, 6 Dec 2023 21:07:59 +0000 (22:07 +0100)]
Fix Eclipse nullness errors

We have two error-level warnings reported for instantiated GeneratorTask
list. Fix them by annotating the result of instantiateGenerators().

While we are here, also clean up the method a bit and return an
ImmutableList instead.

Change-Id: Ic373c34671877c1cf5ce685ed38e55ef3579fc34
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoAdd Inference.of() 29/109129/1
Robert Varga [Thu, 30 Nov 2023 19:15:53 +0000 (20:15 +0100)]
Add Inference.of()

Improve documentation and a shortcut method to create an empty
Inference.

Change-Id: I431042cb04fd7812733a8f9b72480d3761695aa5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoImprove ListEntryNodeDataWithSchema error reporting 16/109116/3
Robert Varga [Tue, 28 Nov 2023 23:49:13 +0000 (00:49 +0100)]
Improve ListEntryNodeDataWithSchema error reporting

When we encounter a keyed list entry which does not have all keys
specified we should report which keys are missing through an
IOException.

JIRA: YANGTOOLS-1550
Change-Id: I40a7c04970b244c893f4541469efe7e562b49e71
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoImprove OffsetMapTemplate error reporting 15/109115/3
Robert Varga [Tue, 28 Nov 2023 22:36:32 +0000 (23:36 +0100)]
Improve OffsetMapTemplate error reporting

Include a human-readable message when we throw an IAE.

JIRA: YANGTOOLS-1550
Change-Id: I7acb3e9b23ed20a00551435ce68c68d138a052e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoAdd AbstractHierarchicalIdentifier 50/109050/3
Robert Varga [Wed, 22 Nov 2023 15:00:22 +0000 (16:00 +0100)]
Add AbstractHierarchicalIdentifier

We have a few implementations of Hierarc hicalIdentifier, some of which
are composed of a series of steps and nothing more.

Introduce AbstractHierarchicalIdentifier to serve as the common
superclass, formalizing the common bits.

JIRA: YANGTOOLS-1549
Change-Id: I958b2092ba4da3d8f6ca358b46b66ccc96d3b1ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoUse local variable type inference for stack 49/109049/1
Robert Varga [Wed, 22 Nov 2023 14:58:06 +0000 (15:58 +0100)]
Use local variable type inference for stack

This is a trivial simplification of code.

Change-Id: I0e5a7d5a7a74feff888cb5c00bcfb954fb8ff90b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoDeprecate JSONCodecFactory.Lhotka02 for removal 24/108924/2
Robert Varga [Tue, 14 Nov 2023 08:47:22 +0000 (09:47 +0100)]
Deprecate JSONCodecFactory.Lhotka02 for removal

We have deprecated the provider in the previous release, indicate our
intent to remove it.

Change-Id: I6e6a65d97f5ca14367dcee2fc16a9822690342a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoUpdate XmlToNormalizedNodesTest 40/108740/1
Robert Varga [Mon, 30 Oct 2023 09:32:50 +0000 (10:32 +0100)]
Update XmlToNormalizedNodesTest

Spell out the two YANG files used in the test.

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

6 months agoBump odlparent to 13.0.7 24/108724/1
Robert Varga [Sun, 29 Oct 2023 19:26:04 +0000 (20:26 +0100)]
Bump odlparent to 13.0.7

Adopt latest upgrades from upstream.

Change-Id: I6048f91776d198fb17ab285df8802bf6bbafc17b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoModernize SchemaInferenceStack 89/108689/4
Robert Varga [Thu, 26 Oct 2023 19:30:37 +0000 (21:30 +0200)]
Modernize SchemaInferenceStack

Use local variable type inference and instanceof patterns to reduce the
number of explicit type declarations and casts.

Also (mostly) migrate away from verify()/checkState()/checkArgument(),
exposing further branches that should be tested and a potentially-dead
code.

Change-Id: I656bdc230393f736f57b80f8256fd726079edf9e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoAdd SchemaInferenceStack.effectiveStatus() 32/104132/5
Robert Varga [Wed, 25 Jan 2023 04:32:22 +0000 (05:32 +0100)]
Add SchemaInferenceStack.effectiveStatus()

EffectiveStatements are lacking the equivalent of
DocumentedNode.WithStatus.getStatus().

This patch introduces a utility method in SchemaInferenceStack, which
acts as a replacement producing results well-defined in
EffectiveStatement world.

JIRA: YANGTOOLS-1272
Change-Id: I1b07d4ab2eb43c62090d526326ac10df901e8bfb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoAdopt odlparent-13.0.6 69/108569/1
Robert Varga [Fri, 20 Oct 2023 16:09:59 +0000 (18:09 +0200)]
Adopt odlparent-13.0.6

Pick up latest fixes and updates from upstream.

Change-Id: I20d9dc57e0a3e7bbcc72f56af7b93924b7d94577
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoConvert yang-data-codec-xml to JUnit5 84/106884/2
Robert Varga [Wed, 18 Oct 2023 15:26:18 +0000 (17:26 +0200)]
Convert yang-data-codec-xml to JUnit5

This is a mostly automated conversion, but the parameterized tests
require some intervention.

JIRA: YANGTOOLS-1521
Change-Id: I8599cc0dc3b98a8206e09312fea828826c58072a
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate yang-data-codec-binfmt to JUnit 5 82/106882/3
Robert Varga [Wed, 18 Oct 2023 11:32:56 +0000 (13:32 +0200)]
Migrate yang-data-codec-binfmt to JUnit 5

We have a ton of parameterized tests here, migrate them manually to
JUnit5.

JIRA: YANGTOOLS-1521
Change-Id: I4efc867a01a4dbb6a6fc38e452ab4db55ff0819c
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate yang-data-tree-ri to JUnit5 98/106898/5
matus.matok [Thu, 13 Jul 2023 07:46:33 +0000 (09:46 +0200)]
Migrate yang-data-tree-ri to JUnit5

Migrated all tests to use JUnit5 Assertions, using
openrewrite:rewrite-testing-frameworks.
Removed declarations of never thrown exceptions.
Manually refactored variable modifiers and used 'var' wherever possible

JIRA: YANGTOOLS-1521
Change-Id: I4870be9af36c1e8924323e671c02dbbab42b83a5
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoPartially Migrate yang-data-codec-xml to xmlunit-core 94/108494/1
Robert Varga [Wed, 18 Oct 2023 07:36:33 +0000 (09:36 +0200)]
Partially Migrate yang-data-codec-xml to xmlunit-core

Migrate easy-to-migrate tests to xmlunit-core, reducing our exposure to
legacy.

Change-Id: If07f69cb40179df00daabf68fc6faf34df8c2d08
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate yang-data-impl to JUnit5 97/106897/7
matus.matok [Thu, 13 Jul 2023 07:37:27 +0000 (09:37 +0200)]
Migrate yang-data-impl to JUnit5

Migrated all tests to use JUnit5 Assertions, using
openrewrite:rewrite-testing-frameworks. Manually corrected variable modifiers,
including migration to 'var'.

JIRA: YANGTOOLS-1521
Change-Id: Iecffb046c782ec732da51d9d92738d3bfebf5ef4
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRemove MemoryConsumption 93/108493/1
Robert Varga [Wed, 18 Oct 2023 07:05:44 +0000 (09:05 +0200)]
Remove MemoryConsumption

This class is not used anywhere, remove it.

Change-Id: I8fcaa8db98a5cd266d4c8c10d983b98c3327485b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoDo not create effective copy for unsupported statements 87/107387/5
Sangwook Ha [Thu, 10 Aug 2023 23:15:25 +0000 (16:15 -0700)]
Do not create effective copy for unsupported statements

If we are encountering a statement which is not supported, we should not
create an effective copy of it for the purposes of comparison.

JIRA: YANGTOOLS-1532
Change-Id: I4407e38f2a62c911b653191bf7c6cfd82ba0225e
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate rfc8639-parser-support to JUnit5 07/106907/7
matus.matok [Thu, 13 Jul 2023 08:38:19 +0000 (10:38 +0200)]
Migrate rfc8639-parser-support to JUnit5

Migrated all tests to use JUnit5 Assertions, using
openrewrite:rewrite-testing-frameworks.

JIRA: YANGTOOLS-1521
Change-Id: I5e3d60cca03a1b8af3b50b96ed2db542a8bb3258
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate yang-repo-spi to JUnit5 12/106912/4
matus.matok [Thu, 13 Jul 2023 09:27:10 +0000 (11:27 +0200)]
Migrate yang-repo-spi to JUnit5

Migrated all tests to use JUnit5 Assertions, using
openrewrite:rewrite-testing-frameworks.

JIRA: YANGTOOLS-1521
Change-Id: I99202bffab5035110a3c2b3d9228d64d933c26c3
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate yang-maven-plugin-it to JUnit5 11/106911/5
matus.matok [Thu, 13 Jul 2023 09:22:34 +0000 (11:22 +0200)]
Migrate yang-maven-plugin-it to JUnit5

Migrated all tests to use JUnit5 Assertions, using
openrewrite:rewrite-testing-frameworks.

JIRA: YANGTOOLS-1521
Change-Id: Idd39caf43f861daf71dbf743270c8a969f5547a9
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate yang-parser-spi to JUnit5 09/106909/8
matus.matok [Thu, 13 Jul 2023 08:57:02 +0000 (10:57 +0200)]
Migrate yang-parser-spi to JUnit5

Migrated all tests to use JUnit5 Assertions, using
openrewrite:rewrite-testing-frameworks. Also clean up mocking and use
MockitoExtension.

JIRA: YANGTOOLS-1521
Change-Id: Icc91eda7a6e15003aa1a1135bd31a960869ded14
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate common/util to JUnit5 96/106896/7
matus.matok [Thu, 13 Jul 2023 07:30:33 +0000 (09:30 +0200)]
Migrate common/util to JUnit5

Migrated all tests to use JUnit5 Assertions, using
openrewrite:rewrite-testing-frameworks.

JIRA: YANGTOOLS-1521
Change-Id: I175e6fb628a1f1375e70ff8c93f1b1028ccf4ce6
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate yang-data-codec-gson to JUnit5 83/106883/5
matus.matok [Tue, 11 Jul 2023 13:46:45 +0000 (15:46 +0200)]
Migrate yang-data-codec-gson to JUnit5

Migrated all tests to use JUnit5 Assertions, using rewrite-testing-frameworks.

JIRA: YANGTOOLS-1521
Change-Id: I0f8b99033ca895da190324c5458da12d2de9bb07
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate yang-data-tree-spi to JUnit5 99/106899/5
matus.matok [Thu, 13 Jul 2023 07:58:41 +0000 (09:58 +0200)]
Migrate yang-data-tree-spi to JUnit5

Migrated all tests to use JUnit5 Assertions, using openrewrite:rewrite-testing-frameworks.

JIRA: YANGTOOLS-1521
Change-Id: I7670aa3b290b21e5e7c47a70316550fbfa4164d6
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
6 months agoRemove support for inputs older than Magnesium 57/108257/2
Robert Varga [Thu, 5 Oct 2023 15:17:29 +0000 (17:17 +0200)]
Remove support for inputs older than Magnesium

We have a number of obsolete formats here, which are not efficient or
tested. Eliminate LITHIUM,NEON_SR2 and SODIUM_SR1 support.

JIRA: YANGTOOLS-1548
Change-Id: I973916d2ffb25e219380c854dcbe2d86d0b60337
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoCheck rc:yang-data template name duplications 59/108259/3
Robert Varga [Thu, 5 Oct 2023 16:54:16 +0000 (18:54 +0200)]
Check rc:yang-data template name duplications

yang-data template names have a global scope, similar to schema tree
namespace. Enforce non-overlap of template names in a particular
reactor.

JIRA: YANGTOOLS-1482
Change-Id: I2da9188d5a95baa591b8ceef585a3e84fa18f531
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoRemove EffectiveAugmentationSchema 56/108256/2
Robert Varga [Thu, 5 Oct 2023 15:04:54 +0000 (17:04 +0200)]
Remove EffectiveAugmentationSchema

This class is not needed anywhere and has been deprecated for removal.
Remove it in this major iteration.

Change-Id: Ibad4f6e66b559285e5fda61281e421c12da23838
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoDrop QNameModuleAware from AugmentEffectiveStatementImpl 18/107918/3
Robert Varga [Tue, 19 Sep 2023 16:41:06 +0000 (18:41 +0200)]
Drop QNameModuleAware from AugmentEffectiveStatementImpl

This interface is not specified and hence should not be used.

JIRA: YANGTOOLS-1409
Change-Id: I5d3d6dc34d85d360e92c05f083f10b475c732b0a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoReduce use of yang.model.api 53/106953/5
Robert Varga [Fri, 21 Jul 2023 09:07:29 +0000 (11:07 +0200)]
Reduce use of yang.model.api

AbstractModuleStringInstanceIdentifierCodec really needs only
QNameModule, update its contract to not rely on yang.model.api.Module.

JIRA: YANGTOOLS-1524
Change-Id: I2648be150328a945a3f53c85820d91c9a112674e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoRemove EvenMoreObjects 55/108255/1
Robert Varga [Thu, 5 Oct 2023 15:02:40 +0000 (17:02 +0200)]
Remove EvenMoreObjects

This class is completely unused and deprecated for removal. Remove it as
part of this major version bump.

Change-Id: Ic1daa590d19595d78f07884c5f5af4d2b992e82e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoRemove getValue() methods from model.api.stmt interfaces 54/108254/1
Robert Varga [Thu, 5 Oct 2023 15:01:08 +0000 (17:01 +0200)]
Remove getValue() methods from model.api.stmt interfaces

These methods have been deprecated for removal, remove them as part of
the next major release.

Change-Id: Id982b9a9135eca421c991d3943f3fdfe93f3ed0e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoRemove obsolete DataTreeCandidateNode methods 25/106225/4
Robert Varga [Mon, 29 May 2023 08:46:28 +0000 (10:46 +0200)]
Remove obsolete DataTreeCandidateNode methods

These methods have been deprecated for removal, remove them now.

Change-Id: I7e27d15fa2ab9a239fd2d4c9de0f81251a11eac0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoDo not trim XML element text 45/106945/8
Robert Varga [Thu, 20 Jul 2023 23:51:30 +0000 (01:51 +0200)]
Do not trim XML element text

Historically we have been trimming the content of XML elements, which
means we accepted leading/trailing whitespace for uint8 and similar
encodings.

This is not correct and this patch eliminates all trimming.

JIRA: YANGTOOLS-1523
Change-Id: I7060f8f2bf3374b4ca49629b6c4cdddb85660567
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoRemove AbstractStringIdentityrefCodec and its subclasses 35/108035/4
Robert Varga [Thu, 5 Oct 2023 13:03:43 +0000 (15:03 +0200)]
Remove AbstractStringIdentityrefCodec and its subclasses

These classes are not used anywhere, remove them.

Change-Id: I56f257874c422ac33e0f37608e694c90fb7f4729
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoImprove AbstractNamespaceCodec 34/108034/3
Robert Varga [Thu, 28 Sep 2023 21:46:00 +0000 (23:46 +0200)]
Improve AbstractNamespaceCodec

Improve nullness guarantees in createQName().

Change-Id: Icdb58b2ede7a5e2b8f380614719f3a1842255e53
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoPromote AbstractStringInstanceIdentifierCodec 33/108033/2
Robert Varga [Thu, 28 Sep 2023 21:40:57 +0000 (23:40 +0200)]
Promote AbstractStringInstanceIdentifierCodec

Integrate AbstractModuleStringInstanceIdentifierCodec, which is the only
subclass in active use. Drop @Beta moniker.

Change-Id: I5fe285feefd7db75fa73d8903f9d866390f9365f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoForce subclasses to implement deserializeKeyValue() 32/108032/4
Robert Varga [Thu, 28 Sep 2023 20:50:38 +0000 (22:50 +0200)]
Force subclasses to implement deserializeKeyValue()

Just passing values through is not appropriate -- everyone needs to
explicitly deal with values.

Change-Id: If019d9f1194dae0faa624d2ec08e09b043a4183d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoSwitch to using ModuleEffectiveStatement in codecs 31/108031/4
Robert Varga [Thu, 28 Sep 2023 20:48:27 +0000 (22:48 +0200)]
Switch to using ModuleEffectiveStatement in codecs

Rather than using Module, use ModuleEffectiveStatement, which provides
very similar facilities.

Change-Id: I3961e6dc17c236b71ebf555519ea06d3cbdc218b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoBump versions to 12.0.0-SNAPSHOT 50/108250/2
Robert Varga [Thu, 5 Oct 2023 12:49:37 +0000 (14:49 +0200)]
Bump versions to 12.0.0-SNAPSHOT

This starts the next development iteration.

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