mdsal.git
9 years agoBug 2906 - Added support of entering notification by #streamChild()
Tony Tkacik [Fri, 27 Mar 2015 10:04:50 +0000 (11:04 +0100)]
Bug 2906 - Added support of entering notification by #streamChild()

Root Tree Node context did not allowed to enter notification
using binding classes by #streamChild method, since
notifications were cached in different collection.

Added support for entering notifications using such method.

Change-Id: I28779e763a81519d25d71e319776cdc6f179ef33
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoextended test coverage of InstanceIdentifier
Kinsey Nietzsche [Wed, 12 Nov 2014 13:47:30 +0000 (14:47 +0100)]
extended test coverage of InstanceIdentifier

Change-Id: Id18ae2ec969612e6c52a19449453f47e4e7e5fff
Signed-off-by: Kinsey Nietzsche <kinsey.nietzsche@pantheon.sk>
9 years agoMerge "Bug 868: Removed Binding to Composite Node codecs."
Robert Varga [Fri, 20 Mar 2015 07:17:23 +0000 (07:17 +0000)]
Merge "Bug 868: Removed Binding to Composite Node codecs."

9 years agoBug 868: Removed Binding to Composite Node codecs.
Tony Tkacik [Thu, 19 Mar 2015 14:29:06 +0000 (15:29 +0100)]
Bug 868: Removed Binding to Composite Node codecs.

Change-Id: Ia54519c88870fada74bd2d7ce579c0e77d687157
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG 2868: Update iana-if-type with RFC 7224
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 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 agoBug 2857: Tied pre-existing implementation to BindingCodecTree.
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 2859: Key generation when anonymous Enum was used.
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 "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 agoAdd ietf-interfaces to model.
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
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
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 agoBUG-2829: make static QName field hold a cached reference
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 agoEliminate all trailing whitespace in xtend
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
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 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
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.
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
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: introduce ChoiceSchemaNode
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 "Fix a generic warning"
Tony Tkacik [Tue, 10 Mar 2015 15:27:24 +0000 (15:27 +0000)]
Merge "Fix a generic warning"

9 years agoFix a generic warning
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 agoIntroduced MethodHandle based invokers for Notification and RPCs
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 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 agoRemove unnecessary casts
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
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
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
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 agoUse Collection.size() instead of Iterables.size()
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 "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 agoBug 2539: Properly report incorrect Instance Identifiers
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 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 agoSpellcheck AugmentableDataNodeContainerEmitterSource
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
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
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>
9 years agoCompact BitsCodec
Robert Varga [Wed, 25 Feb 2015 16:19:56 +0000 (17:19 +0100)]
Compact BitsCodec

Instead of an if/else block, just use the result and store it directly
into array.

Change-Id: If7a08ff1a644b8bfbf023d8e5393896eb4e9b643
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDo not declare Exception as thrown
Robert Varga [Wed, 25 Feb 2015 16:28:42 +0000 (17:28 +0100)]
Do not declare Exception as thrown

This Callable never throws, so do not declare the exception, fixing a
sonar warning.

Change-Id: Ia0f847dd31ebc09d91993ded5e5bb2fc6486b7d6
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDataContainerCodecPrototype should be final
Robert Varga [Wed, 25 Feb 2015 16:19:01 +0000 (17:19 +0100)]
DataContainerCodecPrototype should be final

Let's help the runtime by declaring the class final, as it is
package-private and does not have descendants.

Change-Id: I8d994dc307c0d831b92a95775fd21e39f3ef1fd0
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix code alignment
Robert Varga [Wed, 25 Feb 2015 16:18:13 +0000 (17:18 +0100)]
Fix code alignment

Declaration and comment missed one leading space, fix that.

Change-Id: I198a96668ec0ad94b1b1118949988e88321f8b43
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMark classes/fields as final
Robert Varga [Wed, 25 Feb 2015 13:43:26 +0000 (14:43 +0100)]
Mark classes/fields as final

