yangtools.git
3 months agoBUG-2062: handle ordered leaf-lists
Robert Varga [Fri, 8 Jan 2016 08:11:07 +0000 (09:11 +0100)]
BUG-2062: handle ordered leaf-lists

This is forward-port on the Lithium fix, migrated to the mdsal project.

Change-Id: I46d94c281b904125fecb9636e513daa0c65c93cf
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoRevert "Bug 4647: Binding Codec does not provide leaf default value for identityref"
Robert Varga [Mon, 4 Jan 2016 16:06:20 +0000 (16:06 +0000)]
Revert "Bug 4647: Binding Codec does not provide leaf default value for identityref"

This reverts commit da4afea7aaa8845c80827a3eab032172c6971009.

With this change SFC fails, as the default value has to be resolved as a prefix.

Change-Id: I19a5bd258579eee400d9d8700563d69b7898d689
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoBug 4647: Binding Codec does not provide leaf default value for identityref
Igor Foltin [Tue, 22 Dec 2015 07:25:29 +0000 (08:25 +0100)]
Bug 4647: Binding Codec does not provide leaf default value for identityref

Fixed handling of leaf default value for identityref type.

Also removed obsolete code.

Change-Id: Id442f25512f445e0fff5c9e9aef314813e2c35d4
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
3 months agoBUG-4764: resolve serializer body before javassist callout
Robert Varga [Wed, 16 Dec 2015 15:08:50 +0000 (16:08 +0100)]
BUG-4764: resolve serializer body before javassist callout

This moves the body generation phase out of the javassist lock, so that
it can perform cache lookups without the risk of hitting an AB-BA
deadlock.

Change-Id: I40d0237fef100f90bed9e91e3825a4121e4c503d
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoBUG-4743: fix setters for generated classes
Robert Varga [Wed, 9 Dec 2015 00:55:40 +0000 (01:55 +0100)]
BUG-4743: fix setters for generated classes

Generated classes enforce restrictions in their constructors. Builders
should not generate checkers which duplicates these while setting the
value.

Change-Id: I7467a91e5c229bccbac00950294576fc60ce2622
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
3 months agoCleanup builder enforcement
Robert Varga [Tue, 8 Dec 2015 22:56:54 +0000 (23:56 +0100)]
Cleanup builder enforcement

A more natural place for generating these is with the setters which call
them. Move generation to generateSetters().

Also make setters' arguments final.

Also colocate length enforcement with range enforcement and eliminate a
superfluous empty if() block.

Change-Id: I0e844879f47527d692e148485157ef61db215862
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
3 months agoSwitch from QName#cachedReference() to QName#intern()
Robert Varga [Tue, 1 Dec 2015 14:43:48 +0000 (15:43 +0100)]
Switch from QName#cachedReference() to QName#intern()

cachedReference() has been deprecated, use intern() instead.

Change-Id: Ie38f30f528fbfc4119bc10637902f43db4c09da8
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoBUG-4638: fix UnionTypeCodec
Robert Varga [Sat, 21 Nov 2015 17:59:03 +0000 (18:59 +0100)]
BUG-4638: fix UnionTypeCodec

The codec should be checking for UnionTypeDefinition, not UnionType.

Change-Id: I6a4ca9070c068451d16008c6b258d212319d363e
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
3 months agoBug 4648: Use interface instead of implementation class.
Tony Tkacik [Fri, 20 Nov 2015 10:05:15 +0000 (11:05 +0100)]
Bug 4648: Use interface instead of implementation class.

Change-Id: Ie38bf629d962e35df81fb831027e1341eaba61b2
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
3 months agoFixed NPE in LeafNodeCodecContext.domValueFromString
Tony Tkacik [Wed, 18 Nov 2015 15:01:36 +0000 (16:01 +0100)]
Fixed NPE in LeafNodeCodecContext.domValueFromString

Change-Id: I089efca778430fd04a53de6e5a025564317acd62
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
3 months agoBug 4322: return default valued-object
Igor Foltin [Wed, 18 Nov 2015 09:54:26 +0000 (10:54 +0100)]
Bug 4322: return default valued-object

Fixed the problem with BitsCodec.deserialize
which was reported after merging following patch
https://git.opendaylight.org/gerrit/#/c/28251/

Fixed up tests to reflect fix of Bug 4645 in YangTools.

