mdsal.git
9 years agoMerge "Bug 1512 - generated builder java file for a leaf containing a union"
Tony Tkacik [Mon, 15 Sep 2014 10:45:46 +0000 (10:45 +0000)]
Merge "Bug 1512 - generated builder java file for a leaf containing a union"

9 years agoMerge "BUG-1431: make sure (Yang)InstanceIdentifier is Serializable"
Tony Tkacik [Mon, 15 Sep 2014 10:09:50 +0000 (10:09 +0000)]
Merge "BUG-1431: make sure (Yang)InstanceIdentifier is Serializable"

9 years agoMerge "yangtools cannot release, so fixing it"
Robert Varga [Mon, 15 Sep 2014 10:04:56 +0000 (10:04 +0000)]
Merge "yangtools cannot release, so fixing it"

9 years agoMerge "Bug 1869: Fixed binding-data-codec to work with empty type"
Robert Varga [Mon, 15 Sep 2014 09:47:38 +0000 (09:47 +0000)]
Merge "Bug 1869: Fixed binding-data-codec to work with empty type"

9 years agoBug 1512 - generated builder java file for a leaf containing a union
Ladislav Borak [Fri, 15 Aug 2014 07:41:59 +0000 (09:41 +0200)]
Bug 1512 - generated builder java file for a leaf containing a union

- added clarification for location of builder class for union types
  into javadoc
- remove redundant check in YangTempla.writeRpcInput() and
  YangTemplate.writeRpcOutput() methods
- added return type for GeneratorImpl.printAugmentedNode() method
  (problem to infer return type in recursivecalled method)
- added local set of typedefinitions into
  GeneratorImpl.printSchemaNodeInfo() to to remove error in geterated java
  file

Change-Id: If4ad960a998254868a0347bb836c79aac7dd19d8
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoMerge "Added Nonnull annotation for get operation"
Robert Varga [Mon, 15 Sep 2014 09:39:03 +0000 (09:39 +0000)]
Merge "Added Nonnull annotation for get operation"

9 years agoyangtools cannot release, so fixing it
Giovanni Meo [Fri, 5 Sep 2014 15:50:19 +0000 (17:50 +0200)]
yangtools cannot release, so fixing it

- yangtools cannot release because the projetc.version dependency in
  dependency management keep changing with the project that includes it,
  so fixing it
- restconf dependency and other version should not be duplicated in
  multiple poms
- the version property in the common/parent/pom.xml file need to be
  the authoritative versions else the features file cannot relay on it

Change-Id: Ic99c1f3818efbdf6ff9c514d4c842164d4228fc4
Signed-off-by: Giovanni Meo <gmeo@cisco.com>
9 years agoMerge "very basic tests for yang-binding-util"
Robert Varga [Mon, 15 Sep 2014 09:36:01 +0000 (09:36 +0000)]
Merge "very basic tests for yang-binding-util"

9 years agoBUG-1431: make sure (Yang)InstanceIdentifier is Serializable
Robert Varga [Sat, 13 Sep 2014 14:25:51 +0000 (16:25 +0200)]
BUG-1431: make sure (Yang)InstanceIdentifier is Serializable

This works around the fact that an Iterable cannot be serialized by
forcing instantiation of the legacy path. The read side then just does
the opposite.

For InstanceIdentifier the situation is similar, except we perform the
writeout/read-in ourselves.

Bumps the serialization format for InstanceIdentifier and
YangInstanceIdentifier to 2 and 3 respectively.

Change-Id: I668e2aeebde20b99cfe3b41594b3925697295d05
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 1869: Fixed binding-data-codec to work with empty type
Tony Tkacik [Mon, 15 Sep 2014 08:39:43 +0000 (10:39 +0200)]
Bug 1869: Fixed binding-data-codec to work with empty type

Empty type is special case, which does not contain value,
but has only presence characteristic and in Binding Specification v1
it was converted to boolean (true = present, false or null not present)
but new codecs did not have that special handling for empty type
which caused some models to fail.

Fixed places affected by this bug and added test case which now
explicitly tests empty type support.

Change-Id: Idec541dc9da987cebcd46ee65d24c17b7cf9a567
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "BUG-865: migrate tests to use BindingGeneratorImpl(boolean)"
Tony Tkacik [Fri, 12 Sep 2014 11:11:13 +0000 (11:11 +0000)]
Merge "BUG-865: migrate tests to use BindingGeneratorImpl(boolean)"

9 years agovery basic tests for yang-binding-util
Peter Bandzi [Thu, 11 Sep 2014 12:04:41 +0000 (14:04 +0200)]
very basic tests for yang-binding-util

