yangtools.git
9 years agoBUG 2868: Update iana-if-type with RFC 7224 68/16768/1
Vishal Thapar [Wed, 18 Mar 2015 13:49:13 +0000 (19:19 +0530)]
BUG 2868: Update iana-if-type with RFC 7224

Change-Id: Ide79db6c34fb23bd2c773a614c35d1e436b7d237
Signed-off-by: Vishal Thapar <vishal.thapar@ericsson.com>
9 years agoMerge "Bug 2864: Fixed (de)serialization of leafrefs"
Robert Varga [Wed, 18 Mar 2015 11:10:43 +0000 (11:10 +0000)]
Merge "Bug 2864: Fixed (de)serialization of leafrefs"

9 years agoBug 2864: Fixed (de)serialization of leafrefs 52/16752/1
Tony Tkacik [Wed, 18 Mar 2015 10:18:01 +0000 (11:18 +0100)]
Bug 2864: Fixed (de)serialization of leafrefs

Leafrefs in JSON were not properly deserialized
for non-simple types as Instance Identifier
or Identityref, which requires schema-sensitive
parsing.

Reworked JSONCodecFactory to create and store codecs
by DataSchemaNode, since leafref resolution
requires location in data schema tree, which
was not required for other codecs.

Actual codec is selected by looking up schema of
type referenced by leafref and codec is constructed
from that type.

Change-Id: Ia650b99933b177d31bee3f4b38f42e22227120d6
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2857: Tied pre-existing implementation to BindingCodecTree."
Robert Varga [Wed, 18 Mar 2015 09:34:56 +0000 (09:34 +0000)]
Merge "Bug 2857: Tied pre-existing implementation to BindingCodecTree."

9 years agoMerge "Bug 2804: Fixed incorrect emiting of some arguments."
Robert Varga [Wed, 18 Mar 2015 09:33:21 +0000 (09:33 +0000)]
Merge "Bug 2804: Fixed incorrect emiting of some arguments."

9 years agoBug 2857: Tied pre-existing implementation to BindingCodecTree. 01/16701/4
Tony Tkacik [Thu, 12 Mar 2015 11:06:00 +0000 (12:06 +0100)]
Bug 2857: Tied pre-existing implementation to BindingCodecTree.

BindingCodecTree provides public view into backing structure
of binding-data-codec, which was designed and already implemented
as data tree.

By exposing these power-users could build their own
Binding to DOM adapters, where they could customize some aspects
of serialization or precache over-used codecs in order
to speed up performance.

Change-Id: I827eb6014b28d0b6d4256b677ee56d3081ff80b0
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2804: Fixed incorrect emiting of some arguments. 02/16702/2
Tony Tkacik [Tue, 17 Mar 2015 14:30:32 +0000 (15:30 +0100)]
Bug 2804: Fixed incorrect emiting of some arguments.

For some YANG or extension statements, arguments
were not emmited as separate YIN element, but as
argument.

Added explicit check which extracts YIN element
information from RFC6020 mapping and ExtensionDefinition.

Change-Id: I8ebfdd21c2890e7eaeaf207ca43a7c4896369130
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2859: Key generation when anonymous Enum was used. 39/16639/3
Tony Tkacik [Mon, 16 Mar 2015 13:31:50 +0000 (14:31 +0100)]
Bug 2859: Key generation when anonymous Enum was used.

Binding list key was generated with incorrect type,
when anonymous enumeration was defined in leaf in grouping
and that leaf was used for list.

Change-Id: Idcb114be49280f77af8054d8d83c5d8e6f453665
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2846 - Ordered-by user is broken again - SFC is broken"
Tony Tkacik [Mon, 16 Mar 2015 10:03:50 +0000 (10:03 +0000)]
Merge "Bug 2846 - Ordered-by user is broken again - SFC is broken"

9 years agoBug 2846 - Ordered-by user is broken again - SFC is broken 22/16622/2
Jan Hajnar [Mon, 16 Mar 2015 08:59:42 +0000 (09:59 +0100)]
Bug 2846 - Ordered-by user is broken again - SFC is broken

* fixed gson codec to create ordered map node when "ordered-by user" is
defined in schema

Change-Id: I81e01aa051405630b58b180b4d730aba64c04b93
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoMerge "Lower commons-lang3 dependency"
Tony Tkacik [Mon, 16 Mar 2015 09:09:33 +0000 (09:09 +0000)]
Merge "Lower commons-lang3 dependency"

9 years agoMerge "BUG-2512: get rid of commons-io"
Tony Tkacik [Mon, 16 Mar 2015 07:28:48 +0000 (07:28 +0000)]
Merge "BUG-2512: get rid of commons-io"

9 years agoMerge "BUG-2352: Remove RestMessageTools"
Tony Tkacik [Mon, 16 Mar 2015 07:28:38 +0000 (07:28 +0000)]
Merge "BUG-2352: Remove RestMessageTools"