Making sure that we follow coding patterns, will actually improve what
the JIT can do for us.

Change-Id: I125a6c058ea603d2e9545c42ff8ab969372c371d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoSkip ArrayList instantiation during deserialization
Robert Varga [Wed, 25 Feb 2015 11:24:36 +0000 (12:24 +0100)]
Skip ArrayList instantiation during deserialization

We use the ArrayList just as an index holder, after which we just
extract the underlying array. The libraries by default perform a copy
and then JIT has to prove what is going on to remove that overhead.

Let's make it super-easy instead by filling the array ourselves.

Change-Id: Ib48992538b3cd8a9a0c11011fe444e24b23dc825
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2689: Cast exception when serializing L3Address from groupbasedpolicy policy...
Martin Ciglan [Fri, 20 Feb 2015 15:10:15 +0000 (16:10 +0100)]
BUG-2689: Cast exception when serializing L3Address from groupbasedpolicy policy.yang

When deserializing L3AddressKey, alphabetical order of key arguments
didn't match with order of related QNames as defined in yang model.

The binding-independent world retains the ordering specified in model,
while the binding-aware world requires constructor arguments to be
alpha-sorted.

Change-Id: Icb277fed97d0984ca1a60aa7add7817db727facc
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Fix supporting-node in topology model so it can actually be used."
Robert Varga [Wed, 25 Feb 2015 06:07:52 +0000 (06:07 +0000)]
Merge "Fix supporting-node in topology model so it can actually be used."

9 years agoFix supporting-node in topology model so it can actually be used.
Ed Warnicke [Wed, 18 Feb 2015 19:09:39 +0000 (12:09 -0700)]
Fix supporting-node in topology model so it can actually be used.

supporting-node in the topology model *only* has a node-ref
The node-ref is a leafref, which only provides the node-id
for the node.  Since we have no notion of what topology the supporting node
is in, we can't find it.

Change-Id: Ibc5829a45d97bb5a95abee07b397447a4cd509e0
Signed-off-by: Ed Warnicke <eaw@cisco.com>
9 years agoBUG-2179: split logging out of CodeGenerator
Robert Varga [Mon, 16 Feb 2015 22:10:12 +0000 (23:10 +0100)]
BUG-2179: split logging out of CodeGenerator

Currently SPI requires downstream users to import maven infrastructure
even if they are not using it. Split the two maven-related injection
methods into dedicated interfaces.

MavenLogAware is automatically deprecated, as maven 3.1+ works with
slf4j out of the box, hence Log injection is no longer needed.

Change-Id: Ibedc158d9bdbcf66c2df94fd578929729fa26821
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2179: remove plexus-slf4j-logging
Robert Varga [Mon, 16 Feb 2015 21:46:01 +0000 (22:46 +0100)]
BUG-2179: remove plexus-slf4j-logging

Maven 3.1.1 already supports slf4j as its native logging API, no need to
pull in the bridge.

Change-Id: Ia436a7e806aba46290c46d8389eb8d017b78f512
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Update Objects->MoreObjects"
Tony Tkacik [Mon, 16 Feb 2015 14:55:57 +0000 (14:55 +0000)]
Merge "Update Objects->MoreObjects"

9 years agoUpdate Objects->MoreObjects
Robert Varga [Sat, 14 Feb 2015 20:34:11 +0000 (21:34 +0100)]
Update Objects->MoreObjects

Guava 18 introduces MoreObjects so it does not clash on naming with
Java7 or later. Also migrate Objects.equal() to Objects.equals().

Change-Id: I467c27b4f3a25c98df68facd9f9a566126c99096
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMark yang generated source location as a source directory.
Nathan Harmon [Mon, 9 Feb 2015 21:19:39 +0000 (13:19 -0800)]
Mark yang generated source location as a source directory.

