yangtools.git
2 weeks agoMigrated models to use MD-SAL provided code.
Tony Tkacik [Fri, 21 Aug 2015 10:38:02 +0000 (12:38 +0200)]
Migrated models to use MD-SAL provided code.

Change-Id: Ia92933803e133604b5a54b1b2c82210480ae3ffc
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
2 weeks agoCleaned up Java Binding code from YANG Tools
Tony Tkacik [Thu, 20 Aug 2015 09:16:17 +0000 (11:16 +0200)]
Cleaned up Java Binding code from YANG Tools

- Introduced artifacts pom
- Updated groupId from .yangtools to .mdsal
- Renamed code-generator to binding folder which
  makes more sense since it contains also codecs
  and other functionality not directly related
  to code generation.
- added mdsal- prefix to artifact id to make
  it more distinguishable from YANGTools
- joined binding-model-api, binding-generator-api,
  binding-generator spi into mdsal-binding-generator-api
- joined binding-type-provider and binding-generator-impl
  into mdsal-binding-generator-impl

Change-Id: I7edb96eff81900b90b0f6195b009a412152c2b8f
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
2 weeks agoBumped model versions to .8-SNAPSHOT
Tony Tkacik [Fri, 24 Apr 2015 08:37:21 +0000 (10:37 +0200)]
Bumped model versions to .8-SNAPSHOT

Change-Id: I1b1c6c3fcd875795f2b8cab1d4146b25c87ee7e7
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
2 weeks agoBumped Yangtools by minor version.
Tony Tkacik [Thu, 23 Apr 2015 10:03:12 +0000 (10:03 +0000)]
Bumped Yangtools by minor version.

Change-Id: I0c357c757ed78607982abfbf788433e16c88835c
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
2 weeks agoBump versions for Lithium
Robert Varga [Wed, 17 Sep 2014 11:46:44 +0000 (13:46 +0200)]
Bump versions for Lithium

Bumps everything to 0.7.0, models get a .7 suffix.

Change-Id: I63d2f6b3782769043b8efa73ef64abe34e57b97a
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 weeks agobug 1128:POM Restructuring for Automated Release
Vaishali Mithbaokar [Thu, 10 Apr 2014 01:39:04 +0000 (18:39 -0700)]
bug 1128:POM Restructuring for Automated Release

Temporarily hosting odlrootparent as part of the project just for review purpose

Change-Id: Ia9f14f1f5544e3ef5a543cf8e0e904fb31ffbeee
Signed-off-by: Surekha Bejgam <sbejgam@cisco.com>
Signed-off-by: Vaishali Mithbaokar <vmithbao@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 weeks agoFix for Bug 511 (model + integration-test)
Martin Vitez [Tue, 18 Mar 2014 08:18:30 +0000 (09:18 +0100)]
Fix for Bug 511 (model + integration-test)

Removed \r characters from yang-ext.yang and from integration-test project.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
2 weeks ago[maven-release-plugin] prepare for next development iteration
Jenkins yangtools silo [Mon, 27 Jan 2014 18:15:07 +0000 (18:15 +0000)]
[maven-release-plugin] prepare for next development iteration

2 weeks ago[maven-release-plugin] prepare release yangtools-0.6.1
Jenkins yangtools silo [Mon, 27 Jan 2014 18:09:48 +0000 (18:09 +0000)]
[maven-release-plugin] prepare release yangtools-0.6.1

2 weeks ago[maven-release-plugin] prepare for next development iteration
Jenkins yangtools silo [Mon, 27 Jan 2014 15:51:17 +0000 (15:51 +0000)]
[maven-release-plugin] prepare for next development iteration

2 weeks ago[maven-release-plugin] prepare release yangtools-0.6.0
Jenkins yangtools silo [Mon, 27 Jan 2014 15:46:13 +0000 (15:46 +0000)]
[maven-release-plugin] prepare release yangtools-0.6.0

2 weeks agoAdd copyright headers
Robert Varga [Sat, 25 Jan 2014 06:53:37 +0000 (07:53 +0100)]
Add copyright headers

Change-Id: I98af3052912ea9eca7692e29ece196d5852c4253
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 weeks agoAdd copyright headers to pom.xml files
Robert Varga [Fri, 24 Jan 2014 08:31:32 +0000 (09:31 +0100)]
Add copyright headers to pom.xml files

Change-Id: I6265d077f47223d76da6ce08102024a8ab3e871e
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 weeks agoBump model versions to prevent clash with nexus
Robert Varga [Wed, 22 Jan 2014 10:00:01 +0000 (11:00 +0100)]
Bump model versions to prevent clash with nexus