9 years agoMerge "Migrate from BindingGeneratorUtil"
Tony Tkacik [Mon, 16 Mar 2015 07:28:07 +0000 (07:28 +0000)]
Merge "Migrate from BindingGeneratorUtil"

9 years agoMerge "BUG-2829: make static QName field hold a cached reference"
Tony Tkacik [Mon, 16 Mar 2015 07:13:14 +0000 (07:13 +0000)]
Merge "BUG-2829: make static QName field hold a cached reference"

9 years agoLower commons-lang3 dependency 74/16474/2
Robert Varga [Fri, 13 Mar 2015 10:50:56 +0000 (11:50 +0100)]
Lower commons-lang3 dependency

This library is only used in tests, so lower the dependency.

Change-Id: Id530866be998969e0c8cf786e2005b38987163b5
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2512: get rid of commons-io 73/16473/2
Robert Varga [Fri, 13 Mar 2015 10:44:35 +0000 (11:44 +0100)]
BUG-2512: get rid of commons-io

Guava/JDK give us everything we need, no need to have yet another
library in the dependencies.

Change-Id: I3f5e21a3b41bee099a13cb21e972ee4ddb77b77e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2352: Remove RestMessageTools 75/16475/2
Robert Varga [Fri, 13 Mar 2015 11:03:35 +0000 (12:03 +0100)]
BUG-2352: Remove RestMessageTools

This is a prototype implementation, whose sole method never worked.

Change-Id: Id7fa10ac7e541bac80173c40af3fd2b00e1586ab
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdd ietf-interfaces to model. 48/16248/5
Deepthi V V [Tue, 10 Mar 2015 10:46:23 +0000 (16:16 +0530)]
Add ietf-interfaces to model.

ietf-interfaces is a standard ietf yang model. This will be used by
vpnservice project.

Signed-off-by: Deepthi V V <deepthi.v.v@ericsson.com>
Change-Id: I787e945a39417cc85c79b11cb28264b82cd168e6
Signed-off-by: Deepthi V V <deepthi.v.v@ericsson.com>
9 years agoMigrate from BindingGeneratorUtil 20/16420/4
Robert Varga [Thu, 12 Mar 2015 22:50:52 +0000 (23:50 +0100)]
Migrate from BindingGeneratorUtil

BindingMapping is the new home for mapping module namespaces to java
package names.

Change-Id: I61ecf91c2ffa78a6e62c00feaf5fd7879dd89cf9
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2287 - TypeProviderImpl retains empty HashMaps 77/13477/7
Ladislav Borak [Tue, 9 Dec 2014 11:32:24 +0000 (12:32 +0100)]
Bug 2287 - TypeProviderImpl retains empty HashMaps

Allocating default HashMaps is wasteful, especially if we end up not
storing anything in them. This fixes that case by making sure we
allocate a map only after we are sure we are going to put something into
it. Also be conservative about the size, so we do not waste too much
space.

Change-Id: I85ad1506e732a5c3728ef3529e7e0b5b430d758a
Signed-off-by: Ladislav Borak <lborak@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2818: Updated implementation of parser."
Robert Varga [Thu, 12 Mar 2015 21:20:01 +0000 (21:20 +0000)]
Merge "Bug 2818: Updated implementation of parser."

9 years agoBug 2818: Updated implementation of parser. 12/16412/1
Tony Tkacik [Thu, 12 Mar 2015 20:00:08 +0000 (21:00 +0100)]
Bug 2818: Updated implementation of parser.

Moved special-case handling from nested classes up
to main parse cycle, which simplifies code. Also
added additional test, which tests behaviour
according the draft-lhotka.

Change-Id: I79bfa62221a6bbe914158b0fae3f51f4571ff9dd
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-2829: make static QName field hold a cached reference 10/16410/1
Robert Varga [Thu, 12 Mar 2015 19:49:11 +0000 (20:49 +0100)]
BUG-2829: make static QName field hold a cached reference

A QName (and QNameModule) exposes an API to obtain a system-wide
shared reference to an object. Use this facility to share QNameModules
across all generated classes, as well as sharing potentially duplicate
QNames.

Change-Id: Icfd0c48edbd37e54be1a436480d5808d4efaf29d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Eliminate all trailing whitespace in xtend"
Tony Tkacik [Thu, 12 Mar 2015 17:10:46 +0000 (17:10 +0000)]
Merge "Eliminate all trailing whitespace in xtend"

9 years agoMerge "Make sure we do not generate trailing whitespace"
Tony Tkacik [Thu, 12 Mar 2015 17:10:41 +0000 (17:10 +0000)]
Merge "Make sure we do not generate trailing whitespace"