Change-Id: I958affa226e9e34a795ffea42450976ca9ef4697
Signed-off-by: Nathan Harmon <nathan.harmon@hp.com>
9 years agoMake dependencyManagement mandatory
Robert Varga [Tue, 10 Feb 2015 07:09:02 +0000 (08:09 +0100)]
Make dependencyManagement mandatory

Activating on existence of src/main/yang leads to different things being
defined when this pom is used in build vs. offlne.

Change-Id: I86cf9b2e9fc77fcad1c3868137eec5082766ae90
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge changes I7aea2237,Ie8e125e5
Tony Tkacik [Thu, 5 Feb 2015 09:51:22 +0000 (09:51 +0000)]
Merge changes I7aea2237,Ie8e125e5

* changes:
  Remove ietf-netconf
  Eliminate unused pluginManagement section

9 years agoMerge "Optimize Types instantiation"
Tony Tkacik [Thu, 5 Feb 2015 09:48:13 +0000 (09:48 +0000)]
Merge "Optimize Types instantiation"

9 years agoMerge "Improve codec performance"
Tony Tkacik [Thu, 5 Feb 2015 09:47:55 +0000 (09:47 +0000)]
Merge "Improve codec performance"

9 years agoRemove ietf-netconf
Robert Varga [Tue, 27 Jan 2015 13:18:30 +0000 (14:18 +0100)]
Remove ietf-netconf

We never built it, so remove it completely from repository.

Change-Id: I7aea2237e68ed9c945d70f1a91dd83c7031a4f03
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoEliminate unused pluginManagement section
Robert Varga [Tue, 27 Jan 2015 13:07:49 +0000 (14:07 +0100)]
Eliminate unused pluginManagement section

This is an aggregator, no need to define further plugins.

Change-Id: Ie8e125e54ff68434a4c976a19b534268b2749d5f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoImprove codec performance
Robert Varga [Thu, 22 Jan 2015 20:18:22 +0000 (21:18 +0100)]
Improve codec performance

Convert the codecs from reflection to invocation API. Invoking
constructors and getters via reflection seems to be causing around
2% overhead which can be avoided if the call site is properly bound.

Change-Id: I0c303773a21913d9d1a6de952d37eb0dd022cbd1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoOptimize Types instantiation
Robert Varga [Mon, 26 Jan 2015 17:08:36 +0000 (18:08 +0100)]
Optimize Types instantiation

Instead of using Arrays.copyOf(), use a simple array clone -- it has
better performance characteristics.

Change-Id: I2261f54c2a867dd09fd2f2655a0665492489215f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 865: ModuleInfoBackedContext is no more SchemaSourceProvider."
Robert Varga [Tue, 27 Jan 2015 09:33:21 +0000 (09:33 +0000)]
Merge "Bug 865: ModuleInfoBackedContext is no more SchemaSourceProvider."

9 years agoBUG-1434: fix NPEs when using null byte arrays
Robert Varga [Mon, 26 Jan 2015 16:42:35 +0000 (17:42 +0100)]
BUG-1434: fix NPEs when using null byte arrays

Commit introduced a regression, which caused NPEs being thrown when the
byte array was null (and hence failed to copy). Guard the copy with an
explicit null check and do not use Arrays.copyOf(), but clone().

Change-Id: I832ccae7a269548954705b2c1cdb1a42f83f71a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 865: ModuleInfoBackedContext is no more SchemaSourceProvider.
Tony Tkacik [Fri, 23 Jan 2015 11:29:09 +0000 (12:29 +0100)]
Bug 865: ModuleInfoBackedContext is no more SchemaSourceProvider.

ModuleInfoBackedContext is only used as only class-loader registry
for generated classes and and utility class to create Schema Context
from Binding v1 jar artefacts.

Thus it is safely remove implementation of unused and now deprecated
interface SchemaSourceProvider.