Change-Id: I59e76c82c1923f33caebf9b3dc7bbbff47505930
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
3 months agoBUG-4322: return default valued-object
Igor Foltin [Tue, 3 Nov 2015 07:17:56 +0000 (08:17 +0100)]
BUG-4322: return default valued-object

This patch modifies DataObjectCodecContext to return a default value
generated from the 'default' statement when a request is made for a
field which is not present in NormalizedNodes.

That has the effect of leaves with default value being seen as set to
the default value.

Added unit tests.

Change-Id: I99c97d796a9b32557955c4b0bd95d0051ab56f5c
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
3 months agoBug 4360: Removed incorrect precondition for class nesting.
Tony Tkacik [Thu, 12 Nov 2015 14:21:48 +0000 (15:21 +0100)]
Bug 4360: Removed incorrect precondition for class nesting.

Change-Id: I665c89934872f0685d594631d0e81db4a4413284
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
3 months agoGenerate sources to target/generated-classes/mdsal-binding
Tony Tkacik [Wed, 23 Sep 2015 09:33:21 +0000 (11:33 +0200)]
Generate sources to target/generated-classes/mdsal-binding

Change-Id: Ibb49339b58d7fee5f2b301a2e71d9500d893d923
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
3 months agoRevert "Bug 1672: Generated javadoc contains symbols of javadoc comment tags"
Robert Varga [Tue, 10 Nov 2015 18:19:50 +0000 (18:19 +0000)]
Revert "Bug 1672: Generated javadoc contains symbols of javadoc comment tags"

This reverts commit ca10c625cb7c311ec957876218f10540875a9eea, as it looks like it broke controller.

Change-Id: I679ae4dac8bdf5a838ad8babfcf451958fbda904
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoBug 1672: Generated javadoc contains
Igor Foltin [Mon, 28 Sep 2015 14:08:43 +0000 (16:08 +0200)]
Bug 1672: Generated javadoc contains
symbols of javadoc comment tags

Fixed encoding of html tags
and yang description in generated
javadoc comments.

Change-Id: Ic0512287345bc633c36325217e89aa9726a4056b
Signed-off-by: Igor Foltin <igor.foltin@pantheon.sk>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
3 months agoFix for unknown statements used without prefix
Martin Ciglan [Wed, 4 Nov 2015 10:36:18 +0000 (11:36 +0100)]
Fix for unknown statements used without prefix
in tested YANG models.

Change-Id: I4d40be3785320a7d1be66fb5b77f25171998fc89
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
3 months agoUpgrade upstream versions
Stephen Kitt [Thu, 1 Oct 2015 08:06:17 +0000 (10:06 +0200)]
Upgrade upstream versions

Where possible rely on odlparent:
* maven.javadoc.version
* xmlunit
* javassist
* xml-apis
* osgi-core
* javax.ws.rs-api
* reporting configuration

Update the following dependencies:
* maven-verifier 1.5 -> 1.6
* groovy 2.1.6 -> 2.4.5
* maven-core, maven-plugin-api 3.1.1 -> 3.3.3
* xtend 2.7.3 -> 2.8.4
* jersey-client 2.0 -> 2.22
* com.lmax:disruptor 3.3.0 -> 3.3.2
* build-helper-maven-plugin 1.8 -> 1.9.1
* plexus-container-default 1.5.6 -> 1.6

Drop equinoxSDK381:org.eclipse.osgi which appears to no longer be
necessary.

Change-Id: Ia97ee869f0018ea4c1a14352f11c8898fe0968eb
Signed-off-by: Stephen Kitt <skitt@redhat.com>
3 months agoUse Objects.hashCode()/equals() in generated DTOs
Robert Varga [Sat, 10 Oct 2015 13:22:12 +0000 (15:22 +0200)]
Use Objects.hashCode()/equals() in generated DTOs

Using java.util.Objects reduces complexity of generated code, leading to
leaner class files.

Change-Id: I941ede7cf9f60a9372864048bccdbb1650d2f5cf
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
3 months agoRemove default BindingGeneratorImpl constructor
Robert Varga [Tue, 29 Sep 2015 18:57:43 +0000 (20:57 +0200)]
Remove default BindingGeneratorImpl constructor

The default verbose constructor has been deprecated in Lithium, remove
it.