9 years agoMerge "Bug 2818: Introduced optional array for parsing root list items."
Robert Varga [Thu, 12 Mar 2015 17:10:21 +0000 (17:10 +0000)]
Merge "Bug 2818: Introduced optional array for parsing root list items."

9 years agoEliminate all trailing whitespace in xtend 03/16403/2
Robert Varga [Thu, 12 Mar 2015 16:44:31 +0000 (17:44 +0100)]
Eliminate all trailing whitespace in xtend

The API generator output should not contain trailing whitespace --
cleanup the templates to make sure we do not pollute output.

Change-Id: Ia312d1e2a0218a51eac42a62446bb6af63d69ee6
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMake sure we do not generate trailing whitespace 02/16402/2
Robert Varga [Thu, 12 Mar 2015 16:42:08 +0000 (17:42 +0100)]
Make sure we do not generate trailing whitespace

If we get an empy line in description, it is possible for us to generate
trailing whitespace. Make sure we don't do that and also clean any
trailing whitespace from the source file itself.

Change-Id: I8ea20c92cce5a6dccc1c107af97b959af4264f84
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2818: Introduced optional array for parsing root list items. 05/16405/1
Tony Tkacik [Thu, 12 Mar 2015 16:44:21 +0000 (17:44 +0100)]
Bug 2818: Introduced optional array for parsing root list items.

Specification draft-lhotka-netmod-yang-json-02 clearly
specifies that list must be serialized as array of objects,
but currently only user of yang-json is
draft-bierman-netconf-restconf-02, which specifies
and provides example where such list exists are also used
without arrays when parsing.

Introduced support for this case (and unit test),
in order to interoperate with clients, which follows
serialization as was provided in examples of restconf.

Change-Id: I4ebf7cfba17752de2184e9b7ac1d18c1ecac6f80
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2248 - mvn clean install is failing due to checkstyle"
Robert Varga [Thu, 12 Mar 2015 14:50:26 +0000 (14:50 +0000)]
Merge "Bug 2248 - mvn clean install is failing due to checkstyle"

9 years agoMerge "Fixed generation of UnionBuilders for anonymous unions."
Robert Varga [Thu, 12 Mar 2015 14:47:15 +0000 (14:47 +0000)]
Merge "Fixed generation of UnionBuilders for anonymous unions."

9 years agoIntroduction of more powerful binding codec APIs 64/15964/6
Tony Tkacik [Tue, 3 Mar 2015 11:06:31 +0000 (12:06 +0100)]
Introduction of more powerful binding codec APIs

Introduces new more expresive APIs, which allows
user to customize serialization / deserialization.

Introduced new concepts:

 - Subtree codecs
    - Tree and cursor based APIs for locating subtree
 - Caching Codec - codec which uses cache for serialization

Change-Id: If4868c9cd20c56d2ce0498bd2ded90b1265f7b67
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoFixed generation of UnionBuilders for anonymous unions. 90/16390/2
Tony Tkacik [Thu, 12 Mar 2015 13:27:22 +0000 (14:27 +0100)]
Fixed generation of UnionBuilders for anonymous unions.

Change-Id: I18e90e7d7227efe31767734df1ce525df60104d5
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2248 - mvn clean install is failing due to checkstyle 53/12953/13
Ladislav Borak [Thu, 11 Dec 2014 12:07:59 +0000 (13:07 +0100)]
Bug 2248 - mvn clean install is failing due to checkstyle

- added check in BaseTemplate.imports() if imported type has same package
  as generated type

Change-Id: Ifefb4be88c145aa222541cbb901aa9cab63b510d
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoBUG-1513: make sure client code remains compatible 38/16338/1
Robert Varga [Wed, 11 Mar 2015 16:39:18 +0000 (17:39 +0100)]
BUG-1513: make sure client code remains compatible

This updates the single implementation of ChoiceNode so that it
implements the legacy interface, too -- thus instanceof checks will
continue to work.

Change-Id: Iea9938ac434d5a07891ab24cef0193b7261783ee
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1513: finish migration of ChoiceNodes 06/16306/1
Robert Varga [Wed, 11 Mar 2015 09:21:42 +0000 (10:21 +0100)]
BUG-1513: finish migration of ChoiceNodes

This migrates the leftover users to make them work correctly.

Change-Id: I134c82d29a6b192455f670d2f1a9477a688fff25
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1513: introduce ChoiceSchemaNode 70/16270/7
Robert Varga [Tue, 10 Mar 2015 12:03:32 +0000 (13:03 +0100)]
BUG-1513: introduce ChoiceSchemaNode

This introduces the alternative name, which does not clash with
yang-data-api. Also deprecated ChoiceNode.

Change-Id: I42e93c45804dc8e3952d08c697f772d776c303c3
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Migrate to BasicGenerator"
Tony Tkacik [Tue, 10 Mar 2015 19:50:08 +0000 (19:50 +0000)]
Merge "Migrate to BasicGenerator"