Change-Id: Iee9abf7d35a1a0c64878005c17a6ab82a1857eb3
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Cleanup warning suppressions"
Tony Tkacik [Mon, 26 Jan 2015 09:16:48 +0000 (09:16 +0000)]
Merge "Cleanup warning suppressions"

9 years agoMerge "Remove unused imports"
Tony Tkacik [Mon, 26 Jan 2015 09:16:15 +0000 (09:16 +0000)]
Merge "Remove unused imports"

9 years agoMerge "Migrate ClassLoaderUtils callers"
Tony Tkacik [Mon, 26 Jan 2015 09:15:37 +0000 (09:15 +0000)]
Merge "Migrate ClassLoaderUtils callers"

9 years agoMerge "Bug 1434 - Make arrays non-mutable"
Robert Varga [Sun, 25 Jan 2015 09:13:59 +0000 (09:13 +0000)]
Merge "Bug 1434 - Make arrays non-mutable"

9 years agoCleanup warning suppressions
Robert Varga [Fri, 23 Jan 2015 07:36:12 +0000 (08:36 +0100)]
Cleanup warning suppressions

Some of these are implied by context, some are needed down the stack.

Change-Id: Ifc090d3dce1a99fc5624d312f16f1046705dd285
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unused imports
Robert Varga [Fri, 23 Jan 2015 07:34:24 +0000 (08:34 +0100)]
Remove unused imports

The usual spring cleaning of unused import warnings.

Change-Id: Ia9d2d178fd1bc8f3468eab467cd434b34455c7a5
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMigrate ClassLoaderUtils callers
Robert Varga [Fri, 23 Jan 2015 07:32:26 +0000 (08:32 +0100)]
Migrate ClassLoaderUtils callers

oeg.opendaylight.yangtools.yang.util.ClassLoaderUtils is deprecated in
favor of the util package. This switches over some users.

Change-Id: I5c7035b70e23b37397b31e36616a973d8decbc01
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Split out codecs from BindingCodecContext"
Tony Tkacik [Fri, 23 Jan 2015 11:07:25 +0000 (11:07 +0000)]
Merge "Split out codecs from BindingCodecContext"

9 years agoMerge "Fixed incorrect serialization of multiple nested UnionTypes."
Tony Tkacik [Fri, 23 Jan 2015 11:05:43 +0000 (11:05 +0000)]
Merge "Fixed incorrect serialization of multiple nested UnionTypes."

9 years agoBug 1434 - Make arrays non-mutable
Ladislav Borak [Tue, 5 Aug 2014 11:13:58 +0000 (13:13 +0200)]
Bug 1434 - Make arrays non-mutable

- changed getters, if fields return type is array,
  create local copy and send temporary reference
- constructor which has field of type array,
  save this array by temporary reference

Change-Id: Ifd96bd8f16eabec95409675723d5c13684914e16
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoMerge "Bug 2480: Union objects are generated incorrectly when using bits type"
Robert Varga [Fri, 23 Jan 2015 07:09:26 +0000 (07:09 +0000)]
Merge "Bug 2480: Union objects are generated incorrectly when using bits type"

9 years agoSplit out codecs from BindingCodecContext
Robert Varga [Thu, 22 Jan 2015 20:35:23 +0000 (21:35 +0100)]
Split out codecs from BindingCodecContext

Static inner classes reduce code clarity, so split them out before we
start making changes.

Change-Id: Iba235f74ff13f89c21371c913c76bf3a571499a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2404: RPC and Notification support for Binding Data Codec"
Robert Varga [Thu, 22 Jan 2015 18:31:33 +0000 (18:31 +0000)]
Merge "Bug 2404: RPC and Notification support for Binding Data Codec"

9 years agoFixed incorrect serialization of multiple nested UnionTypes.
Tomas Cere [Wed, 21 Jan 2015 17:59:05 +0000 (18:59 +0100)]
Fixed incorrect serialization of multiple nested UnionTypes.