Change-Id: I7f5b646062dcb3619cd7912d37ef8574db56c5c6
Signed-off-by: Peter Bandzi <pbandzi@cisco.com>
9 years agoMerge "BUG-1794: use QName.cachedReference in static references"
Tony Tkacik [Thu, 11 Sep 2014 09:10:34 +0000 (09:10 +0000)]
Merge "BUG-1794: use QName.cachedReference in static references"

9 years agoBUG-865: migrate tests to use BindingGeneratorImpl(boolean)
Robert Varga [Wed, 10 Sep 2014 19:35:13 +0000 (21:35 +0200)]
BUG-865: migrate tests to use BindingGeneratorImpl(boolean)

The implicit constructor has been deprecated due to optional 'verbose'
descriptions functionality. This migrates some old users while retaining
the same functionality.

Change-Id: Ic856b273487472b5632319806650ec22e8843403
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1794: use QName.cachedReference in static references
Robert Varga [Wed, 10 Sep 2014 19:31:26 +0000 (21:31 +0200)]
BUG-1794: use QName.cachedReference in static references

When we emit generated classes, we add a static final reference to a
QName created via the usual string factory method. This leads to
less-than-optimal string sharing, so we go through a cachedReference
initializer to make sure we get maximum resource sharing.

Change-Id: Id75286410be4883736164c504dd6cb8f9d26383a
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 1698: Updated handling of choice node inside choice node"
Robert Varga [Tue, 9 Sep 2014 13:02:51 +0000 (13:02 +0000)]
Merge "Bug 1698: Updated handling of choice node inside choice node"

9 years agoBug 1698: Updated handling of choice node inside choice node
Tony Tkacik [Tue, 9 Sep 2014 12:18:16 +0000 (14:18 +0200)]
Bug 1698: Updated handling of choice node inside choice node

As it turned out, Composite Node to Binding codec
had problem with handling situations, where case
was augmented to choice and that case contained
another choice directly on first level.

Updated code to detect this situation and do proper lookup
to find choice in case in choice.

Change-Id: I2c39542520b842857884468dc0dcd28502ff41b3
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 1672 - Generated javadoc contains symbols of javadoc comment tags"
Tony Tkacik [Mon, 8 Sep 2014 08:42:39 +0000 (08:42 +0000)]
Merge "Bug 1672 - Generated javadoc contains symbols of javadoc comment tags"

9 years agoBug 1672 - Generated javadoc contains symbols of javadoc comment tags
Ladislav Borak [Wed, 3 Sep 2014 13:16:40 +0000 (15:16 +0200)]
Bug 1672 - Generated javadoc contains symbols of javadoc comment tags

- added extension method into BaseTemplate to replace javadoc comment tags
  in description:
  used &#42;&#47; instaed of */

Change-Id: I754812fac0be45d037fe3a65c60c63c11150b5c8
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoAdded Nonnull annotation for get operation
Lukas Sedlak [Fri, 5 Sep 2014 08:36:27 +0000 (10:36 +0200)]
Added Nonnull annotation for get operation

Added Nonnull annotation for get operation in NodeContextSupplier to harden contract and
preventing of retrieving null reference from get method.

Change-Id: Ibcd8e601d5eec2bf192f8d3c779c7bab668d3a26
Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
9 years agoMerge "Added safe copy of array."
Tony Tkacik [Fri, 5 Sep 2014 07:55:28 +0000 (07:55 +0000)]
Merge "Added safe copy of array."

9 years agoAdded safe copy of array.
Lukas Sedlak [Thu, 4 Sep 2014 13:25:48 +0000 (15:25 +0200)]
Added safe copy of array.

In class c-tor ParametrizedTypeImpl added safe copy of Types array instead of direct assigment.

Change-Id: I31c5f62faeca76238701465ca71f72e76f4d0701
Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
9 years agoMerge changes I55667cbb,I94073183,Ib87cc0ec
Tony Tkacik [Wed, 3 Sep 2014 14:06:19 +0000 (14:06 +0000)]
Merge changes I55667cbb,I94073183,Ib87cc0ec

* changes:
  BUG-1668: make sure we preserve schema key order
  Make PathArgument cache its hashCode()
  JSONNormalizedNodeStreamWriter: unify constructors

9 years agoBUG-1668: make sure we preserve schema key order
Robert Varga [Wed, 3 Sep 2014 13:23:15 +0000 (15:23 +0200)]
BUG-1668: make sure we preserve schema key order

Fixes up callers to preserve key ordering as defined by schema, or as
passed in from external components.

At the same time fixes the parser to not emit duplicate entries into the
key list.