It turns out the current -SNAPSHOT version were release on 9/30 into
nexus, but their versions were not bumpted. The released version does
not carry the latest generation rules, most notably DTO range checks and
it is tied to a historic (0.1.1) version of model parent.

This means we need to fix the historic mistake and do a fresh release.

Change-Id: Ia15862d880833bfc49cb42dd298a45c9b252fb32
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 weeks agoRevert "Revert "Bump all artifacts to 0.6.0-SNAPSHOT""
Robert Varga [Sun, 19 Jan 2014 20:22:23 +0000 (21:22 +0100)]
Revert "Revert "Bump all artifacts to 0.6.0-SNAPSHOT""

This reverts commit e83067e904d17644813311d6b184aaa9acfa93f8.

The controller is now ready to receive the revved-up version, except it
fails on a fix which is already present in the repository. Re-bump the
revision such that the controller-side patch
(https://git.opendaylight.org/gerrit/#/c/4298/) can succeed.

Change-Id: Ieca16ad1393d534791643942aeee593e15188802
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 weeks agoEnsure all pom.xml files have UNIX encoding
Robert Varga [Sun, 19 Jan 2014 11:14:39 +0000 (12:14 +0100)]
Ensure all pom.xml files have UNIX encoding

Change-Id: I799a155c6e4a33bbb0acc5164c9e94dc143a1671
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 weeks agoRevert "Bump all artifacts to 0.6.0-SNAPSHOT"
Tony Tkacik [Thu, 16 Jan 2014 09:43:09 +0000 (09:43 +0000)]
Revert "Bump all artifacts to 0.6.0-SNAPSHOT"

This reverts commit f5e9689b95d945c22c7a38870681cab899326de9.

Change-Id: I5ca4ae9c8a46b5af8244780cb04ec568b30335d3
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
2 weeks agoBump all artifacts to 0.6.0-SNAPSHOT
Robert Varga [Wed, 15 Jan 2014 21:44:31 +0000 (22:44 +0100)]
Bump all artifacts to 0.6.0-SNAPSHOT

Change-Id: Ie5a279943f7db817af7c94b017103bd7e6fd1d84
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 weeks agoClean up yang-ext pom file.
Martin Vitez [Mon, 16 Dec 2013 10:32:39 +0000 (11:32 +0100)]
Clean up yang-ext pom file.

Removed redundant configuration, which is inherited already from parent project.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
2 weeks ago[maven-release-plugin] prepare for next development iteration
Tony Tkacik [Fri, 27 Sep 2013 14:16:11 +0000 (16:16 +0200)]
[maven-release-plugin] prepare for next development iteration

Change-Id: Id76c931a0206738de2edc68b5997f13e5cab42cd
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
2 weeks ago[maven-release-plugin] Prepare release yangtools-0.1.0
Tony Tkacik [Fri, 27 Sep 2013 14:07:27 +0000 (16:07 +0200)]
[maven-release-plugin] Prepare release yangtools-0.1.0

Change-Id: Ie3fc3f25604b45518a8c21c4dc39dfac64d16d9e
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
2 weeks agoUpdated pom files, added concepts component
Tony Tkacik [Fri, 27 Sep 2013 11:38:22 +0000 (13:38 +0200)]
Updated pom files, added concepts component

Change-Id: Id7e0b320b8edbe89c52220c13b1b0d70bf7d1e30
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
2 weeks agoUse case arrows in mergeIntoModifiedNode() 84/112184/3
Robert Varga [Sat, 15 Jun 2024 14:26:22 +0000 (16:26 +0200)]
Use case arrows in mergeIntoModifiedNode()

The entire method is a dispatch, use arrows to delineate the methods --
which are now guarded with returns.

Change-Id: I0192381e12bb48cccca9ed7a3d7b166b66489034
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize DataTreeCandidateNodes 83/112183/3
Robert Varga [Sat, 15 Jun 2024 14:13:10 +0000 (16:13 +0200)]
Modernize DataTreeCandidateNodes

Use arrow cases in switch and slightly improve dispatch.

Change-Id: I14fd1da1af72a6f938b85061bb2e9727e544ad9a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoForce switch exhaustiveness in DataTreeCandidates 82/112182/4
Robert Varga [Sat, 15 Jun 2024 13:38:56 +0000 (15:38 +0200)]
Force switch exhaustiveness in DataTreeCandidates

Use 'case null', which forces use of JEP-441, which in turn requires the
switch to be exhaustive -- eliminating default branches.

Change-Id: I5cc25ee4c4f5f3e8382dee62426b3cf50f23661f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClean up DataTreeCandidates.cleanupTree() 81/112181/3
Robert Varga [Sat, 15 Jun 2024 13:42:52 +0000 (15:42 +0200)]
Clean up DataTreeCandidates.cleanupTree()

Use arrow switch cases for brevity, with a common return statement.

Change-Id: I0b8578a72fab8df0aa2245aee96177f648604668
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize NodeIterator 80/112180/3
Robert Varga [Sat, 15 Jun 2024 13:28:39 +0000 (15:28 +0200)]
Modernize NodeIterator

Use local variable type inference and arrows in switch cases.

Change-Id: I106e7702cb195f26317e6c9c7a6308cb3433e9aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRefactor DataTreeCandidate.illegalModification() 79/112179/3
Robert Varga [Sat, 15 Jun 2024 13:24:49 +0000 (15:24 +0200)]
Refactor DataTreeCandidate.illegalModification()

Return an IAE and use explictly throw it, exposing more useful flow
information to the compiler.

Change-Id: Ibd186283f540eccd8622c747098ca5b174f8cdb6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClean up DataTreeCandidates.compressModifications() 78/112178/3
Robert Varga [Sat, 15 Jun 2024 13:21:17 +0000 (15:21 +0200)]
Clean up DataTreeCandidates.compressModifications()

Use a switch expression to guarantee exhaustiveness. Also merge cases
which just propagate the case argument.

Change-Id: I5e1935601c3a2ea6d056866cc2760002e2830c2a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize DataTreeCandidates.(slow)compressNode() 77/112177/2
Robert Varga [Sat, 15 Jun 2024 13:12:52 +0000 (15:12 +0200)]
Modernize DataTreeCandidates.(slow)compressNode()

Use local variable type inference and arrow cases in switch.

Change-Id: I2e95e1adb049dc37a93212357fbf7af3c6ad8fcc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize DataTreeCandidates.fastCompressNode() 76/112176/2
Robert Varga [Sat, 15 Jun 2024 13:07:24 +0000 (15:07 +0200)]
Modernize DataTreeCandidates.fastCompressNode()

Use a switch expression to ensure exhaustiveness, allowing us to drop
the default case.

Change-Id: I00082c94b8de01353833c5996bccd79a5bf06b17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModerize DataTreeCandidates.aggregate() 75/112175/2
Robert Varga [Sat, 15 Jun 2024 13:01:05 +0000 (15:01 +0200)]
Moderize DataTreeCandidates.aggregate()

Use local variable type inference.

Change-Id: I923cd44133154321fc55dbc2c9952da5fb23806e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize DataTreeCandidates.applyToModification() 74/112174/2
Robert Varga [Sat, 15 Jun 2024 12:59:01 +0000 (14:59 +0200)]
Modernize DataTreeCandidates.applyToModification()

Use case arros and local variable type inference to make things a tad
more compact.

Change-Id: If6584ff8a52516d3b05ea314daf4d48e46e33368
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove unneeded default branches 73/112173/2
Robert Varga [Sat, 15 Jun 2024 12:56:20 +0000 (14:56 +0200)]
Remove unneeded default branches

We are using switch expressions which check for exhaustiveness -- hence
the default branches cannot ever be hit. Remove them.

Change-Id: Ib2d6a40e20faf12aa1c89c28180fd892e05624a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoCorrect wrong message 72/112172/2
Robert Varga [Sat, 15 Jun 2024 12:54:48 +0000 (14:54 +0200)]
Correct wrong message

It is the first modification which we do not cover, do not confuse the
two.

Change-Id: Ib7691da6596ee092c1a0f3c1e6594f2075ebb8be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoMake MutableTreeNode @NonNullByDefault 71/112171/2
Robert Varga [Sat, 15 Jun 2024 11:13:20 +0000 (13:13 +0200)]
Make MutableTreeNode @NonNullByDefault

Document what we are expecting, allowing broader use of annotations.

Change-Id: If84906ffcd9dc10095cd18c8fcf8d40df3ae521e
JIRA: YANGTOOLS-570
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClean up TreeNode API 64/112164/3
Robert Varga [Fri, 14 Jun 2024 12:27:33 +0000 (14:27 +0200)]
Clean up TreeNode API

Drop Identifiable<PathArgument>, as it has only two users. Drop 'get' prefix
from methods. 'mutable()' is now 'toMutable()'.

JIRA: YANGTOOLS-570
Change-Id: Ib8347e5450cc79a02693d13a674d7268e67b55c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClarify StoreTreeNode non-nulls 65/112165/1
Robert Varga [Fri, 14 Jun 2024 13:17:34 +0000 (15:17 +0200)]
Clarify StoreTreeNode non-nulls

Add explicit annotations to guide users and implementations.

Change-Id: I8806bc7316c3c2c22ea2e448743d66003b389e7b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImprove StatementDefinitionContext dispatch 54/112154/1
Robert Varga [Thu, 13 Jun 2024 22:29:59 +0000 (00:29 +0200)]
Improve StatementDefinitionContext dispatch

Use use arrows to eliminate the need for breaks.

Change-Id: I09d26b07ed27bcf4a996a438ee5fe48b8bda4a89
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize PotassiumDataOutput 51/112151/1
Robert Varga [Thu, 13 Jun 2024 19:18:50 +0000 (21:18 +0200)]
Modernize PotassiumDataOutput

Use switch expressions and local variable type inference to make things
clearer.

Change-Id: I5852b9b32ba3f4464929af4ab6b6a9237adab215
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse switch patterns in LeafrefSpecificationSupport 40/112140/1
Robert Varga [Thu, 13 Jun 2024 16:50:47 +0000 (18:50 +0200)]
Use switch patterns in LeafrefSpecificationSupport

We are looking for two specific statements, express that in a switch.

Change-Id: I7b117373a8edc21b0408ca32f01234b0e01743fd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize AbstractTypeStatementSupport 39/112139/1
Robert Varga [Thu, 13 Jun 2024 16:46:51 +0000 (18:46 +0200)]
Modernize AbstractTypeStatementSupport

Use patterns and switch expressions to make things more expressive.

Change-Id: I37e841a0053eda164f90d7eb294c3ca4da704a06
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize PathExpressionParser 38/112138/2
Robert Varga [Thu, 13 Jun 2024 16:24:41 +0000 (18:24 +0200)]
Modernize PathExpressionParser

Use instanceof patterns and switch expressions to improve compactness
and expresiveness.

Change-Id: Iebe447c7c5043a38a6d0ec3266f8b2dee968fa71
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize IfFeaturePredicateParser a bit 37/112137/2
Robert Varga [Thu, 13 Jun 2024 16:10:52 +0000 (18:10 +0200)]
Modernize IfFeaturePredicateParser a bit

Use multiline literals and switch expressions.

Change-Id: I378a15b4e5865b5a7a0b5ed47beea33341957c15
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse a instanceof pattern in EffectiveStmtUtils 36/112136/1
Robert Varga [Thu, 13 Jun 2024 16:04:54 +0000 (18:04 +0200)]
Use a instanceof pattern in EffectiveStmtUtils

We can remove an explicit cast with an instanceof pattern, let's do
that.

Change-Id: Ie0aeab70e35d2b5becf84b8cd5073c683aabe8fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse a switch expression in ArgumentContextUtils 35/112135/1
Robert Varga [Thu, 13 Jun 2024 16:02:37 +0000 (18:02 +0200)]
Use a switch expression in ArgumentContextUtils

We have exhaustive checking here, make sure we capture that through a
switch expression.

Change-Id: I12725e7ca6e3459ce724b04c31f3c70981c8e31e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse a switch expression in parsePredicate() 34/112134/2
Robert Varga [Thu, 13 Jun 2024 15:58:40 +0000 (17:58 +0200)]
Use a switch expression in parsePredicate()

This method matches three possible outcomes, let's use a switch
expression for that.

Change-Id: Ie96e825aacdf1d291529c85387a1d2cff2d1be4d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse a switch expression in DefaultYangParser 33/112133/1
Robert Varga [Thu, 13 Jun 2024 15:53:42 +0000 (17:53 +0200)]
Use a switch expression in DefaultYangParser

We have a type-based dispatch, use a switch expression for that.

Change-Id: Iafe2db887b81308d0ced6316052c605603f829b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse a switch expressions in StatementContextBase 32/112132/1
Robert Varga [Thu, 13 Jun 2024 15:14:53 +0000 (17:14 +0200)]
Use a switch expressions in StatementContextBase

We have a few opportunities to use switch expression, make sure we take
advantage of them.

Change-Id: Ic8395bba4ffde357edc9eb97780544bc30f9c9be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse switch expressions in StatementOutputV1 31/112131/1
Robert Varga [Thu, 13 Jun 2024 15:05:23 +0000 (17:05 +0200)]
Use switch expressions in StatementOutputV1

We are dispatching over a sealed hierarchy. Use switches with patterns
to eliminate error paths.

Change-Id: I991987ecfce5efb6e5507714e69f85f945759fe6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse a switch expression in DerivedTypes 30/112130/1
Robert Varga [Thu, 13 Jun 2024 14:56:54 +0000 (16:56 +0200)]
Use a switch expression in DerivedTypes

Turn the if/else/instanceof cascade into a switch expression with
pattern matching.

Change-Id: Idc1fef755ad5fe2b5af2b71225a026c157970e94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse a switch pattern in TypedefEffectiveStatementImpl 29/112129/1
Robert Varga [Thu, 13 Jun 2024 14:46:59 +0000 (16:46 +0200)]
Use a switch pattern in TypedefEffectiveStatementImpl

We have a type-based dispatch cascade, migrate to using a simple switch
with patterns.

Change-Id: Ifbf42898bb1efdb46f8f217bda342b1a3fc36fc9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse switch expressions in EffectiveStatements 27/112127/1
Robert Varga [Thu, 13 Jun 2024 14:40:45 +0000 (16:40 +0200)]
Use switch expressions in EffectiveStatements

Rather than doing if/else/instanceof, use switch expressions to match
arguments.

Change-Id: I2e6386ed77a4975051614d5fef0c558c264949dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse switch expressions in ConcreteTypes 25/112125/5
Robert Varga [Thu, 13 Jun 2024 11:43:25 +0000 (13:43 +0200)]
Use switch expressions in ConcreteTypes

We have a few type-based dispatches, use pattern switches for the same
task.

Change-Id: I4d0394226cd3add43707b95e27ad64dde14bbcc4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize MutableOffsetMap 17/112117/9
Robert Varga [Wed, 12 Jun 2024 19:53:02 +0000 (21:53 +0200)]
Modernize MutableOffsetMap

Use switch expressions with patterns and local variable type inference
to make things a tad more compact.

Change-Id: I9f03a9dfe450877d3878a49406ef61481b4646b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize ImmutableOffsetMap 15/112115/9
Robert Varga [Wed, 12 Jun 2024 19:28:13 +0000 (21:28 +0200)]
Modernize ImmutableOffsetMap

Use local variable type inference and patterns to make the code a tad
more compact.

Change-Id: Ia019da40c3c79349ba6daa592e3e3e75cbfea7ce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize MapAdaptor 16/112116/8
Robert Varga [Wed, 12 Jun 2024 19:42:35 +0000 (21:42 +0200)]
Modernize MapAdaptor

Use local variable type inference and switch with patterns.

Change-Id: Id93504a60dfda64e2683a6bdda4c5e9c74ce68b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse switch expressions in yang-data-util 26/112126/2
Robert Varga [Thu, 13 Jun 2024 11:45:31 +0000 (13:45 +0200)]
Use switch expressions in yang-data-util

We have a number of type-based dispatches using if/else/instanceof.
Convert these to switch statements/expressions with patterns for better
expressiveness.

Change-Id: I81c1c080483d693a6c3be37490a23c9d858c0d5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize NumberUtil a bit 24/112124/2
Robert Varga [Thu, 13 Jun 2024 11:42:24 +0000 (13:42 +0200)]
Modernize NumberUtil a bit

Use switch expressions to make our intent more explicit and compact.

Change-Id: I62c12ce4435d50b7ed92ef3ee12b39db36d2fa72
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse a switch expression in StatementPrefixResolver 23/112123/2
Robert Varga [Thu, 13 Jun 2024 11:40:21 +0000 (13:40 +0200)]
Use a switch expression in StatementPrefixResolver

We handle only two cases, make sure we express that in an exhaustive
switch.

Change-Id: Ib62d970ad785f166ca57f1c76ce0b35a8f53412f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse switch expressions in IfFeatureExpr 22/112122/2
Robert Varga [Thu, 13 Jun 2024 11:38:59 +0000 (13:38 +0200)]
Use switch expressions in IfFeatureExpr

We are dealing with a sealed class hierarchy, use switch with pattern
to ensure they are exhaustive.

Change-Id: Ide8de6358247f4e72f466061bd7878ab263a66b6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSharedSingletonMap is a SequencedMap 21/112121/2
Robert Varga [Thu, 13 Jun 2024 11:31:54 +0000 (13:31 +0200)]
SharedSingletonMap is a SequencedMap

We do not need a custom method to access the single element, as we can
expose it via SequencedMap.firstEntry().

Change-Id: I35d338d3755c883097a9a5cb0bde04ebb0fa2ccf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoPromote SingletonSet to a SequencedSet 00/112100/5
Robert Varga [Wed, 12 Jun 2024 11:21:20 +0000 (13:21 +0200)]
Promote SingletonSet to a SequencedSet

Java 21 allows us to neatly access the singleton value via
getFirst()/getLast() -- providing a well-known interface.

Change-Id: I479e0ec8b653d6ab09c1e3e37356019962cb022b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize SchemaInferenceStack 20/112120/3
Robert Varga [Wed, 12 Jun 2024 21:40:10 +0000 (23:40 +0200)]
Modernize SchemaInferenceStack

Use switch expressions with patterns where convenient, making things a
tad more compact.

Change-Id: I34ad527c09e43d1b1b3f084b5eb09bc1ff8d521e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize yang-data-spi a bit 19/112119/3
Robert Varga [Wed, 12 Jun 2024 21:26:52 +0000 (23:26 +0200)]
Modernize yang-data-spi a bit

Use switch expressions with patterns to make things a tad more compact
and expressive.

Change-Id: If0303adb759f3cbf4d12fdcd456db7d986fb865c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize yang-data-tree-ri 18/112118/2
Robert Varga [Wed, 12 Jun 2024 21:15:44 +0000 (23:15 +0200)]
Modernize yang-data-tree-ri

Use local variable type inference in more places.
Use patterns and switch expressions where convenient.

Change-Id: Iafe3ac1842adff3e6f8db3825a7e8a4397321585
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse switch with patterns in yang-data-codec-xml 14/112114/2
Robert Varga [Wed, 12 Jun 2024 18:41:27 +0000 (20:41 +0200)]
Use switch with patterns in yang-data-codec-xml

We have a number of places where we dispatch based on type. Use switch
statements/expressions with pattern match instead of if/else cascades.

Change-Id: Ibf3511f75f14e21c3b83d998701bbeb33d07c560
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoUse a switch expression in TypeDefinitionAwareCodec 13/112113/1
Robert Varga [Wed, 12 Jun 2024 17:45:06 +0000 (19:45 +0200)]
Use a switch expression in TypeDefinitionAwareCodec

Rather than going through an instanceof if/else cascade, use a simple
switch expression with instanceof patterns.

Change-Id: I2451b7d9ea7e0850948bbe21fef2033953113015
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoModernize AntlrXPathParser 12/112112/1
Robert Varga [Wed, 12 Jun 2024 17:31:33 +0000 (19:31 +0200)]
Modernize AntlrXPathParser

Use local variable type inference and switch with patterns to make the
logic more concise.

Change-Id: I069abdd24b8ed764a08c8aed03109139b3658b45
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoUse switch with patterns in YangInstanceIdentifierWriter 11/112111/1
Robert Varga [Wed, 12 Jun 2024 17:18:57 +0000 (19:18 +0200)]
Use switch with patterns in YangInstanceIdentifierWriter

Do not use and if/else instanceof cascade, just switch with patterns.

Change-Id: Ic763d0a29ccbc8f1f877ff0958ec19c9760bacb4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoUse switch pattern in NormalizedNodePrettyTree 10/112110/1
Robert Varga [Wed, 12 Jun 2024 16:59:59 +0000 (18:59 +0200)]
Use switch pattern in NormalizedNodePrettyTree

Use a type dispatch on the node instead of the usual if/else cascade.

Change-Id: Id23d55cf9a8b99db683f737cb5b37054957fb119
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoUse switch with patterns in NormalizedNodeWriter 09/112109/2
Robert Varga [Wed, 12 Jun 2024 16:51:05 +0000 (18:51 +0200)]
Use switch with patterns in NormalizedNodeWriter

Instead if/else cascade of instanceof checks, use a switch with pattern
matching to dispatch.

Change-Id: Ide0cee6168ea419f4584e4dc0074a27acf3fe44f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoUse pattern match in PotassiumDataOutput.writePathArgumentInternal() 08/112108/2
Robert Varga [Wed, 12 Jun 2024 16:29:04 +0000 (18:29 +0200)]
Use pattern match in PotassiumDataOutput.writePathArgumentInternal()

Using a switch with patterns guarantees exhaustiveness and is more
readable.

Change-Id: I2afeff389d6b9a68ba6f3bc903a6ebbbe4ca493b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoUse pattern matching in PotassiumDataOutput.writeObject() 07/112107/2
Robert Varga [Wed, 12 Jun 2024 16:19:35 +0000 (18:19 +0200)]
Use pattern matching in PotassiumDataOutput.writeObject()

Rather than having an if/else cascade, use a switch with pattern
matching to dispatch on value type.

Change-Id: I801739b9f138cefe8272d6634532d9854c78469c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoUse patterns in InstanceIdentifierJSONCodec 03/112103/2
Robert Varga [Wed, 12 Jun 2024 12:01:57 +0000 (14:01 +0200)]
Use patterns in InstanceIdentifierJSONCodec

Rather that doing an if/else cascade, use a switch with instanceof
patterns to dispatch.

Change-Id: I361dba4acfc18265bef9463121ad46cdb4ad4aa9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoUse pattern match in JsonParserStream 02/112102/2
Robert Varga [Wed, 12 Jun 2024 12:00:58 +0000 (14:00 +0200)]
Use pattern match in JsonParserStream

Rather than doing an if/else, use a switch with patterns to adapt the
parent node.

Change-Id: I69791ccb2441a1a3d3ff6f50e086dd4955734d3e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoAdopt odlparent-14.0.0-SNAPSHOT 90/111890/5
Robert Varga [Tue, 28 May 2024 17:08:11 +0000 (19:08 +0200)]
Adopt odlparent-14.0.0-SNAPSHOT

odlparent-14 allows us to target Java 21. This patch adopts a snapshot
version to allow us to deliver subsequent changes.

Change-Id: Ida26a3e50b3d27bd9c10fed06f9d610ad85f8b36
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoRemove SourceIdentifier.LOG 96/112096/1
Robert Varga [Wed, 12 Jun 2024 09:44:19 +0000 (11:44 +0200)]
Remove SourceIdentifier.LOG

This field is not used anywhere, remove it.

Change-Id: I913c1ad5e1e1d93312d6566694fca8c7ccd287b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoCentralize 'cannot interpret' 64/112064/1
Robert Varga [Mon, 10 Jun 2024 10:54:09 +0000 (12:54 +0200)]
Centralize 'cannot interpret'

Sonar is complaining about duplicates, centralize exception allocation
to keep it happy.

Change-Id: If383e924561a9b9c41d9f90593369008d4495758
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoCentralize unexpect token literal 63/112063/1
Robert Varga [Mon, 10 Jun 2024 10:53:28 +0000 (12:53 +0200)]
Centralize unexpect token literal

Sonar complains about duplication, centralize allocation.

Change-Id: Ia1fc1b5cc8dd71c3fd5358b1dde7d31993c2037f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoCentralize 'unsupported original' IAE 62/112062/1
Robert Varga [Mon, 10 Jun 2024 10:43:10 +0000 (12:43 +0200)]
Centralize 'unsupported original' IAE

Sonar complains about literal duplication, let's fix that by using a
dedicated method for IAE allocation.

Change-Id: I2ceac05839c0e43c25c898d2643a0244c65174d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoCentralize IAE message 61/112061/1
Robert Varga [Mon, 10 Jun 2024 10:38:33 +0000 (12:38 +0200)]
Centralize IAE message

Sonar is complaining about us using the same literal three times. Fix
that by allocating the exception in a dedicated method.

Change-Id: I5636943c75fbc0b8e6bea7b069485c724e150973
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoYet another round of Sonar issue fixes 59/112059/1
Robert Varga [Mon, 10 Jun 2024 10:33:41 +0000 (12:33 +0200)]
Yet another round of Sonar issue fixes

Fix more unused throws declarations and unused variables.

Change-Id: I17d6c584e761347bb2098c2bd2ddbbe9fd1c337d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoAnother round of Sonar warnings fixes 56/112056/2
Robert Varga [Mon, 10 Jun 2024 09:07:06 +0000 (11:07 +0200)]
Another round of Sonar warnings fixes

Eliminate unused exception declarations.

Change-Id: I951e0911e754d3e7e455938b276c473a598cbc62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoClean up more Sonar warnings 83/111983/2
Robert Varga [Tue, 4 Jun 2024 14:21:11 +0000 (16:21 +0200)]
Clean up more Sonar warnings

This removes unused exception throws and similar minor complaints.

Change-Id: Idf43b899700e875f164c3a8e763b0c82c47664de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoRemove unused throws declarations 80/111980/2
Robert Varga [Tue, 4 Jun 2024 13:09:31 +0000 (15:09 +0200)]
Remove unused throws declarations

SonarCloud is reporting a ton of unused throws declarations. This patch
makes a dent in them.

Change-Id: Iff2e75a2126dfb3b63a72401688c9ed50631f197
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoRemove ContainerSchemaNodes 79/111979/2
Robert Varga [Tue, 4 Jun 2024 12:46:04 +0000 (14:46 +0200)]
Remove ContainerSchemaNodes

This class has been deprecated for quite some time, with replacements
directly integrated into {Notification,Operation}Definition. Remove it
now.

Change-Id: I576e5c8f129038219b091f98415d08a7d694fe6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoRemove deprecated YangVersion methods 78/111978/2
Robert Varga [Tue, 4 Jun 2024 12:36:10 +0000 (14:36 +0200)]
Remove deprecated YangVersion methods

Both parse() and getReference() have been deprecated since
yangtools-11.0.0. Remove them now.

Change-Id: Ifd2ddf31f529026cae571ad73c51403fe313aa23
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoRemove Revision.Proxy 77/111977/1
Robert Varga [Tue, 4 Jun 2024 12:34:10 +0000 (14:34 +0200)]
Remove Revision.Proxy

This is the legacy serialization proxy, which has been superseded in
last major release. This patch removes it.

Change-Id: I880ea5cdac71668fac82c53742c38463ad0ae331
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoRemove deprecated QNameModule methods 87/103387/3
Robert Varga [Tue, 4 Jun 2024 12:32:55 +0000 (14:32 +0200)]
Remove deprecated QNameModule methods

We have a number for deprecated .create() methods, remove them.

Change-Id: I61c5c8b38037abb3b80e922498c3329d97c951e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoRemove ListenerRegistration and ListenerRegistry 28/109228/2
Robert Varga [Fri, 8 Dec 2023 16:39:50 +0000 (17:39 +0100)]
Remove ListenerRegistration and ListenerRegistry

This interface has been deprecated. ListenerRegistry has been replaced
with ObjectRegistry.

Remove both these classes and all of the supporting scenery.

JIRA: YANGTOOLS-1552
Change-Id: Ie583ce23c5bd645845ea979b047731ad82ab43f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoRemove Listener{Registration,Registry} and related classes 41/111941/2
Robert Varga [Mon, 3 Jun 2024 16:45:32 +0000 (18:45 +0200)]
Remove Listener{Registration,Registry} and related classes

ListenerRegistration has tight coupling to EventListener, which we are
not using anywhere. Remove this interface along with its
implementations.

ListenerRegistry relies on it, but has a more powerful replacement in
ObjectRegistry, so we remove that as well.

JIRA: YANGTOOLS-1552
Change-Id: Iba4da09f4a76615c643b266fc293e5f99afb4204
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoSpecialize JSONCodec to JSONValueWriter 75/111175/6
Robert Varga [Tue, 2 Apr 2024 08:56:42 +0000 (10:56 +0200)]
Specialize JSONCodec to JSONValueWriter

Completely disconnect JSONCodec from JsonWriter, eliminating the
deprecated method.

JIRA: YANGTOOLS-1568
Change-Id: I41f7426a11e76e90d717a898dfc916141e05ebf4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoSpecialize JSONCodec to Void input 60/111160/4
Robert Varga [Mon, 1 Apr 2024 18:36:39 +0000 (20:36 +0200)]
Specialize JSONCodec to Void input

We do not take any input, not some vague Object. Specialize to
java.lang.Void, of which there is only the null instance.

JIRA: YANGTOOLS-1568
Change-Id: Ia7cda3f485b07d56b9986f689635fbcca1025a65
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoRemove UnknownTypeDefinition 50/111250/2
Robert Varga [Thu, 4 Apr 2024 00:47:24 +0000 (02:47 +0200)]
Remove UnknownTypeDefinition

This type is not really used anywhere, remove all references to it.

Change-Id: If2ae1b89144419adf1115235e840145169f40392
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoBump versions to 14.0.0-SNAPSHOT 33/111933/1
Robert Varga [Mon, 3 Jun 2024 15:16:32 +0000 (17:16 +0200)]
Bump versions to 14.0.0-SNAPSHOT

This starts the next major development iteration.

Change-Id: I716788d312e1b1240f7861a59646c4333373992e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoBump versions to 13.0.7-SNAPSHOT 32/111932/1
Robert Varga [Mon, 3 Jun 2024 15:15:37 +0000 (17:15 +0200)]
Bump versions to 13.0.7-SNAPSHOT

This starts the next development iteration.

Change-Id: I93fea828d23b4038b7700a0f949d4fa5920aebe9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoRelease yangtools v13.0.6
jenkins-releng [Mon, 3 Jun 2024 14:03:05 +0000 (14:03 +0000)]
Release yangtools

4 weeks agoRework antlr suppression 23/111923/3
Robert Varga [Mon, 3 Jun 2024 09:08:27 +0000 (11:08 +0200)]
Rework antlr suppression

We can now exclude packages from analysis, use that facility instead of
a @SuppressFBWarnings.

Change-Id: I37ce23351b29f0370658f7e52c032ffbeb635f5a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 weeks agoMigrate model-* artifacts to bnd-parent 22/111922/2
Robert Varga [Mon, 3 Jun 2024 07:05:50 +0000 (09:05 +0200)]
Migrate model-* artifacts to bnd-parent

Ditch the use bundle-parent in model/*, resulting in fewer warnings and
better metadata.

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