Change-Id: I2bf4153fc3b931fd6f80f2683b8abb47a1e12c7b
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoMerge "Improve BaseTemplate speed"
Tony Tkacik [Wed, 21 Jan 2015 14:37:52 +0000 (14:37 +0000)]
Merge "Improve BaseTemplate speed"

9 years agoBUG-2606: add support for removing augmentations
Robert Varga [Mon, 19 Jan 2015 16:15:44 +0000 (17:15 +0100)]
BUG-2606: add support for removing augmentations

This patch adds an explicit removeAugmentation() method to the builder.

Change-Id: I2111da008485512930dc2cfe551a787106c5f599
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-2606: formalize the augmentation removal"
Tony Tkacik [Tue, 20 Jan 2015 09:39:18 +0000 (09:39 +0000)]
Merge "BUG-2606: formalize the augmentation removal"

9 years agoBUG-2606: formalize the augmentation removal
Robert Varga [Mon, 19 Jan 2015 16:11:36 +0000 (17:11 +0100)]
BUG-2606: formalize the augmentation removal

Setting an augmentation to null has the same effect as removing it,
when accessing it via getAugmentation(). Formalize this actually
removing the mapping, which is more space-efficient.

Change-Id: I994b459161d9d374c80a353b82763dfb31faaf3d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2606: Fixed serialization of null augmentations."
Robert Varga [Mon, 19 Jan 2015 16:03:04 +0000 (16:03 +0000)]
Merge "Bug 2606: Fixed serialization of null augmentations."

9 years agoBug 2404: RPC and Notification support for Binding Data Codec
Tony Tkacik [Fri, 19 Dec 2014 15:48:14 +0000 (16:48 +0100)]
Bug 2404: RPC and Notification support for Binding Data Codec

Added support for serialization and deserialization of RPC
and Notification data from Binding representation to Normalized
Representation.

Change-Id: I2e071ac1fac9d5f2ac34421f1718dbaa6051975c
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2606: Fixed serialization of null augmentations.
Tony Tkacik [Mon, 19 Jan 2015 14:24:12 +0000 (15:24 +0100)]
Bug 2606: Fixed serialization of null augmentations.

Binding DTO contract allowed to use addAugmentation(T,null)
to remove augmentation, but this was not supported
by binding-data-codec.

Added explicit ommision of null augmentations.

Change-Id: Ib16f3a18e6b09ab970dcaef83e3fca4f490c9ec3
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoRevert "Added generated convenience setters that take Builder<T>"
Robert Varga [Sat, 17 Jan 2015 10:41:18 +0000 (10:41 +0000)]
Revert "Added generated convenience setters that take Builder<T>"

This reverts commit 0bede1b3a817175f7db70fd5347c08c3f0ff1af1, as it breaks
the controller build. The problem is that it breaks current code which passes
in null argument -- which is ambiguous.

Change-Id: Ie6b8882d7790fc21a6a798f3fa94bca40dc71bd5
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdded generated convenience setters that take Builder<T>
Ed Warnicke [Mon, 12 Jan 2015 01:14:53 +0000 (19:14 -0600)]
Added generated convenience setters that take Builder<T>

Basically, if we previously had

FooBuilder.setBar(Bar value)

we now also have

FooBuilder.setBar(Builder<Bar> value)

That just calls value.build() and calls the original setter.

Change-Id: I99e19f7a8a51af5c4a48ecb8813c6e6202546857
Signed-off-by: Ed Warnicke <eaw@cisco.com>
9 years agoImprove BaseTemplate speed
Robert Varga [Fri, 16 Jan 2015 16:53:54 +0000 (17:53 +0100)]
Improve BaseTemplate speed

String processing is sub-optimal in these aspects:
- string-based methods used when character-based ones are available,
- inefficient use of String.replace() for single-character filtering,
- inefficient use of String.replaceAll() where a pre-compiled Pattern
  should be used.
- inefficient use of StringTokenizer where a Splitter can be used