Change-Id: I55667cbb9ea0609d879b38452c6c98fcbd8b2e7e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRevert "Bug 1478 - Autoboxing support"
Tony Tkacik [Tue, 2 Sep 2014 12:37:20 +0000 (12:37 +0000)]
Revert "Bug 1478 - Autoboxing support"

Autoboxing support did not compiled properly with
extensive uses of cases and grouping.

This was found in integration with models
from other projects.

This reverts commit 473b1615dd9b523b96aef8b92424e7664eb7c089.

Change-Id: I65eee5078ca856f16d5740b7507bfade6c6aeadc
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 1478 - Autoboxing support"
Tony Tkacik [Mon, 1 Sep 2014 19:54:27 +0000 (19:54 +0000)]
Merge "Bug 1478 - Autoboxing support"

9 years agoMerge "Improve TypeProviderImpl.sortTypeDefinitionAccordingDepth()"
Tony Tkacik [Mon, 1 Sep 2014 18:35:57 +0000 (18:35 +0000)]
Merge "Improve TypeProviderImpl.sortTypeDefinitionAccordingDepth()"

9 years agoBug 1443: Make sure that LazyDataObject hashCode computation is consistent
Tony Tkacik [Wed, 20 Aug 2014 15:17:02 +0000 (17:17 +0200)]
Bug 1443: Make sure that LazyDataObject hashCode computation is consistent

Change-Id: Ib430dabc445975c02d6176e23e4fb9c85b43f906
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 1478 - Autoboxing support
Ladislav Borak [Wed, 6 Aug 2014 12:48:49 +0000 (14:48 +0200)]
Bug 1478 - Autoboxing support

Change-Id: Id9c812f238c16d6bae2894364a366f6781a986e3
Signed-off-by: Ladislav Borak <lborak@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove explicit final keywords
Robert Varga [Fri, 29 Aug 2014 21:47:37 +0000 (23:47 +0200)]
Remove explicit final keywords

These context use the filan modifier needlessly, so remove them to get
rid of sonar warnings.

Change-Id: I1ec3133c3978b0cfaa31c74ba57393ff9973ddc6
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoIdentifiableItemCodec should be a static inner class
Robert Varga [Fri, 29 Aug 2014 21:26:53 +0000 (23:26 +0200)]
IdentifiableItemCodec should be a static inner class

Headline really says it all. There is no reason for
IdentifiableItemCodec to be non-static.

Change-Id: I713625dbea7201a9f11d5431d81584528ddb74aa
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-576: fixed possible null pointer dereference in BindingGeneratorImpl"
Robert Varga [Fri, 29 Aug 2014 20:54:16 +0000 (20:54 +0000)]
Merge "BUG-576: fixed possible null pointer dereference in BindingGeneratorImpl"

9 years agoMerge "BUG-1433: augmentation field visibility changed to default"
Robert Varga [Fri, 29 Aug 2014 20:52:17 +0000 (20:52 +0000)]
Merge "BUG-1433: augmentation field visibility changed to default"

9 years agoMerge "Bug 1505 - Provide test coverage for binding-data-codec using sal-test-model"
Tony Tkacik [Thu, 28 Aug 2014 16:19:22 +0000 (16:19 +0000)]
Merge "Bug 1505 - Provide test coverage for binding-data-codec using sal-test-model"

9 years agoMerge "BUG-576: added support for handling nested groupings in code generator."
Tony Tkacik [Thu, 28 Aug 2014 14:39:35 +0000 (14:39 +0000)]
Merge "BUG-576: added support for handling nested groupings in code generator."

9 years agoMerge "BUG-576: fixed invalid if conditions in LazyGeneratedCodecRegistry."
Tony Tkacik [Thu, 28 Aug 2014 14:39:09 +0000 (14:39 +0000)]
Merge "BUG-576: fixed invalid if conditions in LazyGeneratedCodecRegistry."

9 years agoMerge "BUG-576: fixed test sources loading in YangModuleInfoCompilationTest."
Tony Tkacik [Thu, 28 Aug 2014 12:18:31 +0000 (12:18 +0000)]
Merge "BUG-576: fixed test sources loading in YangModuleInfoCompilationTest."

9 years agoBUG-576: fixed invalid if conditions in LazyGeneratedCodecRegistry.
Martin Vitez [Thu, 28 Aug 2014 09:03:39 +0000 (11:03 +0200)]
BUG-576: fixed invalid if conditions in LazyGeneratedCodecRegistry.

1. fixed check to 'previous instanceof DataNodeContainer' - this check always return true
2. fixed incorrect equals parameter: expected URI but was QName