9 years agoMerge "BUG 2282 - JSON top level element without module name"
Tony Tkacik [Tue, 10 Mar 2015 19:30:59 +0000 (19:30 +0000)]
Merge "BUG 2282 - JSON top level element without module name"

9 years agoBUG 2282 - JSON top level element without module name 68/12668/9
Jozef Gloncak [Mon, 3 Nov 2014 15:02:54 +0000 (16:02 +0100)]
BUG 2282 - JSON top level element without module name

Json top level element now doesn't have to contain module name prefix.

If namespace of some child element was changed and only one child with
specified name exist in schema then its namespace is used by default.

If more then one potential child in various namespaces exists then
exception is raised. Exception is also raised if no such element as
specified in JSON input exists in YANG schema.

Change-Id: I8a38fde4f2e9b79562f6bf7c79acafd51c7bff32
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
(cherry picked from commit 6eee2a1ce9e69a7b653a7b4427573eff67588d1f)

9 years agoMigrate to BasicGenerator 80/16280/2
Robert Varga [Tue, 10 Mar 2015 16:33:49 +0000 (17:33 +0100)]
Migrate to BasicGenerator

This is just a documentation reference, so update it to the new
interface.

Change-Id: Ia21b0ea89f4fc478695555f65983b964ed908ba7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Remove unneeded annontation"
Tony Tkacik [Tue, 10 Mar 2015 15:27:32 +0000 (15:27 +0000)]
Merge "Remove unneeded annontation"

9 years agoMerge "Fix a generic warning"
Tony Tkacik [Tue, 10 Mar 2015 15:27:24 +0000 (15:27 +0000)]
Merge "Fix a generic warning"

9 years agoMerge "Execute yang-maven-plugin"
Tony Tkacik [Tue, 10 Mar 2015 15:27:17 +0000 (15:27 +0000)]
Merge "Execute yang-maven-plugin"

9 years agoRemove unneeded annontation 69/16269/1
Robert Varga [Tue, 10 Mar 2015 14:49:27 +0000 (15:49 +0100)]
Remove unneeded annontation

Change-Id: I7886d28fcaee4e7e8563dc8f9f15a92bd7054b06
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix a generic warning 68/16268/1
Robert Varga [Tue, 10 Mar 2015 14:47:32 +0000 (15:47 +0100)]
Fix a generic warning

Add generic arguments to fix a warning.

Change-Id: I249258370efe32d26189cf236818c483b8f0d915
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdd support for attributes int NN stream writer(list entry) 58/16258/1
Maros Marsalek [Tue, 10 Mar 2015 10:50:10 +0000 (11:50 +0100)]
Add support for attributes int NN stream writer(list entry)

Change-Id: I2191ea7809c5b914b982f8514eda5952b3659e7d
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoExecute yang-maven-plugin 67/16267/1
Robert Varga [Tue, 10 Mar 2015 12:06:03 +0000 (13:06 +0100)]
Execute yang-maven-plugin

This eases integration with eclipse, as we should be interacting with it
well now.

Change-Id: I31832abf40e6965b846beaa762a91c2a888c5b57
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAnyXml NormalizedNode wraps a DOMSource value 51/16251/2
Maros Marsalek [Thu, 5 Mar 2015 14:07:27 +0000 (15:07 +0100)]
AnyXml NormalizedNode wraps a DOMSource value

Instead of wrapping a CompositeNode, a DOM source is used as inner value for
AnyXml. XML -> NormalizedNode parser was updated as well as NormalizedNode ->
XML stream writer.

Change-Id: Ide51b2a08969a65d492c18f4b594e7559fee5844
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoAdd support for attributes int NN stream writer 50/16250/2
Maros Marsalek [Tue, 10 Mar 2015 10:50:10 +0000 (11:50 +0100)]
Add support for attributes int NN stream writer

Change-Id: I51dc747763a65dee5145a33657eaf7223945d096
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMerge "Bug 2766: Fixed parsing and serializing XPath Instance Identifiers"
Robert Varga [Mon, 9 Mar 2015 09:18:02 +0000 (09:18 +0000)]
Merge "Bug 2766: Fixed parsing and serializing XPath Instance Identifiers"

9 years agoIntroduced MethodHandle based invokers for Notification and RPCs 93/16093/3
Tony Tkacik [Thu, 5 Mar 2015 21:04:43 +0000 (22:04 +0100)]
Introduced MethodHandle based invokers for Notification and RPCs

This invokers are used to provide genereralized access to any
generated callback / rpc method using one approach for
any RPC.

Change-Id: I4d6ce7c71f658b5e2c6e805479aa47a8f09fb989
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2766: Fixed parsing and serializing XPath Instance Identifiers 00/15900/8
Tony Tkacik [Mon, 2 Mar 2015 13:39:49 +0000 (14:39 +0100)]
Bug 2766: Fixed parsing and serializing XPath Instance Identifiers