Change-Id: Iee446a4279b9be343891192d93a84a420b32526c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2258: Fixed Type Definition search in runtime generated codecs"
Robert Varga [Fri, 16 Jan 2015 16:40:46 +0000 (16:40 +0000)]
Merge "Bug 2258: Fixed Type Definition search in runtime generated codecs"

9 years agoBug 2480: Union objects are generated incorrectly when using bits type
Martin Ciglan [Wed, 10 Dec 2014 13:29:05 +0000 (14:29 +0100)]
Bug 2480: Union objects are generated incorrectly when using bits type

In case of bits typedef within union, method getValue() returning array
of booleans was missing.

Change-Id: If4b0f98d3889facff819d02f44566e816674528d
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoBug 2258: Fixed Type Definition search in runtime generated codecs
Tony Tkacik [Mon, 27 Oct 2014 13:11:37 +0000 (14:11 +0100)]
Bug 2258: Fixed Type Definition search in runtime generated codecs

Type Definition search in runtime generated codecs, did not look
up nested (scoped) type definitions properly, which resulted
in IllegalArgumentException in schema context update which
prevented further working of codec.

Updated code to perform correct nested search in grouping
and type-definitoions.

Change-Id: I3860c2f70b5e0ba3d265b7f2b032e89eadaced08
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoAdd marker interface Builder<T> to generated Builders
Ed Warnicke [Mon, 5 Jan 2015 23:02:19 +0000 (17:02 -0600)]
Add marker interface Builder<T> to generated Builders

Change-Id: I6e6e7f33143982e4a719ea6d6399947587a627a3
Signed-off-by: Ed Warnicke <eaw@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2159: fix wrong javadocs
Robert Varga [Thu, 15 Jan 2015 21:36:14 +0000 (22:36 +0100)]
BUG-2159: fix wrong javadocs

Java 8 javadoc generation is a lot stricter than previous versions. This
patch fixes the offenders.

Change-Id: I8a6d7f11a8fb38919d5fa34ab01c3a82849bfa8f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2159: make sure generated comments are Java-8-safe
Robert Varga [Fri, 16 Jan 2015 09:47:52 +0000 (10:47 +0100)]
BUG-2159: make sure generated comments are Java-8-safe

The javadoc generator produced output which was not compliant with
default Java 8 javadoc settings. This patch fixes that.

Change-Id: I102e1398d49042d785ce451846aeebc20d5eed58
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Shift Builder<P> from toInstance() to build()"
Robert Varga [Thu, 15 Jan 2015 19:11:48 +0000 (19:11 +0000)]
Merge "Shift Builder<P> from toInstance() to build()"

9 years agoShift Builder<P> from toInstance() to build()
Ed Warnicke [Mon, 12 Jan 2015 00:25:53 +0000 (18:25 -0600)]
Shift Builder<P> from toInstance() to build()

In order to be able to use Builder<P> as a marker
on generated Builders, it needed to shift to build()

All 'internal' uses for Builder have been changed
to use build().  For things used outside of yangtools,
a depracted toInstance() is maintained on child
interfaces/classes.

Change-Id: I43662296e328133a5b5267be54d407e2ad4b95e8
Signed-off-by: Ed Warnicke <eaw@cisco.com>
9 years agoBug 1573: Fixed deserialization of not representable Instance Identifier
Tony Tkacik [Thu, 8 Jan 2015 15:30:59 +0000 (16:30 +0100)]
Bug 1573: Fixed deserialization of not representable Instance Identifier

Not all YangInstanceIdentifier are representable in Binding form,
codecs were designed to handle this and omit such cases,
but one ommision case was missing in deserializing Instance Identifier
without data and this resulted into returning incorrectly
constructed InstanceIdentifier.

Updated test which was testing incorrect behaviour to test correct
behaviour.

Change-Id: I97215f674f7ff164bc2c87d9eef4a254510b0280
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>