Change-Id: Ib67ac5b1fc87296bcaa117e9bf1d5f04185c367b
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoImprove TypeProviderImpl.sortTypeDefinitionAccordingDepth()
Robert Varga [Mon, 25 Aug 2014 20:13:20 +0000 (22:13 +0200)]
Improve TypeProviderImpl.sortTypeDefinitionAccordingDepth()

Follow-up patch to . We do not actually need the key, so just use
values() instead of full entries.

Change-Id: Ibb5679bdf0caca140d73eb9ef065db6a58505532
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 1505 - Provide test coverage for binding-data-codec using
Jan Hajnar [Thu, 21 Aug 2014 13:07:33 +0000 (15:07 +0200)]
Bug 1505 - Provide test coverage for binding-data-codec using
sal-test-model

* added test yang modules to bindig-test-model
* added tests for serialization/deserialization of normalized nodes and
paths to binding-data-codec

Change-Id: Ibdf24dd9e51281be488fb40481a79d6f086a2115
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoBUG-576: fixed test sources loading in YangModuleInfoCompilationTest.
Martin Vitez [Wed, 27 Aug 2014 08:42:57 +0000 (10:42 +0200)]
BUG-576: fixed test sources loading in YangModuleInfoCompilationTest.

Fixed test to parse File sources with relative test.

Change-Id: I4af05166a2c26cf4a3f673b1651ac28c717dd43e
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge "Bug 1630: Updated normalized to binding codec to exclude LeafSetEntryNode."
Tony Tkacik [Wed, 27 Aug 2014 14:19:24 +0000 (14:19 +0000)]
Merge "Bug 1630: Updated normalized to binding codec to exclude LeafSetEntryNode."

9 years agoBug 1630: Updated normalized to binding codec to exclude LeafSetEntryNode.
Tony Tkacik [Wed, 27 Aug 2014 14:12:44 +0000 (16:12 +0200)]
Bug 1630: Updated normalized to binding codec to exclude LeafSetEntryNode.

Change-Id: I8d921ed8d03e19a3fb9868ef9a0a8ebecb02563c
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-1630: fix warning message format
Robert Varga [Wed, 27 Aug 2014 12:15:28 +0000 (14:15 +0200)]
BUG-1630: fix warning message format

The bug has been reasolved by change
I4a35ff27725dab7f35b83ae1bcc6d728a313bd1c, this patch just fixes the
message format.

Change-Id: Ic77f0675c8adb1c6d2ba29ea555335e7eaba4a34
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-650: add missing bypass"
Tony Tkacik [Wed, 27 Aug 2014 12:09:12 +0000 (12:09 +0000)]
Merge "BUG-650: add missing bypass"

9 years agoMerge "BUG-650: improve toYangInstanceIdentifier() speed"
Tony Tkacik [Wed, 27 Aug 2014 11:19:25 +0000 (11:19 +0000)]
Merge "BUG-650: improve toYangInstanceIdentifier() speed"

9 years agoBUG-650: add missing bypass
Robert Varga [Wed, 27 Aug 2014 10:29:55 +0000 (12:29 +0200)]
BUG-650: add missing bypass

ChoiceNode is not representable either, so check for it early. Also
eliminate the FIXME, now that we are in the clear about what needs to
happen. Finally log offending class in warning, so we can track it down.

Change-Id: I4a35ff27725dab7f35b83ae1bcc6d728a313bd1c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 1443: Added support for misplaced augmentations."
Lukas Sedlak [Wed, 27 Aug 2014 09:11:08 +0000 (09:11 +0000)]
Merge "Bug 1443: Added support for misplaced augmentations."

9 years agoBug 1443: Added support for misplaced augmentations.
Tony Tkacik [Tue, 26 Aug 2014 11:35:22 +0000 (13:35 +0200)]
Bug 1443: Added support for misplaced augmentations.

Binding Specification reuses elements inside groupings
as part of normal data tree. Augmentations and augmented
cases could be copied by user using copy builders
and may be used at incorrect place, where augmentation
with same data is present.

Binding Data Codec will treat this augmentations as
same, if augmentation definining same data subtree
is present at real location.

Change-Id: Ie232ef9b5e5bbe84f5562bfce612d8ea03b9a9a5
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-650: improve toYangInstanceIdentifier() speed
Robert Varga [Tue, 26 Aug 2014 20:06:01 +0000 (22:06 +0200)]
BUG-650: improve toYangInstanceIdentifier() speed

This removes a superfluous call to getCodecContextNode(), since that
call is already performed by the InstanceIdentifierCodec.

Change-Id: I2077e70517adf6795f805b6c37c0a7e29b4fb9e5
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-650: clarify BindingNormalizedNodeSerializer API contract
Robert Varga [Tue, 26 Aug 2014 19:55:22 +0000 (21:55 +0200)]
BUG-650: clarify BindingNormalizedNodeSerializer API contract