Original implementation of Instance Identifier codec used
Splitters which did not have enough information to determine
that '/' is used in string literals.

Fortunatelly Instance Identifier is only very constrained
subset of XPath, so it was still possible to reimplement
correct token-based parser using Guava.

Other problem fixed with  parsing instance identifiers was
that YangInstanceIdentifier also contained components,
which are not present in XML / JSON serialization.

Change-Id: I4186f59f8e16c92eb2e0ca2bc0a6c12e7215a3be
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Revert "AnyXml NormalizedNode wraps a DOMResult value""
Tony Tkacik [Sun, 8 Mar 2015 11:53:14 +0000 (11:53 +0000)]
Merge "Revert "AnyXml NormalizedNode wraps a DOMResult value""

9 years agoRevert "AnyXml NormalizedNode wraps a DOMResult value" 69/16169/1
Tony Tkacik [Sun, 8 Mar 2015 11:39:33 +0000 (11:39 +0000)]
Revert "AnyXml NormalizedNode wraps a DOMResult value"

This reverts commit c5bde84eced27e2d073554420c3f47eca85af32c.

Commit was merged before clients were able to migrate.

Change-Id: I7ab48a36f5dbbd52e8b91be8ea049b72a776ea15
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Make sure maven artifacts are provided"
Tony Tkacik [Sun, 8 Mar 2015 10:37:21 +0000 (10:37 +0000)]
Merge "Make sure maven artifacts are provided"

9 years agoMerge "Remove unnecessary casts"
Tony Tkacik [Sun, 8 Mar 2015 10:37:07 +0000 (10:37 +0000)]
Merge "Remove unnecessary casts"

9 years agoMerge "Remove unnecessary casts"
Tony Tkacik [Sun, 8 Mar 2015 10:36:48 +0000 (10:36 +0000)]
Merge "Remove unnecessary casts"

9 years agoMerge "Remove unnecessary casts"
Tony Tkacik [Sun, 8 Mar 2015 10:36:37 +0000 (10:36 +0000)]
Merge "Remove unnecessary casts"

9 years agoMerge "Do not rely on transitive dependencies"
Tony Tkacik [Sun, 8 Mar 2015 10:36:28 +0000 (10:36 +0000)]
Merge "Do not rely on transitive dependencies"

9 years agoAnyXml NormalizedNode wraps a DOMResult value 84/16084/4
Maros Marsalek [Thu, 5 Mar 2015 14:07:27 +0000 (15:07 +0100)]
AnyXml NormalizedNode wraps a DOMResult value

Instead of wrapping a CompositeNode, a DOM result is used as inner value for
AnyXml. XML -> NormalizedNode parser was updated as well as NormalizedNode ->
XML stream writer.

Change-Id: I8cb6875bf395385d0f10d16d5e9d7361e9172e5a
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoPreserve backwards compatibility in DomToNormalizedNodeParserFactory 29/16129/2
Maros Marsalek [Fri, 6 Mar 2015 08:21:57 +0000 (09:21 +0100)]
Preserve backwards compatibility in DomToNormalizedNodeParserFactory

Restore the former constructor with only CodecProvider but make it deprecated

Change-Id: I1cd9c9af4ac16baa228503fb125a587614a52d2e
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMake sure maven artifacts are provided 79/16079/1
Robert Varga [Thu, 5 Mar 2015 13:38:46 +0000 (14:38 +0100)]
Make sure maven artifacts are provided

We expect these to be provided, not brought in explicitly.

Change-Id: I36d86f4c8beea33d6f279ba8986d1e987efe514d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unnecessary casts 78/16078/1
Robert Varga [Thu, 5 Mar 2015 13:30:24 +0000 (14:30 +0100)]
Remove unnecessary casts

xtend 2.7.x makes instanceof check an implicit cast for subsequent
variable usage, so these generate warnings. Also remove use of
deprecated types and speed up stringuilder usage by passing characters
instead of strings where possible.

Change-Id: I3131166a2fedf09743e6baf4159ba15357a37993
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unnecessary casts 77/16077/1
Robert Varga [Thu, 5 Mar 2015 13:30:02 +0000 (14:30 +0100)]
Remove unnecessary casts

xtend 2.7.x makes instanceof check an implicit cast for subsequent
variable usage, so these generate warnings.

Change-Id: I88f7b68cd2fdddf0bb39c2bbc8f2c8533de22006
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unnecessary casts 76/16076/1
Robert Varga [Thu, 5 Mar 2015 13:28:51 +0000 (14:28 +0100)]
Remove unnecessary casts

xtend 2.7.x makes instanceof check an implicit cast for subsequent
variable usage, so these generate warnings.