Change-Id: Ib54981b117ea1557138ab1820f6f41b7766973cc
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoFix various eclipse warnings
Robert Varga [Tue, 29 Sep 2015 19:07:48 +0000 (21:07 +0200)]
Fix various eclipse warnings

Raw types and method which could be static.

Change-Id: I19dcd742674944877f4b7b53d11068f630c826db
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoCleanup whitespace/formatting in codecs
Robert Varga [Sat, 10 Oct 2015 17:05:21 +0000 (19:05 +0200)]
Cleanup whitespace/formatting in codecs

This is a drive-by cleanup of whitespace.

Change-Id: Ib691ab3a04ee25938d4c1bd670ae62a01162565a
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
3 months agoModuleInfoBackedContext uses YangTextSchemaResolver.
Tony Tkacik [Tue, 6 Oct 2015 16:19:21 +0000 (18:19 +0200)]
ModuleInfoBackedContext uses YangTextSchemaResolver.

This removes locking from ModuleInfoBackedContext
and improves perforamance characteristic during
access from multiple threads.

Change-Id: I8c6c3d228fcdb384761185f5347cde284490fbde
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
3 months agoBug 3670 (part 4/5 - mdsal): Use of new statement parser in yang-maven-plugin
Peter Kajsa [Mon, 21 Sep 2015 13:04:18 +0000 (15:04 +0200)]
Bug 3670 (part 4/5 - mdsal): Use of new statement parser in yang-maven-plugin

Parser switch in mdsal:
- parser switch in ModuleInfoBackedContext

Yangtools retest:
- BUG-1485: remove deprecated range methods
- Mockito bug fix
- binding-generator-impl unit test switch to new statement parser
- null pointer in BindingGeneratorImpl fix

Change-Id: Iab1e130f29b98db95f842b2628b2a280f3cf26e0
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
3 months agoIntern package names
Robert Varga [Mon, 28 Sep 2015 21:02:51 +0000 (23:02 +0200)]
Intern package names

Analysis of a heap dump has shown that we are ending up with a lot of
duplicate strings containing generate Java code package names.
Instantiate an interner which normalize these to a single instance.

Change-Id: Id6faa0474ee5fe9417732a08ba6027f7e68fb5d2
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoDo not store code snippets in BindingRuntimeContext
Robert Varga [Mon, 28 Sep 2015 20:29:22 +0000 (22:29 +0200)]
Do not store code snippets in BindingRuntimeContext

Analysis of a heap dump shows we retain a fair amount of strings which
represent the QNAME member of generated classes via ConstantImpl. This
should not be happening, as the logic to create QNames in generated
classes should be part of the templates and only emitted to source code.

Teach ClassTemplate how to generate QName constants and only store the
QName in the Constant, saving the overhead of Strings.

Change-Id: I41951f969e273bc2ef4527ef3d95d4bed45c1b7f
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoUse Objects.equals()
Robert Varga [Sun, 27 Sep 2015 16:55:01 +0000 (18:55 +0200)]
Use Objects.equals()

This simplifies implementations of equals() method.

Change-Id: Ib58c7417607f85224ab6d452dab2a8aac604c055
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoUse Objects.hashCode()
Robert Varga [Sun, 27 Sep 2015 13:27:55 +0000 (15:27 +0200)]
Use Objects.hashCode()

Instead of open0-coded conditionals, use the utility method, hence
making our code more linear.

Change-Id: I2fcfef8982aebe8e2c81bf8145fb35255591d688
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoBug 4301: Incorrect union generated code when using decimal64
Martin Ciglan [Tue, 22 Sep 2015 12:51:25 +0000 (14:51 +0200)]
Bug 4301: Incorrect union generated code when using decimal64

Binding Java API Generator shouldn't generate getValue() method
for java.math BigDecimal & BigInteger types, representing
YANG decimal64 & uint64 types.

This is just a port from yangtools.

Change-Id: I8f50003296d1004f9799c96950f49b4a38732137
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
3 months agoFix duplicate artifact inclusion
Robert Varga [Mon, 7 Sep 2015 12:17:27 +0000 (14:17 +0200)]
Fix duplicate artifact inclusion

Duplicate dependency is triggering a maven warning, remove it.