Non-representable YangInstanceIdentifiers are properly reported via a
null return instead of raising an undocumented IllegalArgumentException.

Also does some implementation house-cleaning geared towards performance,
as ArrayList gives better locality.

Change-Id: Iea4717c19587fd2cc1e403aae4c5967811240e9a
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unused arguments from UnionTypeCodec.loader()
Robert Varga [Tue, 26 Aug 2014 18:42:17 +0000 (20:42 +0200)]
Remove unused arguments from UnionTypeCodec.loader()

The two codecs passed in were unused, so remove them, fix the callsite
and remove the useless warnings suppression.

Change-Id: Ib3d052109303c1c18f9a4d58d2eafeefea37caba
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoUnionTypeCodec should not throw raw Exception
Robert Varga [Tue, 26 Aug 2014 18:39:29 +0000 (20:39 +0200)]
UnionTypeCodec should not throw raw Exception

This is a callable, and we know what types of exceptions can be thrown,
so get rid of the implied sonar warning.

Change-Id: Iab62d6749cd1d33096297c2072e02c42ddebd878
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-865: removed use of deprecated YangInstanceIdentifier.getPath method"
Robert Varga [Tue, 26 Aug 2014 18:30:56 +0000 (18:30 +0000)]
Merge "BUG-865: removed use of deprecated YangInstanceIdentifier.getPath method"

9 years agoMerge "Bug 1505 - Added test model and instance identifier test for augmentations"
Robert Varga [Tue, 26 Aug 2014 18:29:06 +0000 (18:29 +0000)]
Merge "Bug 1505 - Added test model and instance identifier test for augmentations"

9 years agoBUG-576: added support for handling nested groupings in code generator.
Martin Vitez [Tue, 26 Aug 2014 15:30:45 +0000 (17:30 +0200)]
BUG-576: added support for handling nested groupings in code generator.

Failing example (causing NullPointerException):

container foo {
  grouping bar {}
  uses bar;
}

Added call to resolve groupings before resolving uses.

Change-Id: I171b3bbdd26feaf67c3488a55e7d9e3b6ec4a915
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge "BUG-869: fixed code style violations in TypeProviderImpl reported by Sonar"
Tony Tkacik [Tue, 26 Aug 2014 14:06:22 +0000 (14:06 +0000)]
Merge "BUG-869: fixed code style violations in TypeProviderImpl reported by Sonar"

9 years agoBug 1505 - Added test model and instance identifier test for augmentations
Tony Tkacik [Tue, 26 Aug 2014 11:33:02 +0000 (13:33 +0200)]
Bug 1505 - Added test model and instance identifier test for augmentations

Added binding-test-model, which contains models for unit testing
and integration testing of binding runtime components such as binding-data-codec.

Change-Id: Ib8219252eec5c2e1b4ddda806bea7367b7c41f9b
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-865: removed use of deprecated YangInstanceIdentifier.getPath method
Martin Vitez [Tue, 26 Aug 2014 12:17:27 +0000 (14:17 +0200)]
BUG-865: removed use of deprecated YangInstanceIdentifier.getPath method

Change-Id: I4f95e92173cc062deeea5ca0174a110126f43613
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-576: fixed possible null pointer dereference in BindingGeneratorImpl
Martin Vitez [Tue, 26 Aug 2014 11:28:58 +0000 (13:28 +0200)]
BUG-576: fixed possible null pointer dereference in BindingGeneratorImpl

Possible null pointer dereference of resultTOBuilder.

Change-Id: I5f50f1ca0fb19d7310e5278f8f6915e6dd180723
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-869: fixed code style violations in TypeProviderImpl reported by Sonar
Martin Vitez [Tue, 26 Aug 2014 10:33:42 +0000 (12:33 +0200)]
BUG-869: fixed code style violations in TypeProviderImpl reported by Sonar

Change-Id: Ica2e34c2157c48f44227f66042fff444fd56105a
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoFixed breakage of uses generation in Binding
Tony Tkacik [Mon, 25 Aug 2014 13:08:10 +0000 (15:08 +0200)]
Fixed breakage of uses generation in Binding

Change-Id: I0913de13f426906ca8fd2f5e131b022444194648
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "BUG-1537: improved YangModuleInfo."
Tony Tkacik [Mon, 25 Aug 2014 10:32:33 +0000 (10:32 +0000)]
Merge "BUG-1537: improved YangModuleInfo."