Change-Id: Ic28a868eeef8167a1f7e8b3946c2ea13526818dc
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDo not rely on transitive dependencies 75/16075/1
Robert Varga [Thu, 5 Mar 2015 13:00:23 +0000 (14:00 +0100)]
Do not rely on transitive dependencies

Maven core and build API should have scope=provided.

Change-Id: Id34b075fb92247507a61b79daee6c4ab73647f53
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoXML -> NormalizedNodes parser identity-ref/instance-id/leafref support 21/16021/2
Maros Marsalek [Wed, 4 Mar 2015 14:08:33 +0000 (15:08 +0100)]
XML -> NormalizedNodes parser identity-ref/instance-id/leafref support

The parsers now pars leaves of mentioned types properly.

Change-Id: I73e07079e27005dd2c22c239da6f81bdd2ef43a1
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoAdd AnyXml support to NormalizedNode parser 77/15977/2
Maros Marsalek [Tue, 3 Mar 2015 15:37:40 +0000 (16:37 +0100)]
Add AnyXml support to NormalizedNode parser

Change-Id: Iea8d1f8ba29788118a4fc44f8ed71fd759373e49
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMerge "Remove unneeded build declarations in features"
Tony Tkacik [Wed, 4 Mar 2015 11:00:12 +0000 (11:00 +0000)]
Merge "Remove unneeded build declarations in features"

9 years agoAdd rpc support to NormalizedNode writers 76/15976/1
Maros Marsalek [Tue, 3 Mar 2015 15:37:19 +0000 (16:37 +0100)]
Add rpc support to NormalizedNode writers

Change-Id: Id306a397351e35ff8b86d967d219ed37f98a3648
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoRemove unneeded build declarations in features 58/15858/2
Robert Varga [Sun, 1 Mar 2015 09:03:54 +0000 (10:03 +0100)]
Remove unneeded build declarations in features

features-parent defines all the things we need, so the entire build
section can go.

Change-Id: I90f061cd2b01471714738166d5d4c3662513a8a7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdd more NormalizedNodes.findNode() alternatives 91/15891/4
Robert Varga [Mon, 2 Mar 2015 10:17:05 +0000 (11:17 +0100)]
Add more NormalizedNodes.findNode() alternatives

In some calling contexts we already have an optional and/or do not have
the path encapsulated in YangInstanceIdentifier.

Change-Id: I87ddbefb2e8c36ccff26a35c24d0b01644a2d1e9
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoUse Collection.size() instead of Iterables.size() 53/15853/2
Robert Varga [Sat, 28 Feb 2015 21:03:00 +0000 (22:03 +0100)]
Use Collection.size() instead of Iterables.size()

Now that NormalizedNodeContainer returns a Collection of children, we
can use its size() method directly, speeding things up just a little
bit.

Change-Id: I7b336d0029084140ea853716a38f8abb87da7c26
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Make sure NormalizedNodeContainer uses Collection"
Tony Tkacik [Mon, 2 Mar 2015 14:28:45 +0000 (14:28 +0000)]
Merge "Make sure NormalizedNodeContainer uses Collection"

9 years agoMerge "DataContainerNodeBuilder should take a Collection"
Tony Tkacik [Mon, 2 Mar 2015 14:28:35 +0000 (14:28 +0000)]
Merge "DataContainerNodeBuilder should take a Collection"

9 years agoMerge changes Ie600f25f,I99deeb57,I63bddcfe
Tony Tkacik [Sun, 1 Mar 2015 14:52:29 +0000 (14:52 +0000)]
Merge changes Ie600f25f,I99deeb57,I63bddcfe

* changes:
  Cap LazyCollections list
  Introduce UnmodifiableCollection
  Expand known immutables

9 years agoMerge topic 'stable/helium'
Tony Tkacik [Sun, 1 Mar 2015 14:52:03 +0000 (14:52 +0000)]
Merge topic 'stable/helium'

* changes:
  Optimize getChild()
  Fix OrderedNodeContainer javadoc
  Fix ImmutableOrderedLeafSetNode.size()
  Fix EmptyImmutableUnkeyedListNode.getChild()

9 years agoMake sure NormalizedNodeContainer uses Collection 52/15852/1
Robert Varga [Sat, 28 Feb 2015 09:01:11 +0000 (10:01 +0100)]
Make sure NormalizedNodeContainer uses Collection

Instead of an Iterable, specify a collection, as that makes the number
of elements known.

Change-Id: Ifa6260ebe157c9afde49bbb58043d6ec2fecd189
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDataContainerNodeBuilder should take a Collection 31/15831/2
Robert Varga [Fri, 27 Feb 2015 18:17:57 +0000 (19:17 +0100)]
DataContainerNodeBuilder should take a Collection

List is too specific a collection to pass down into the builder. We care
only for it be Iterable, so a Collection is a reasonable middle ground.

