Jakub Toth [Thu, 28 Sep 2017 10:35:35 +0000 (12:35 +0200)]
Fix broken tests according to yangtools changes
* https://git.opendaylight.org/gerrit/#/c/62537/
* fixed methods of YangParserTestUtils for parsing yangs
and creating schema context
Change-Id: I313e91aeafd46c57d60aaf71372287bc84b8414a
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
Robert Varga [Mon, 4 Sep 2017 13:24:34 +0000 (15:24 +0200)]
Finish removal of yangtools classes
This finishes the package move by removing the bridge classes.
Change-Id: I7e5519db7be39e8fdb03c9f330ce77a0b6e982b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 21 Sep 2017 09:22:23 +0000 (11:22 +0200)]
Remove yangtools APIs
Downstream consumers are not using them anymore, remove them.
Change-Id: Idd9d8f6b2d1f7b3ab719904a694c342d2e79f210
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 4 Sep 2017 09:44:52 +0000 (11:44 +0200)]
Disconnect mdsal-bind-dom-codec yangtools/mdsal APIs
Remove compatibility bridging between the two APIs, so that users
do not pull in yangtools APIs in their imports.
Change-Id: If763721458354ba92422ac7465735714646f61d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 11 Sep 2017 17:09:46 +0000 (19:09 +0200)]
Eliminate use of String.replace/replaceAll()
Use a pre-compiled pattern to do the same task.
Change-Id: Ie864494a8c5a7b24a31d9d416b339b6f33eb5d42
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 4 Sep 2017 09:47:51 +0000 (11:47 +0200)]
Move mdsal-binding-dom codec classes
This moves most of the classes out of the way and leaves just two
proxies around.
Change-Id: I3d95bcd20f219208948a12433380c50735617916
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 5 Sep 2017 21:51:57 +0000 (23:51 +0200)]
Correct model revision
2017-16-05 is an invalid revision string, correct it to something
sane.
Change-Id: Ie2997888dd86ff94a89c4d0c0c6dc01f1ebe2290
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 5 Sep 2017 08:53:50 +0000 (10:53 +0200)]
Do not leak implementation class
For migration purposes we need to not leak the implementation
class from create methods. Fix them to return just the interface.
Change-Id: I801467d1a816dc1b0b1bd41ee4157c9593092544
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 17 Aug 2017 12:44:12 +0000 (14:44 +0200)]
Improve length constraint checks
If we have an unrestricted string/binary or the constraint is
satisfied by the combination of String/array length return
values and integer value domain, we can skip the checks altogether,
leading to less generated code.
Cuts down size of ietf-inet-types by 1%.
Change-Id: Ibd8ea57a4746e1332447dd5454b36407d066ea0a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Thanh Ha [Wed, 16 Aug 2017 15:17:13 +0000 (11:17 -0400)]
Update odlparent to 2.0.4
Change-Id: I9c91aee4fea8b4fbf5850d541a5f38d694da5d6d
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Mon, 14 Aug 2017 17:02:42 +0000 (13:02 -0400)]
Bump versions by x.(y+1).z for next dev cycle
Change-Id: Ie1d4a4800d2b8c38cc5520fcb5756a68972ca4d6
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Robert Varga [Fri, 4 Aug 2017 22:02:03 +0000 (00:02 +0200)]
Enforce no split packages
This augments Export-Package directives with a directive to emit
a hard error if a split package is encountered.
Change-Id: Ib763fb75021de510086f1c12563cef0f49e61f61
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 2 Aug 2017 12:13:52 +0000 (14:13 +0200)]
Address sonar warnings
Remove traling blank comments and declaration of runtime exceptions.
Change-Id: Ibe49a0b138a3266cd41603f17d3287d7fa93796a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Jakub Toth [Fri, 21 Jul 2017 09:58:08 +0000 (11:58 +0200)]
Bug 8449 - BindingToNormalizedNodeCodec fails to deserialize union of leafrefs
Fix problem of leafref in typedef called from union
*generated part
*generating of new property of GTO for leaf's union type of typedef
according to return type of referenced leaf via leafref from typedef
*codec part
*getting codec of leaf type according to new generator part of leafref
in typedef
*tests
Change-Id: Ibffe4e51ef66f1911c32c71d4f08bbdbdd40e234
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
Robert Varga [Wed, 12 Jul 2017 10:00:27 +0000 (12:00 +0200)]
Cleanup warnings
- static methods
- unneeded use of CheckedFuture and checkedGet()
- Throwables.propagateIfPossible()
- raw types
- unneeded else branches
Change-Id: Ie7cc7f701efad4de843cd2884ceea9caf8787e0a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 9 Jul 2017 17:14:30 +0000 (19:14 +0200)]
Bump odlparent references to 2.0.2
Automated bump to latest fix release.
Change-Id: Ibbbe6dc4d9c0df1e08135f1d496eb53963c9db93
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 3 Jul 2017 08:54:10 +0000 (10:54 +0200)]
Bump odlparent dependency to 2.0.1
Bumps odlparent to latest release.
Change-Id: I020a42720d43aabcaa6886230b79df27834a1b1c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 15 Jun 2017 13:04:39 +0000 (15:04 +0200)]
BUG-7446: Bump odlparent to 2.0.0
Fixup guava movement and features changing with 2.0.0.
Change-Id: Id0fbbf62872d22e3623d0a4ccf5bb86723601604
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Thanh Ha [Tue, 13 Jun 2017 18:39:24 +0000 (14:39 -0400)]
Migrate to odlparent 1.9.0
Change-Id: I100a35acd3f47c49cb7d93a972f6c01a4804b446
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Tue, 6 Jun 2017 02:13:13 +0000 (22:13 -0400)]
Migrate to odlparent 1.8.0-Carbon
Per request of odlparent project we are downgrading all Nitrogen
projects to use the released odlparent 1.8.0-Carbon to allow for the
odlparent project to start performing semver style releases.
Jira: RELENG-159
RT: 41406
Change-Id: Ica7007072c5f10e052c4aab6c46feb26e89c5915
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Robert Varga [Sat, 13 May 2017 18:25:24 +0000 (20:25 +0200)]
Cleanup binding-dom-codec generator
- use lambdas
- use fluent StringBuilder
- make methods static
This should improve codec generation slightly due to gains of
invoke_static vs. invoke_virtual and overall bytecode size diet.
Change-Id: Id8d3a442f63a452111907b7d683d2167dd489ca7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 11 May 2017 09:28:38 +0000 (11:28 +0200)]
BUG-8226: do not import nested classes
Importing a nested classes leads to a unused import warning, so compare
the declared package name with the class being generated and do not emit
an import declaration if the package name matches FQDN.
Change-Id: I4240cac663476c1405962631a9d173f5ed434ee9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 11 May 2017 09:04:22 +0000 (11:04 +0200)]
BUG-8226: fix toString() formatting
Fix closing curly brace offset.
Change-Id: I56d577387231a300dc508a8062f3aa07c861734a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 11 May 2017 07:56:15 +0000 (09:56 +0200)]
BUG-8226: fix augmentation argument overlap
This fixes a trivial warning of argument name shadowing the field
name.
Change-Id: Ie0cd8f010778e198db26102a6e42274a03aee118
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 11 May 2017 07:48:48 +0000 (09:48 +0200)]
BUG-8226: fix Enumeration.forValue() javadoc
Fix a missing description warning.
Change-Id: I26b1d0b01b56e6a3fb5d553decc4d109fc6f762c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 3 May 2017 11:21:54 +0000 (13:21 +0200)]
BUG-8360: add mdsal-binding-dom-codec-osgi
This is an OSGi binding producing all context needed required
to implement binding/dom/external serialization. It is similar
to how the config-manager service operates, except associated
services are explicitly covered instead of sneaking them through
properties.
Change-Id: I31f2bdb11153d6e514dacf2b070b073d768c1ff3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 13 Apr 2017 13:53:43 +0000 (15:53 +0200)]
BUG-8226: Add @Override to public methods
This adds proper @Override tags to methods specified by superclasses.
Change-Id: I82b387156dce366d480414b1ed0b889ca9858c24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
aff372df411044a8765e202aa5bc4481f35bc722)
Anil Belur [Tue, 11 Apr 2017 01:45:42 +0000 (11:45 +1000)]
Bump versions by x.(y+1).z for next dev cycle
Change-Id: Ia61eeda429f5e56629f70824dc156372557673e1
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
Robert Varga [Mon, 27 Mar 2017 17:42:17 +0000 (19:42 +0200)]
BUG-8004: handle implicit RPC input
RPC input is always defined implicitly, which is something we cannot
deal with in Binding Specification compatibly, as original generators
did not emit classes for such methods and implicitly map them to Void.
In order to deal with these, we need to recognize when an RPC input
is not declared and re-wire it to a null codec. This loses information,
but it is the best we can do (simply because there is no binding
representation).
Change-Id: I4edbcd0cc886396bdba79f4c0ccfd91ba3d6b2c7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Martin Ciglan [Fri, 10 Mar 2017 13:17:43 +0000 (14:17 +0100)]
Bug 6859: Binding generator v1 refactoring
- make sure package names differ between MDSAL Binding v1 submodules
after refactoring
Change-Id: I6f1def44682f28a00a79ac3c787eeaca5b6755d6
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
Jakub Toth [Thu, 9 Mar 2017 10:31:08 +0000 (11:31 +0100)]
Bug 7759 - TEST - Getter of BA object fails to construct class instance
Change-Id: Idfb3ceabe6808bcd9c421d189566f680f8f0077f
Signed-off-by: Jakub Toth <jatoth@cisco.com>
(cherry picked from commit
19c96f252c6a8b675851880e202dc6b7a767d6ca)
Jakub Toth [Wed, 22 Feb 2017 09:57:28 +0000 (10:57 +0100)]
Bug 6859 #5 Binding generator v1 refactoring
Based on transfer of Binding generator v1 from
Yangtools project to MDSAL in past, we need to finalize
this process by refactoring package naming:
org.opendaylight.yangtools -> org.mdsal.binding
org.opendaylight.yangtools.sal -> org.mdsal.binding
This refactoring is done in subsequent steps,
covering all necessary modules. Based on experience,
this should also help users to address possible Binding generator v1
issues in MDSAL project, not in Yangtools.
- maven-sal-api-gen-plugin module refactoring
Change-Id: I17bd25507894b8b5a42579ee317f5d5fd81f3f20
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Jakub Toth [Tue, 21 Feb 2017 12:09:44 +0000 (13:09 +0100)]
Bug 6859 #4 Binding generator v1 refactoring
Based on transfer of Binding generator v1 from
Yangtools project to MDSAL in past, we need to finalize
this process by refactoring package naming:
org.opendaylight.yangtools -> org.mdsal.binding
org.opendaylight.yangtools.sal -> org.mdsal.binding
This refactoring is done in subsequent steps,
covering all necessary modules. Based on experience,
this should also help users to address possible Binding generator v1
issues in MDSAL project, not in Yangtools.
- mdsal-binding-java-api-generator module refactoring
Change-Id: Ie898adf78ac9db7f094a26f8f41145c8c960fa62
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Jakub Toth [Tue, 21 Feb 2017 11:43:02 +0000 (12:43 +0100)]
Bug 6859 #3 Binding generator v1 refactoring
Based on transfer of Binding generator v1 from
Yangtools project to MDSAL in past, we need to finalize
this process by refactoring package naming:
org.opendaylight.yangtools -> org.mdsal.binding
org.opendaylight.yangtools.sal -> org.mdsal.binding
This refactoring is done in subsequent steps,
covering all necessary modules. Based on experience,
this should also help users to address possible Binding generator v1
issues in MDSAL project, not in Yangtools.
- mdsal-binding-generator-impl module refactoring
Change-Id: If3a7615d3c2870d02eae8767ca44bcb0981aaa99
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Jakub Toth [Tue, 21 Feb 2017 11:28:10 +0000 (12:28 +0100)]
Bug 6859 #2 Binding generator v1 refactoring
Based on transfer of Binding generator v1 from
Yangtools project to MDSAL in past, we need to finalize
this process by refactoring package naming:
org.opendaylight.yangtools -> org.mdsal.binding
org.opendaylight.yangtools.sal -> org.mdsal.binding
This refactoring is done in subsequent steps,
covering all necessary modules. Based on experience,
this should also help users to address possible Binding generator v1
issues in MDSAL project, not in Yangtools.
- mdsal-binding-generator-util module refactoring
Change-Id: I978e49a68458d08a9d397a1a2d4bcc455eea1a37
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Jakub Toth [Tue, 21 Feb 2017 11:02:34 +0000 (12:02 +0100)]
Bug 6859 #1 Binding generator v1 refactoring
Based on transfer of Binding generator v1 from
Yangtools project to MDSAL in past, we need to finalize
this process by refactoring package naming:
org.opendaylight.yangtools -> org.mdsal.binding
org.opendaylight.yangtools.sal -> org.mdsal.binding
This refactoring is done in subsequent steps,
covering all necessary modules. Based on experience,
this should also help users to address possible Binding generator v1
issues in MDSAL project, not in Yangtools.
- mdsal-binding-generator-api module refactoring
Change-Id: I11537d580c8df500b80104d158de6eef515afb1e
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Robert Varga [Tue, 28 Feb 2017 12:43:23 +0000 (13:43 +0100)]
Do not pull in yang-parser-impl
Parser is used only in tests and only via test-utils,
hence this project should not be pulling it in.
Change-Id: I336eda6effff373deea0f82f81643ac73e655e83
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 23 Feb 2017 16:38:51 +0000 (17:38 +0100)]
BUG-6315: use plugin-provided path resolution
Rather than relying on SourceStreamAware, make sure we use
the resolver provided by the plugin.
Change-Id: Ia5ec8a739e10bb262f68b2838958d5111e538263
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 23 Feb 2017 17:48:17 +0000 (18:48 +0100)]
Fix null comparison warnings
Xtend comparisons to null should be done via !==/===, fix offenders.
Change-Id: I4dff8e444104cca427843aa88a5df989b3fed77c
Signed-off-by: Robert Varga <rovarga@cisco.com>
Jakub Toth [Fri, 10 Feb 2017 10:04:32 +0000 (11:04 +0100)]
Fix generate of comma before augmentations in toString generator
Change-Id: Ibb4c19028b758c27126cc244a8657efbd46bc1b2
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Robert Varga [Thu, 2 Feb 2017 16:24:09 +0000 (17:24 +0100)]
Bug 3147 - Binding spec v1: auto generated code by YANGTOOLS could
be more efficient
*fix generating of commas in toString() for more effecient
*tests
Change-Id: I13b59c3c5be90446a9511a9cd46969850cb77595
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Lorand Jakab [Fri, 3 Feb 2017 15:08:46 +0000 (17:08 +0200)]
Checkstyle: fix ParenPad violations
Enforcing no space(s) after a left parenthesis and before a right
parenthesis is a proposed change [0] which can only be merged when all
violations are fixed in projects enforcing checkstyle. This patch fixes
those violations.
[0] https://git.opendaylight.org/gerrit/#/c/51316/
Change-Id: Iae1f085f903579a264b24176d0b4c17416f6b8a0
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Robert Varga [Thu, 2 Feb 2017 16:23:37 +0000 (17:23 +0100)]
Revert "Bug 3147 - Binding spec v1: auto generated code by YANGTOOLS could"
This reverts commit
8f5fa1cc26819073fd920fd4007ef309088304d7.
Change-Id: If322b38d32e759522800af099b42d649e1237cb7
Signed-off-by: Robert Varga <rovarga@cisco.com>
Xiao Liang [Wed, 11 Jan 2017 05:59:14 +0000 (05:59 +0000)]
Fix getValue() of bits in union
Call Arrays.toString instead of calling toString directly for bits in union,
since getValue() of bits returns boolean[].
Change-Id: I4b06c95f07ff6d5ff81dc17613ed972b453db184
Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
Jakub Toth [Fri, 23 Dec 2016 21:23:59 +0000 (22:23 +0100)]
Bug 3147 - Binding spec v1: auto generated code by YANGTOOLS could
be more efficient
*fix generating of commas in toString() for more effecient
*tests
Change-Id: I5a1ac0ad8068655168824d89a9acb1f203a64639
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Michael Vorburger [Mon, 23 Jan 2017 20:03:42 +0000 (21:03 +0100)]
Replace FindBugs :jsr305 by full :annotation (Bug 7663)
Change-Id: Ie91b52ee8c85ab42485588219f80ca74b125f148
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Vratko Polak [Thu, 5 Jan 2017 16:06:35 +0000 (17:06 +0100)]
Bug 7425: Recognize instance-identifier in union template
Previously, it was wrongly identified as a generated type,
but InstanceIdentifier is a base type, so no getValue() there.
Change-Id: I18d67357753eda6e241a608fc5a2c933aa1f9eda
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Martin Ciglan [Mon, 12 Dec 2016 10:20:55 +0000 (11:20 +0100)]
Bug 7159: Add yang-test-util artifact
- follow-up patch for MD-SAL
- bit of a code cleanup
Please see Yangtools introduction here:
https://git.opendaylight.org/gerrit/#/c/49129/
Change-Id: I91b2cb2e07245ce1f558ecf62a9a81a1d1ed2ebc
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
Martin Ciglan [Thu, 10 Nov 2016 10:36:26 +0000 (11:36 +0100)]
Bug 6163: fixed number of argument when resolving rpc input
- changed functionality of resolving rpc input. Input class is
resolved by it's assignability from DataContainer class
- quite a bit of cleanup, comments added
https://bugs.opendaylight.org/show_bug.cgi?id=6163
Change-Id: I4a7d05283951db280c3e92301590407da4f40ffa
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
Dana Kutenicsova [Thu, 13 Oct 2016 16:34:52 +0000 (18:34 +0200)]
Removed sonar warnings.
Change-Id: I2dbe2018cc1d2672f98fd3aea9e01c7d851eacc8
Signed-off-by: Dana Kutenicsova <dana.kutenics@gmail.com>
Martin Ciglan [Mon, 7 Nov 2016 13:27:54 +0000 (14:27 +0100)]
Bug 7064: yang-to-source error on description
Existing logic of formatToParagraph() method doesn't expect a case
when very first text sequence is longer than 80 characters
and crashes in wrong condition branch. This has been fixed and tested
for various inputs.
Change-Id: Iefeb2b4063335561f3277c3ee40b3d9a46c418dc
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
Michael Vorburger [Tue, 1 Nov 2016 20:43:32 +0000 (21:43 +0100)]
target-ide/ support by resourceBaseDir using ${project.build.directory}
without explicitly setting this,
org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
defaults to hard-coded target/generated-sources/spi for
META-INF/services/org.opendaylight.yangtools.yang.binding.YangModelBindingProvider
instead of target-ide.
Minor: Also add target-ide/ to .gitignore of this git repository.
Change-Id: I4155eb666dd6ef028dc2397e32c88cd50db4f0c6
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Robert Varga [Thu, 27 Oct 2016 10:33:43 +0000 (12:33 +0200)]
BUG-7013: do not rely on default character encoding
Generated java files should always be UTF8-encoded,
as that is what our maven settings enforce.
Therefore we cannot rely on JVM-default encoding, but
have to force file output to be UTF8.
Change-Id: Ie24f753fda3ab4d71ec951cf7b725b97678bae7a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Thu, 20 Oct 2016 00:17:33 +0000 (02:17 +0200)]
Replace target/ by ${project.build.directory}/ to make target-ide/ possible
Change-Id: I32c4c0e8207f58b864e21054d12174ad45dc0e7f
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Robert Varga [Sun, 23 Oct 2016 20:24:23 +0000 (22:24 +0200)]
BUG-7009: fix invalid model
The test model is not valid, as it specifies an extension
argument while the extension definition does not allow arguments.
Change-Id: I2bae1ee5eb3dcf4b98875001b2b4a46f2723601b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Nosal [Mon, 3 Oct 2016 09:22:44 +0000 (11:22 +0200)]
Bug 5947: additional tests for binding-dom-codec #9
Change-Id: Ib9a3bdf105d673be7c2d52be5c9f9cfcd63409fb
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
Peter Nosal [Thu, 29 Sep 2016 08:16:09 +0000 (10:16 +0200)]
Bug 5947: additional tests for dom-adapter #7
Change-Id: Ic970ea7bccda9d4f82901fa93c92508065de35a9
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Peter Nosal [Wed, 28 Sep 2016 06:43:57 +0000 (08:43 +0200)]
Bug 5947: additional tests for dom-adapter #6
Change-Id: If497e570342391c9d8aecf81bcd3cee24438f786
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Peter Nosal [Wed, 5 Oct 2016 10:12:36 +0000 (12:12 +0200)]
Fixed some problems with GeneratorUtil
Change-Id: If496bb149f755d17610c93c0e828123dc9bbde9d
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
Peter Nosal [Thu, 29 Sep 2016 10:43:15 +0000 (12:43 +0200)]
Bug 5947: additional tests for dom-adapter #8
Change-Id: I92113a82940b8e61a57638aba2ca71cf822de023
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
Robert Varga [Tue, 20 Sep 2016 17:04:40 +0000 (19:04 +0200)]
Cleanup pom.xml layout
This performs the long-overdue cleanup of build structure,
aligning it with ODL best pracitices and removing quite
a bit of crud in the process.
Change-Id: I04ac6a917928c1da286b8c4ec4e1c7cb66e9990b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 5 Sep 2016 14:41:37 +0000 (16:41 +0200)]
BUG-5561: retain SchemaContext order for bits
This patch reworks BitsCodec so it retains the bit order
defined in SchemaContext, which by extension means the values
coming from Binding objects should end up being sorted
by position.
Change-Id: Ice154dd7e38e6b213c281ddb492408f619e3a5f8
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 2 Sep 2016 14:46:52 +0000 (16:46 +0200)]
Use lambdas for functional interfaces
Makes the code more concise.
Change-Id: I6b3ed4ebefbd72b63958a0b4db98129a4e35e317
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 8 Jun 2016 17:09:17 +0000 (19:09 +0200)]
BUG-6028: check value types for encapsulation
This is a fast check to see if the argument matches expected
value class. If it does not it does not make sense to invoke
the serializer, as it will fail.
Change-Id: I4ca556fea057f2188fa1c34d303467565af38d5c
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Wed, 10 Aug 2016 09:22:15 +0000 (11:22 +0200)]
add target/generated-sources/spi & yang/ as resource folders
and remove src/main/yang as source folder
but obviously must keep Maven's default src/main/resources
(see https://lists.opendaylight.org/pipermail/release/2016-August/007788.html)
Bug: 6252
Change-Id: I66b5dcdebc88303fd2e3e25f16f5f362b135a13e
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Thanh Ha [Tue, 9 Aug 2016 18:52:15 +0000 (18:52 +0000)]
Revert "Add target/generated-sources/spi & yang/ as resource folders"
This reverts commit
43ca4269501ca68fbcdcd1a5296f508b44fb8226.
Change-Id: Id61db4aa7a915e6054060c63b6f681d9a3c45511
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Michael Vorburger [Tue, 26 Jul 2016 16:32:57 +0000 (18:32 +0200)]
Add target/generated-sources/spi & yang/ as resource folders
and remove src/main/yang as source folder
Bug: 6252
Change-Id: I5574716949d29b886855a233de1e0c005e4985eb
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Thanh Ha [Tue, 9 Aug 2016 13:27:25 +0000 (09:27 -0400)]
Bump ietf versions to ...10-SNAPSHOT
Bumping according to:
https://lists.opendaylight.org/pipermail/release/2016-August/007731.html
Change-Id: I2fc611f84c056ddea4a531d9e9e976ace3d4b557
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Mon, 8 Aug 2016 21:50:16 +0000 (17:50 -0400)]
Bump versions by 0.1.0 for next dev cycle
Change-Id: I661f05513feb495a1f1a47ffaeeb7fc6630bcd33
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Vratko Polak [Mon, 1 Aug 2016 15:15:46 +0000 (17:15 +0200)]
Bug 6165: Do not omit java.lang prefix in various places
Yang expression "typedef String" leads to java class String,
creating potential naming conflict with java.lang.String.
Few places places in EnumTemplate are fixed by using «String.importedName».
Also, YangModuleInfoTemplate#getExplicitType
no longer removes java.lang unconditionally.
+ Ifs against void are re-ordered to occur sooner in getExplicitType.
Change-Id: If014aca30875589e361733317dfb47eaa07df031
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Robert Varga [Fri, 5 Aug 2016 15:07:13 +0000 (17:07 +0200)]
Add PMD configuration
PMD does not allow specifying wildcards, hence we have to enrich
its configuration here.
Change-Id: I45b7b8618950ec43f3c03cc9e4ee9d3b714d14ee
Signed-off-by: Robert Varga <rovarga@cisco.com>
Vratko Polak [Mon, 1 Aug 2016 14:31:34 +0000 (16:31 +0200)]
Bug 6126: Use importedName for java.lang types in ClassTemplate
There may be a type definition in Yang, which generates class name
which are the same as a class name in java.lang.
This patch fixes the conflict at defaultInstance(),
there may be other places which need fixing.
Change-Id: I3a73b5bb284db031dbfd45468cbbb8dd2a354737
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Robert Varga [Tue, 19 Jul 2016 18:02:39 +0000 (20:02 +0200)]
BUG-6238: Remove char[]-based union instantiation path
Since we are iterating over the constituent types,
there is no need to fall back to string-based instantiation.
Change-Id: Ief17f444816d78d4266e82be3e359a5918213e6d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Nosal [Mon, 25 Jul 2016 12:50:16 +0000 (14:50 +0200)]
Bug 5947: refactored common-api tests
Change-Id: I3b138c524094fcd6c63c46493c8af42c5d0c0d5a
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
Vratko Polak [Mon, 11 Jul 2016 16:47:46 +0000 (18:47 +0200)]
Bug 6184: Workaround for namespaces with URL with trailing slash
Change-Id: I76712209a8d42825d9e8f6d8042877cec486c53f
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Vratko Polak [Mon, 4 Jul 2016 13:33:22 +0000 (15:33 +0200)]
Bug 2332: BindingMapping to camel split also on forward slash
This is only a partial workaround, full fix for Bug 2332 needs binding v2.
Forward slash is a first character (not allowed in general yang identifiers)
that was encountered in enums from real world Yang models.
Possibly, other separators could get the same treatment,
acting the same way as dash and dot already do.
Change-Id: Ic62198a843747092113c1c7dffaff13d09e7f943
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Juraj Veverka [Wed, 20 Jul 2016 12:22:38 +0000 (14:22 +0200)]
implemented missing equals for InstanceIdentifierBuilderImpl with tests
Change-Id: I540a3f44f964de4c3f44281fb51d9a1404313ff7
Signed-off-by: Juraj Veverka <Juraj.Veverka@pantheon.tech>
Robert Varga [Wed, 27 Jul 2016 22:26:10 +0000 (00:26 +0200)]
Use TypedSchemaNode
Now that the getType() method is available through a unified
interface use it to simplify type checks.
Change-Id: I9538c3677daf4ac4e3eac080220403bf2f75adb8
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 27 Jul 2016 20:40:23 +0000 (22:40 +0200)]
Remove an unneeded type specifier
Optional.of() can be correctly inferred with Java 8,
remove the type argument.
Change-Id: Ie0826c03c964bb1bdfd7a070fa1bf80cef2ac3f0
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 27 Jul 2016 20:26:34 +0000 (22:26 +0200)]
Remove unneeded cast
Since we have corrected the getSchema() method, there is no need
to perform a cast.
Change-Id: Ib3c9b2d7dc3a15f2cb9e042055178106f6b33cae
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 27 Jul 2016 20:29:18 +0000 (22:29 +0200)]
Fix incorrect null check
Eliminate an Eclipse-generated warning, which actually shows a bug.
Calls to childNonNull() did not pass an actual instance, but rather
a 'obj != null' expression. That expression got evaluated to
a boolean, which got boxed. Hence childNonNull() could not observe
a null no matter what and we'd get a NPE on next use -- exactly where
Eclipse put a warning.
childNonNull() returns a correctly annotatad @Nonnull reference,
which can be used as a guard against this kind of mistake: if the
original code used that reference, compilation would fail,
as the checked object is a Boolean and does not have a get() method.
This patch eliminates the expression and uses the returned reference,
eliminating the possiblity of a NPE.
Change-Id: I706f077f90ea38d3a48125beeaf4711182c8b8d5
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 21 Jul 2016 09:11:42 +0000 (11:11 +0200)]
Use direct type checks
With the removal of old parser and ExtendedType each type
definition implements proper subtype, hence we do not have
to traverse the type tree up to root.
Change-Id: Ib7a6ffa5f221278547e27e37b19c14a1a3c26d8a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 21 Jul 2016 09:08:41 +0000 (11:08 +0200)]
Use lambda for Codec.loader()s
Removes a bit of boiler-plate code.
Change-Id: Id0c7c8d16d374133d9439cd72587382e31252b80
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 21 Jul 2016 09:07:47 +0000 (11:07 +0200)]
Fix checkstyle errors
'if(' -> 'if ('
Change-Id: I4747befcf35724bc1f99346e0ae8ab3ee5b30254
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Thu, 21 Jul 2016 01:39:34 +0000 (03:39 +0200)]
Checkstyle clean-up src/test/java
Required to be able to run (enforce) CS on src/test as well.
Change-Id: Ife78f9baf1fcb462d15ca59675e4116903048c6b
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Robert Varga [Tue, 19 Jul 2016 17:08:01 +0000 (19:08 +0200)]
BUG-6022: retain order of constituent types
In order to safely iterate over the types, we need
to retain their order from the SchemaNode. Use
a LinkedHashSet to achieve that.
Change-Id: I850f823a0b67dc9bc3e6b75f9a1c671e4bbf73d9
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 19 Jul 2016 14:58:25 +0000 (16:58 +0200)]
Add union deserialization debugs
We seem to be hitting the slow instantiation path for some
reason. Add more debugging in an effort to hunt them down.
Change-Id: I64c5630a819d46710f7957c3972a2ba305b21ac7
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 8 Jun 2016 16:31:40 +0000 (18:31 +0200)]
BUG-6028: iterate over component types to instantiate union
This reworks union instantiation to be on par with
https://tools.ietf.org/html/rfc6020#section-9.12. We iterate
over individual members and attempt to run deserialization.
If it succeeds instantiate the union using cached constructor
specifying that member. This side-steps the need to go through
serialization.
Change-Id: Ieec37da37a05c2b2a2f432778232e136c903f654
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Isaku Yamahata [Wed, 13 Jul 2016 00:04:41 +0000 (17:04 -0700)]
Bug 6112 - UnionTypeCodec fails to non-identityref value
When Non-identityref value is deserialized, ClassCastException exception occurs.
catch the exception and move to the next codec.
> java.lang.ClassCastException: java.lang.Short cannot be cast to org.opendaylight.yangtools.yang.common.QName
> at org.opendaylight.yangtools.binding.data.codec.impl.IdentityCodec.deserialize(IdentityCodec.java:17)
> at org.opendaylight.yangtools.binding.data.codec.impl.UnionTypeCodec.deserialize(UnionTypeCodec.java:103)
> at org.opendaylight.yangtools.binding.data.codec.impl.LeafNodeCodecContext.deserializeObject(LeafNodeCodecContext.java:199)
> at org.opendaylight.yangtools.binding.data.codec.impl.DataObjectCodecContext.getBindingChildValue(DataObjectCodecContext.java:328)
> at org.opendaylight.yangtools.binding.data.codec.impl.LazyDataObject.getBindingData(LazyDataObject.java:148)
> at org.opendaylight.yangtools.binding.data.codec.impl.LazyDataObject.invoke(LazyDataObject.java:71)
> at com.sun.proxy.$Proxy3.getValue(Unknown Source)
> at org.opendaylight.yangtools.binding.data.codec.test.UnionTypeWithIdentityrefTest.bug6112Test(UnionTypeWithIdentityrefTest.java:78)
Change-Id: If6d9bffbc8cecaca2894f889940c814919da6a4b
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Peter Nosal [Wed, 6 Jul 2016 13:08:57 +0000 (15:08 +0200)]
Bug 5947: Increasing code coverage - yang util
Change-Id: I7e2cc7590952e3de444e50f172fb4c68a84041dd
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
Ryan Goulding [Wed, 6 Jul 2016 19:26:19 +0000 (15:26 -0400)]
Bug 5151 Java binding missing @return
Adds @return functionality to interface accessors. The idea is to generate a
meaningful return label so that we don't get warnings during compilation for
missing return statements. A test is added to verify that the return statement
is formatted appropriately.
Change-Id: I01875b788622cab002653a03ea2d844d2c954b77
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
Ryan Goulding [Wed, 6 Jul 2016 15:56:11 +0000 (11:56 -0400)]
Fix a typo in the ClassTemplate API
Just fixes a typo in the ClassTemplate xtend template.
Change-Id: Ia9c888c29a7a929cfcb574d0d7fa9ac75f34926a
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
Ryan Goulding [Thu, 2 Jun 2016 18:01:19 +0000 (14:01 -0400)]
Bug 2872: Generated Java Enumerations should contain mapping to the string counter part
Changes the Enumeration API to expose the "getMappedName()" accessor, which exposes
the name that is used for the Java mapped enum name. The EnumTemplate.xtend template
was modified in the following way:
1) A field was added to track the "raw" enum name, the one parsed from the YANG file.
2) The constructor was modified to accept the raw enum name as a parameter, and store
the parameter value in the name instance variable.
3) An accessor was added called "getName()", which exposes the name instance variable.
A corresponding change in yangtools changes the EnumEffectiveStatementImpl.getName()
definition to expose the "raw" name attribute parsed from the yang file:
https://git.opendaylight.org/gerrit/#/c/39733/
Change-Id: If248039a2b10958ff563ee0799d7b13284570b3c
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
Filip Gregor [Thu, 16 Jun 2016 12:02:19 +0000 (14:02 +0200)]
LazyDataObject bindingEquals fix
added check for byte arrays
Change-Id: I238d92bc7a23ac0157ff66046e5d137d6e10582e
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Robert Varga [Wed, 8 Jun 2016 12:21:42 +0000 (14:21 +0200)]
Optimize BitsCodec
The codec was not using methodhandles and performed reflective
invocation. Fix that, amortizing invocation cost.
Change-Id: Ibe7b41b81ab248bfe0221083feb4c0bcd24cee4d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 8 Jun 2016 11:59:17 +0000 (13:59 +0200)]
Optimize UnionTypeCodec
For some reason this codec was not using MethodHandle#invokeExact()
for instantiation. Fix this and remove static fields holding public
lookups.
Change-Id: I8b170ec850aa8182cbe8bf81a0fbbef796aad741
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 8 Jun 2016 17:05:56 +0000 (19:05 +0200)]
Enforce non-null class
Also hide the field and expose a getter.
Change-Id: Ic998b2726be93bf173525bdb6a394e438e3e330c
Signed-off-by: Robert Varga <rovarga@cisco.com>
Filip Gregor [Mon, 13 Jun 2016 11:09:55 +0000 (13:09 +0200)]
MDSAL clean-up
Follow usual naming conventions and
refactor utility class RetestUtils.
Change-Id: I655af10d6a90196ee16c9fe060279ea8cf57782c
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Robert Varga [Thu, 9 Jun 2016 08:49:19 +0000 (10:49 +0200)]
BUG-865: remove reference to SchemaAwareNormalizedNodeStreamWriter
All functionality has been integrated ito NormalizedNodeStreamWriter, hence
the two subclasses are no longer needed. Remove reference to the old type
so it can be removed.
Change-Id: I0e0ef84279b5504bb18bcf164ae3a5091fa04582
Signed-off-by: Robert Varga <rovarga@cisco.com>
Isaku Yamahata [Thu, 2 Jun 2016 00:40:34 +0000 (17:40 -0700)]
Bug 6006 - UnionTypeCodec fails to handle indentityref
UnionTypeCodec doesn't know that identityref requires special handling
because the actual derived identityref classes are determined at runtime.
Change-Id: I817190a380f0325b0bb8ee6f13a7d94cffc29113
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>