9 years agoMerge changes If1e9a750,Ib530560c,Id01393c3,I2d375382,Id60447ef,I350611fb,I0dbd80db
Tony Tkacik [Mon, 25 Aug 2014 10:25:30 +0000 (10:25 +0000)]
Merge changes If1e9a750,Ib530560c,Id01393c3,I2d375382,Id60447ef,I350611fb,I0dbd80db

* changes:
  BUG-1611: make sure runtime components create short comments
  BUG-1611: force maven plugin generating verbose comments
  BUG-1611: make verbose comments optional
  BUG-1611: use CharMatcher to remove characters
  BUG-1611: drop a FIXME for thread-safety
  BUG-1611: do not instantiate splitters needlessly
  BUG-1611: fix SimpleDateFormat

9 years agoMerge "BUG-1605: Fixup yang-data-api interface"
Tony Tkacik [Mon, 25 Aug 2014 07:59:30 +0000 (07:59 +0000)]
Merge "BUG-1605: Fixup yang-data-api interface"

9 years agoMerge "BUG-1605: Fix yang-binding interfaces"
Tony Tkacik [Mon, 25 Aug 2014 07:59:24 +0000 (07:59 +0000)]
Merge "BUG-1605: Fix yang-binding interfaces"

9 years agoBUG-1611: make sure runtime components create short comments
Robert Varga [Sun, 24 Aug 2014 20:12:09 +0000 (22:12 +0200)]
BUG-1611: make sure runtime components create short comments

The two instantiations here are performance-critical at runtime, and the
comments in them get discarded. Let us not waste time generating them.

Change-Id: If1e9a7507dac5b07011d3a9bcc75e42fbff340e1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1611: force maven plugin generating verbose comments
Robert Varga [Sun, 24 Aug 2014 20:07:36 +0000 (22:07 +0200)]
BUG-1611: force maven plugin generating verbose comments

This just makes sure we are explicit about what we are creating.

Change-Id: Ib530560c11e7f529345085eecf43a9f6f2e6d1a6
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1611: make verbose comments optional
Robert Varga [Sun, 24 Aug 2014 20:03:35 +0000 (22:03 +0200)]
BUG-1611: make verbose comments optional

Make sure the yang snippets are completely optional. The default still
includes them.

Change-Id: Id01393c384add733c42baf6c02a153ef388bb628
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1611: use CharMatcher to remove characters
Robert Varga [Sun, 24 Aug 2014 19:44:32 +0000 (21:44 +0200)]
BUG-1611: use CharMatcher to remove characters

Instead of compiling the patterns, use a CharMatcher, which is much
faster.

Change-Id: I2d3753824c63d3dece7af6f051f09c644cfdbf34
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1611: drop a FIXME for thread-safety
Robert Varga [Sun, 24 Aug 2014 19:40:00 +0000 (21:40 +0200)]
BUG-1611: drop a FIXME for thread-safety

Caching a module means the class is not safe for use from multiple
threads.

Change-Id: Id60447efe4dbae4b65748b99870bd75b70b6fcc8
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1611: do not instantiate splitters needlessly
Robert Varga [Sun, 24 Aug 2014 19:33:34 +0000 (21:33 +0200)]
BUG-1611: do not instantiate splitters needlessly

The two splitters can be easily shared -- so do that instead of
instantiating them.

Change-Id: I350611fb5985b4336018562012526ca1910bb9a2
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1611: fix SimpleDateFormat
Robert Varga [Sun, 24 Aug 2014 19:32:35 +0000 (21:32 +0200)]
BUG-1611: fix SimpleDateFormat

The format used is incirrect and it makes no sense to instantiate the
utility all over again. Use the yang-common utility instead.

Change-Id: I0dbd80db6726aeb80e6666a330964d58bc08455c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1605: Fixup yang-data-api interface
Robert Varga [Fri, 22 Aug 2014 17:27:48 +0000 (19:27 +0200)]
BUG-1605: Fixup yang-data-api interface

Now that the binding interface is ready to handle IOExceptions, adjust
the data-api interface and implementations. At the same time we update
the binding world to forward calls to flush().

Change-Id: I8a4cff13123d618634dcd61587a2432d3d49ae8b
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1605: Fix yang-binding interfaces
Robert Varga [Fri, 22 Aug 2014 17:42:23 +0000 (19:42 +0200)]
BUG-1605: Fix yang-binding interfaces

This is the frontend piece visible from Binding world. The
implementation relies of the data.api mechanics, so it needs to be
prepared first.

Change-Id: I4694f74e993bbfa9c84578dee04fdd49b87453b7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1537: improved YangModuleInfo.
Martin Vitez [Thu, 21 Aug 2014 13:14:41 +0000 (15:14 +0200)]
BUG-1537: improved YangModuleInfo.