Change-Id: Ia38455e648f8fd8fc8eb98aec5e5313be11ebbdf
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoBUG-4264: do not duplicate strings needlessly
Robert Varga [Sat, 5 Sep 2015 19:10:54 +0000 (21:10 +0200)]
BUG-4264: do not duplicate strings needlessly

This patch adds safeguards for string transformation methods to check if
the result is the same as input. This should address the string
duplication issues.

Change-Id: Ib225745ce35b492997edc60abd1abb3e41032795
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoAdd mdsal-model-artifacts to binding-parent
Florin Coras [Thu, 10 Sep 2015 16:33:44 +0000 (18:33 +0200)]
Add mdsal-model-artifacts to binding-parent

Given the migration to use the MD-SAL project, dependencies like
ietf-inet-types and ietf-yang-types are now imported via
org.opendaylight.mdsal.model instead of org.opendaylight.yangtools.model
groupId. However, the dependency management section of the
binding-parent does not include mdsal-model-artifacts, where the
previously mentioned artifacts are declared. This breaks imports in
bundles inheriting from binding-parent.

Change-Id: Id19c36862f8ab8bbfa70f8a538619070cf8814d7
Signed-off-by: Florin Coras <fcoras@cisco.com>
3 months agoUse NodeIdentifier.create()
Robert Varga [Fri, 4 Sep 2015 00:01:38 +0000 (02:01 +0200)]
Use NodeIdentifier.create()

Using create() results in reused instances, thus lowering memory
footprint.

Change-Id: If1a1a3c3c74567374093a76df6e00ed7110b4f1c
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoRemoved left-over dependencies to YANGTools models.
Tony Tkacik [Thu, 3 Sep 2015 10:09:04 +0000 (12:09 +0200)]
Removed left-over dependencies to YANGTools models.

Change-Id: I71a5e1a50038629abb627d1d5cf28a5d794918c8
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
3 months agoProvide a single-argument variant of firstKeyOf()
Stephen Kitt [Mon, 24 Aug 2015 13:28:22 +0000 (15:28 +0200)]
Provide a single-argument variant of firstKeyOf()

InstanceIdentifier::firstKeyOf() doesn't seem to need its second
argument, even for generic type resolution (even in Java 7). This
patch adds a variant with only the component type argument.

I'm not sure what the deprecation practices are so I haven't
deprecated the two-argument version.

Change-Id: I6d4822472db627519600f5f0828f3ebe632fc00b
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
3 months agoFixed Export-Package sections after rename.
Tony Tkacik [Wed, 26 Aug 2015 16:18:23 +0000 (18:18 +0200)]
Fixed Export-Package sections after rename.

Change-Id: I6b7fc00f53167d398bac35010fb03a81aa1f5912
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
3 months agoConverted model packaging from jar to bundle
Tony Tkacik [Wed, 26 Aug 2015 13:06:18 +0000 (15:06 +0200)]
Converted model packaging from jar to bundle

Change-Id: I0a6dae4ca90296b92a56c97cc5de2c6b081eed3f
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
3 months agoRenamed test packages to use org.opendaylight.mdsal
Tony Tkacik [Wed, 26 Aug 2015 09:40:24 +0000 (11:40 +0200)]
Renamed test packages to use org.opendaylight.mdsal

Change-Id: Ie3272a21a39328c363a8f278cd734cdd927c995b
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
3 months agoRenamed yangtools.binding.data.codec.api to mdsal.binding.data.codec.api
Tony Tkacik [Tue, 25 Aug 2015 10:47:56 +0000 (12:47 +0200)]
Renamed yangtools.binding.data.codec.api to mdsal.binding.data.codec.api

Change-Id: I071879001c0cdfb6040714ed7b5d6309b7961204
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
3 months agoMoved binding MD-SAL APIs to binding folder
Tony Tkacik [Fri, 21 Aug 2015 10:40:27 +0000 (12:40 +0200)]
Moved binding MD-SAL APIs to binding folder

Renamed artefacts:
  sal-binding-api to mdsal-binding-api
  sal-binding-broker to mdsal-binding-dom-adapter
  sal-binding-util to mdsal-binding-util

Removed deprecated Hydrogen and Helium interfaces
and adapters, since they still can be provided from
original location.

Change-Id: I0ebbfc2e927aa6c036e9be7ed216a48d970e66d0
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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

3 months 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

3 months 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

3 months 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

3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>