Change-Id: Ifa3b455df76e7abd4ede387f67d2d8fcabd41545
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoCap LazyCollections list 51/15851/1
Robert Varga [Sat, 28 Feb 2015 08:58:57 +0000 (09:58 +0100)]
Cap LazyCollections list

When we move from a singleton to an ArrayList, specify the size as 2, as
the arraylist can grow beyond that, but will not waste space if it
remains at two elements.

Change-Id: Ie600f25f9e59aa5321f335b380d6d6930e4492ee
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoIntroduce UnmodifiableCollection 50/15850/1
Robert Varga [Sat, 28 Feb 2015 17:51:29 +0000 (18:51 +0100)]
Introduce UnmodifiableCollection

This is a utility class which recognizes itself and Guava's
ImmutableCollection subclasses during contruction, preventing unneeded
encapsulation.

Change-Id: I99deeb570a74ecee5f0bb8a89c25b363284e5f6e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoExpand known immutables 49/15849/1
Robert Varga [Sat, 28 Feb 2015 09:00:23 +0000 (10:00 +0100)]
Expand known immutables

Void and Boolean are immutable types, too. Also use ImmutableSet instead
of a hown-grown utility.

Change-Id: I63bddcfe5a8538065378a2259bf8bdc58f76d620
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoOptimize getChild() 48/15848/1
Robert Varga [Sat, 28 Feb 2015 20:22:00 +0000 (21:22 +0100)]
Optimize getChild()

The classes are so they can access children directly. This saves
instantiation of unmodifiable view and checks related to that.

Change-Id: Ia16373c92401c4b9d0dca61a0b5c5b491fc3f2e1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix OrderedNodeContainer javadoc 47/15847/1
Robert Varga [Sat, 28 Feb 2015 20:27:59 +0000 (21:27 +0100)]
Fix OrderedNodeContainer javadoc

Documents the generic argument and fixes a typo.

Change-Id: Ibd00a95df9ea86acfd0d67f57d8adfca6f611f27
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix ImmutableOrderedLeafSetNode.size() 46/15846/1
Robert Varga [Sat, 28 Feb 2015 20:29:22 +0000 (21:29 +0100)]
Fix ImmutableOrderedLeafSetNode.size()

The method always returned 0, which seems to have been missed.

Change-Id: Icdc8ec423aabd3cf7dc163670de6929d63bff3be
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix EmptyImmutableUnkeyedListNode.getChild() 45/15845/1
Robert Varga [Sat, 28 Feb 2015 20:47:24 +0000 (21:47 +0100)]
Fix EmptyImmutableUnkeyedListNode.getChild()

The interface contract states that we should throw
IndexOutOfBoundsException rather than returning null.

Change-Id: Ia1186a925dfe2b4e7bc89b92be4239f10b693f4e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unneeded dependencies 39/15539/5
Robert Varga [Fri, 20 Feb 2015 11:34:41 +0000 (12:34 +0100)]
Remove unneeded dependencies

slf4j bridge should no longer be necessary, so remove it, along with
dependencyManagement override.

Change-Id: Ia8035c7167a46c30142a643d094b3a6a1f19ee03
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoIntroduce ImmutableNodes.choiceNode() 21/15821/1
Robert Varga [Fri, 27 Feb 2015 12:04:22 +0000 (13:04 +0100)]
Introduce ImmutableNodes.choiceNode()

This is a convenience method, just like containerNode().

Change-Id: I984e31b56b2d8faaeab6db0634f34583434e294f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2539: Properly report incorrect Instance Identifiers"
Tony Tkacik [Thu, 26 Feb 2015 15:36:36 +0000 (15:36 +0000)]
Merge "Bug 2539: Properly report incorrect Instance Identifiers"

9 years agoMerge "Fix ImmutableNodes.containerNode()"
Tony Tkacik [Thu, 26 Feb 2015 15:34:55 +0000 (15:34 +0000)]
Merge "Fix ImmutableNodes.containerNode()"

9 years agoBug 2539: Properly report incorrect Instance Identifiers 82/15782/1
Tony Tkacik [Mon, 19 Jan 2015 14:24:12 +0000 (15:24 +0100)]
Bug 2539: Properly report incorrect Instance Identifiers

Binding Data Codec throws IllegalArgumentException
with description for incorrect instance identifiers
instead of generic NullPointerExceptions.

Change-Id: Ia47c83925a18f029c70b2816e2fcb58632027e3c
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG 1975 - yang unkeyed list is transformed to map node 89/11489/13
Jozef Gloncak [Tue, 23 Sep 2014 13:21:21 +0000 (15:21 +0200)]
BUG 1975 - yang unkeyed list is transformed to map node

Parsers and serializer for base, for concrete DOM type and
for composite node structure to normalized node conversion
were added/modified to make it possible parse|serialize
unkeyed list to|from UnkeyedListNode and parse
OrderedListNode.