YangModuleInfo is generated also for submodules in form as inner class in YangModuleInfo class of
module to which it belongs. Method YangModuleInfo.getImportedModules() returns also YangModuleInfo
classes of submodules which this module includes.
Added getSubmodules() method to Module interface.
Added test.

Change-Id: Id949835d960eee3197d249f7a83be2975a63d6b3
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge "Fix ordering fields in generated type builder"
Tony Tkacik [Thu, 21 Aug 2014 13:45:11 +0000 (13:45 +0000)]
Merge "Fix ordering fields in generated type builder"

9 years agoMerge "BUG-1425: fix LazyDataObject.toString()"
Tony Tkacik [Thu, 21 Aug 2014 13:41:54 +0000 (13:41 +0000)]
Merge "BUG-1425: fix LazyDataObject.toString()"

9 years agoMerge "add new tests BindingTypesTest, BaseYangTypesTest"
Lukas Sedlak [Thu, 21 Aug 2014 09:40:51 +0000 (09:40 +0000)]
Merge "add new tests BindingTypesTest, BaseYangTypesTest"

9 years agoMerge "BUG-1382: eliminate QName.getPrefix() from GeneratorImpl.xtend"
Robert Varga [Thu, 21 Aug 2014 09:24:23 +0000 (09:24 +0000)]
Merge "BUG-1382: eliminate QName.getPrefix() from GeneratorImpl.xtend"

9 years agoBUG-1425: fix LazyDataObject.toString()
Robert Varga [Tue, 12 Aug 2014 05:32:07 +0000 (07:32 +0200)]
BUG-1425: fix LazyDataObject.toString()

A major usability improvement is skipping of null fields, as dumping
them adds quite a bit of verbosity to logs.

Change-Id: I94c030f11505718ee48b0e3f4556587a85f8f4e4
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 1443: Fixed incorrect throw of IllegalArgumentException in getAugmentation
Tony Tkacik [Wed, 20 Aug 2014 08:55:10 +0000 (10:55 +0200)]
Bug 1443: Fixed incorrect throw of IllegalArgumentException in getAugmentation

Change-Id: If58292afba9c634fb4368f70d541d4a7cdf02cf6
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-1382: eliminate QName.getPrefix() from GeneratorImpl.xtend
Martin Vitez [Wed, 20 Aug 2014 09:58:55 +0000 (11:58 +0200)]
BUG-1382: eliminate QName.getPrefix() from GeneratorImpl.xtend

Change-Id: Ie5fdaf7fc7389c13af8aa591bf9531ed26cb11a9
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoadd new tests BindingTypesTest, BaseYangTypesTest
Peter Bandzi [Tue, 19 Aug 2014 08:37:53 +0000 (10:37 +0200)]
add new tests BindingTypesTest, BaseYangTypesTest

Signed-off-by: Peter Bandzi <pbandzi@cisco.com>
Change-Id: I289a15eb735c12d4664ff68e73c6e2fc830c6f20

9 years agoMerge "Bug 1531: Fixed incorrect use of leaf types in BindingGeneratorImpl"
Robert Varga [Tue, 19 Aug 2014 11:14:19 +0000 (11:14 +0000)]
Merge "Bug 1531: Fixed incorrect use of leaf types in BindingGeneratorImpl"

9 years agoBUG-1433: augmentation field visibility changed to default
Martin Vitez [Tue, 19 Aug 2014 11:02:45 +0000 (13:02 +0200)]
BUG-1433: augmentation field visibility changed to default

Visibility of augmentation field in builder classes changed from private to default.

Change-Id: I0147399428a2127452489eb7d74758d674a26859
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBug 1531: Fixed incorrect use of leaf types in BindingGeneratorImpl
Tony Tkacik [Tue, 19 Aug 2014 09:39:45 +0000 (11:39 +0200)]
Bug 1531: Fixed incorrect use of leaf types in BindingGeneratorImpl

Change-Id: Id420d1e2b8aadcf0061fcf87910b749e9be89c04
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-1382: eliminate QName.getPrefix() from binding-generator-impl.
Martin Vitez [Tue, 19 Aug 2014 09:11:41 +0000 (11:11 +0200)]
BUG-1382: eliminate QName.getPrefix() from binding-generator-impl.

Change-Id: Idce1e0efe18c6034ec036794007ea2716799d889
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge "BUG-1555: skip choices which are not valid in a particular context"
Tony Tkacik [Tue, 19 Aug 2014 07:14:04 +0000 (07:14 +0000)]
Merge "BUG-1555: skip choices which are not valid in a particular context"

9 years agoBUG-1555: skip choices which are not valid in a particular context
Robert Varga [Mon, 18 Aug 2014 11:44:43 +0000 (13:44 +0200)]
BUG-1555: skip choices which are not valid in a particular context

We are enumerating the use of a case in all the possible contexts, which
may partially fail. Instead of failing completely, just skip the
offending case.

Change-Id: Icbf137266784e0f469a258b2bb312db4e01bd8f6
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix Precondition formatting
Robert Varga [Thu, 14 Aug 2014 19:47:59 +0000 (21:47 +0200)]
Fix Precondition formatting

Preconditions need to be formatted just like String.format().

Change-Id: I4011a6cc6a5f5cb7b0460885d956f775ff45d97c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix ordering fields in generated type builder
Ladislav Borak [Fri, 8 Aug 2014 13:38:38 +0000 (15:38 +0200)]
Fix ordering fields in generated type builder

Methods is sorted alphabetically to make the order of evaluation
predictable.

Change-Id: Ie1171a78a17e6eab71b629411f0b0a1bb1807d7d
Signed-off-by: Ladislav Borak <lborak@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix conflict on Object definition
Robert Varga [Wed, 13 Aug 2014 12:49:59 +0000 (14:49 +0200)]
Fix conflict on Object definition

The use of Object (in the java.lang sense) is not working with models
which contain a 'container object' or similar. The fix is to not use a
temporary variable.

Change-Id: I98b3bde9a04d5f33a51a0add107829ad92d35907
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1425: fix builder's implementation of equals()
Robert Varga [Mon, 11 Aug 2014 21:39:36 +0000 (23:39 +0200)]
BUG-1425: fix builder's implementation of equals()

With the advent of LazyDataObject, we have two implementation which need
to compare as equal. LazyObject.equals(builderObject) already works, but
we need the revers to be true, too. This patch sets out to do exactly
that.

Change-Id: I931f66a9088451524a842f6a67e8492ac922fd3d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-1425: fix toString() invocation on LazyObject"
Lukas Sedlak [Mon, 11 Aug 2014 14:23:29 +0000 (14:23 +0000)]
Merge "BUG-1425: fix toString() invocation on LazyObject"

9 years agoBUG-1425: fix toString() invocation on LazyObject
Robert Varga [Mon, 11 Aug 2014 14:02:28 +0000 (16:02 +0200)]
BUG-1425: fix toString() invocation on LazyObject

When we are coming in from toString(), the proxy invocation does not
work. Extract getAugmentations() into a private method and use that
instead.

Change-Id: Ia851560b7703817f6d75887fa7e80037292e3fd1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 1443: Implemented Lazy deserialization using dynamic proxies
Tony Tkacik [Thu, 7 Aug 2014 17:06:17 +0000 (19:06 +0200)]
Bug 1443: Implemented Lazy deserialization using dynamic proxies

Result objects from translation from NormalizedNode to Binding Data
are lazily deserialized and initial cost of deserialization
is only one allocation.

Nested data are lazily deserialized once they are accessed.
This decreases time spent on eager deserialization of data
which never was accessed.

Implementation is mostly carried out in
LazyDataObject - InvocationHandler which maps proxy, data and codec
DataContainerPrototype - Prototype of DataContainerContext,
which holds only neccessary information to instantiate real context
DataObjectCodecContext - Context which holds various mapping
required for serialization / deserialization of data.

Also renames AugmentationNode to AugmentationNodeContext to keep naming
consistent and hides it from outside world, as it is
implementation-specific detail.

Change-Id: I94d994277bd0319e9aabcf842e0a741871713a30
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 1443: Added support for Union type & OSGI Runtime
Tony Tkacik [Wed, 6 Aug 2014 13:02:05 +0000 (15:02 +0200)]
Bug 1443: Added support for Union type & OSGI Runtime

Introduced new marker interface SchemaUnawareCodec
which marks codecs for simple value types,
which are unaffected by introduction of new modules
(practically everything except union, instance identifier
 and identity codecs). Reworked caching to cache only these
codecs.

Added integration with OSGI, which ensures proper class loading
and updates Javassist classpool if necessary.

Updated ModuleContext to not populate type to schema fields
with empty augmentations, which are undetectable in
data tree.

Change-Id: I2a2c8477e9fdc2ef53bd9f81956023c0760d620e
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 1372 - toString methods in generated classes"
Tony Tkacik [Fri, 8 Aug 2014 07:20:19 +0000 (07:20 +0000)]
Merge "Bug 1372 - toString methods in generated classes"

9 years agoMerge "BUG-1436: deprecate IntermediateMapping"
Tony Tkacik [Thu, 7 Aug 2014 20:16:41 +0000 (20:16 +0000)]
Merge "BUG-1436: deprecate IntermediateMapping"