yang-data-operations artifact - was added UnkeyedListNodeModification
class to handle cases when unkeyed list is loaded
from input stream

Change-Id: Ia3a9554dea00bb9d424495a2b6ed1f96765be738
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
(cherry picked from commit 13b0a924410d92a6d49182161d54cf2cdc50ad56)

9 years agoFix ImmutableNodes.containerNode() 78/15778/1
Robert Varga [Thu, 26 Feb 2015 14:04:15 +0000 (15:04 +0100)]
Fix ImmutableNodes.containerNode()

Down-casting to a NormalizedNode<?, ?> prevents the resulting container
from being useful as a child.

Change-Id: Ie426685091a55eb6d3770c127d8685c74f66d045
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge changes I4f081454,Ibe6f283d,I83acfee3,If7a08ff1,Ia0f847dd, ...
Tony Tkacik [Thu, 26 Feb 2015 08:29:44 +0000 (08:29 +0000)]
Merge changes I4f081454,Ibe6f283d,I83acfee3,If7a08ff1,Ia0f847dd, ...

* changes:
  Spellcheck AugmentableDataNodeContainerEmitterSource
  Use simple string concat in DataObjectSerializerSource
  Fix BindingNormalizedNodeCodecRegistry thread safety
  Compact BitsCodec
  Do not declare Exception as thrown
  DataContainerCodecPrototype should be final
  Fix code alignment

9 years agoFix array validation 63/15763/3
Robert Varga [Thu, 26 Feb 2015 06:12:03 +0000 (07:12 +0100)]
Fix array validation

BGP unit tests show up a failure involving byte[] keys:

org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.valid.DataValidationException$IllegalListKeyException: Illegal value for key: (urn:opendaylight:params:xml:ns:yang:bgp-linkstate?revision=2015-02-10)route-key, in: (urn:opendaylight:params:xml:ns:yang:bgp-linkstate?revision=2015-02-10)linkstate-route[{(urn:opendaylight:params:xml:ns:yang:bgp-linkstate?revision=2015-02-10)route-key=[B@6e685e6c}], actual value: [B@5b0902b4, expected value from key: [B@6e685e6c
        at org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.valid.DataValidationException.checkListKey(DataValidationException.java:60)
        at org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableMapEntryNodeBuilder.checkKeys(ImmutableMapEntryNodeBuilder.java:101)
        at org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableMapEntryNodeBuilder.build(ImmutableMapEntryNodeBuilder.java:94)
        at org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableMapEntryNodeBuilder.build(ImmutableMapEntryNodeBuilder.java:22)
        at org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter.endNode(ImmutableNormalizedNodeStreamWriter.java:129)
        at org.opendaylight.yangtools.binding.data.codec.impl.BindingToNormalizedStreamWriter.endNode(BindingToNormalizedStreamWriter.java:89)
        at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.routes.linkstate.routes.LinkstateRoute$StreamWriter.serialize(DataObjectSerializerPrototype.java)
        at org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry$DataObjectSerializerProxy.serialize(BindingNormalizedNodeCodecRegistry.java:273)
        at org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry.toNormalizedNode(BindingNormalizedNodeCodecRegistry.java:99)
        at org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec.toNormalizedNode(BindingToNormalizedNodeCodec.java:56)

This boils down to how we compare the objects. Using Objects.equals() does
not cover arrays. Switching to deepEquals() solves the problem.

Change-Id: I725dbfca2af11e5b7c6213a8f650109383f13af8
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoSpellcheck AugmentableDataNodeContainerEmitterSource 55/15755/2
Robert Varga [Wed, 25 Feb 2015 22:34:26 +0000 (23:34 +0100)]
Spellcheck AugmentableDataNodeContainerEmitterSource

Simple rename of an internal class to fix a typo.

Change-Id: I4f081454b5612d2960ff85158ca5cdf2adf17519
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoUse simple string concat in DataObjectSerializerSource 54/15754/2
Robert Varga [Wed, 25 Feb 2015 22:32:40 +0000 (23:32 +0100)]
Use simple string concat in DataObjectSerializerSource

Allocating a default-sized StringBuilder is not optimal, we'd really
want to preallocate it with the initial string, at which point it
becomes not much more than a simple concat.

Change-Id: Ibe6f283dccebb347982561c4acacf615a8fff4cf
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix BindingNormalizedNodeCodecRegistry thread safety 38/15738/2
Robert Varga [Wed, 25 Feb 2015 16:16:36 +0000 (17:16 +0100)]
Fix BindingNormalizedNodeCodecRegistry thread safety

Registry has a codecContext, which can be asynchronously updated. Make
sure it is volatile, so that any changes are guaranteed to propagate.

Change-Id: I83acfee3bb5f3bf3de6873161dd491e7d5882988
Signed-off-by: Robert Varga <rovarga@cisco.com>