Martin Ciglan [Fri, 10 Oct 2014 08:45:07 +0000 (10:45 +0200)]
Bug 584: GeneratedTOBuilder test coverage increase
Change-Id: Ifb6d377a6d1911f2f12bb178efdea8809916c26a
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
Lukas Sedlak [Fri, 5 Sep 2014 08:58:14 +0000 (10:58 +0200)]
Added Test suite for testing of TypeProviderImpl.
Removed commented out blocks of code from TypeProviderImpl.
Fixed invalid typecast in getTypeDefaultConstruction(LeafSchemaNode, defaultValue) in else branch of BitsTypeDefinition processing. The parent value is of type ModuleImpl which cannot
be cast to SchemaNode as originaly was. Instead of we can extract QName direclty from parent value -> no need to typecast at all.
Fixed leafrefToDef method in TypeProviderImpl. This method will now process defaultValue from method parameter instead of parent node. Method leafrefToDef has been called only via getTypeDefaultConstruction(LeafSchemaNode, defaultValue) method where default value has been added implicitly. In case that user calls getTypeDefaultConstruction for leafref schema node
and specifies defaultValue as parameter and not in yang model the method will throw exception. Now behaviour of leafrefToDef depends only and only on parameter passed in getTypeDefaultConstruction.
Created TypeProviderTest which contains whole test suite for testing of TypeProviderImpl class.
TestIntegerTypeDefinition is mock implementation of IntegerTypeDefinition in order to testing null references returned by TypeDefinition object.
TypeProviderModel contains methods for provisiononing of YANG test models from test/resources folder.
Created Mock implementations of LeafrefTypeWithNullToStringInXpath, LeafrefTypeWithNullXpath, TestIntegerTypeDefinition and TestLeafSchemaNode designated
to increase branch coverage in tests and provide fail scenarios.
Change-Id: I5599c9b1e8f02a8553fab27c1771e32f88c38bc6
Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
Ladislav Borak [Tue, 12 Aug 2014 09:36:09 +0000 (11:36 +0200)]
Bug 1423 - Yangtools parser allows 2 cases with same child elements
- added check in YangParserImpl if two choice cases childs are same
- rework printSchemaNodeInfo() in GeneratorImpl.xtend, where was
problem after generating java file with uncompatible types Set<TypeDefinition<? extends Object>>
instead of Set<TypeDefinition<?>>, problem was fixed adding another
variable with correct type.
Change-Id: I0a612ea9143c6f29ffe3a8ceef7e703136157641
Signed-off-by: Ladislav Borak <lborak@cisco.com>
Tony Tkacik [Wed, 17 Sep 2014 12:45:33 +0000 (14:45 +0200)]
Bug 1906: Fixed bug in Binding leafref to union codec
In models, where leafref was used to reference type, incorrect
codec (EncapsulatedValueCodec) was used for all cases with
derived type instead of actual codec. EncapsulatedValueCodec
covered most cases except Union and Bits.
Added special handling for leafref, where type definition
for referenced leaf is fetched and codec is used based
on that notion.
Change-Id: Id790554e1e84bcf01179add4f5327a4e7380ebe1
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
(cherry picked from commit
697925b94246e725412b88151ec097c812a65b39)
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 17 Sep 2014 11:46:44 +0000 (13:46 +0200)]
Bump versions for Lithium
Bumps everything to 0.7.0, models get a .7 suffix.
Change-Id: I63d2f6b3782769043b8efa73ef64abe34e57b97a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Mon, 15 Sep 2014 14:52:52 +0000 (14:52 +0000)]
Merge "Bug 576 Fixes of critical issues for YT components"
Lukas Sedlak [Thu, 4 Sep 2014 14:38:23 +0000 (16:38 +0200)]
Bug 576 Fixes of critical issues for YT components
This is fix for https://bugs.opendaylight.org/show_bug.cgi?id=576
Added Nonnull annotations and preconditions checks for annonymous apply methods.
Fixed never reachable if statement in writeValue(final XMLStreamWriter writer, final @Nonnull Node<?> data, final SchemaNode schema) in XmlStreamUtils
since instanceof is doing already null check.
Removed empty if statement in NormalizedNodeContainerModificationStrategy in verifyStructure method.
Removed dead code from in PerRepoTestRunner runnersFromFeatures method.
Change-Id: Icec2a30149a17d8b76497d95ac0054297369e985
Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
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"
Tony Tkacik [Mon, 15 Sep 2014 10:09:50 +0000 (10:09 +0000)]
Merge "BUG-1431: make sure (Yang)InstanceIdentifier is Serializable"
Robert Varga [Mon, 15 Sep 2014 10:04:56 +0000 (10:04 +0000)]
Merge "yangtools cannot release, so fixing it"
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"
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>
Robert Varga [Mon, 15 Sep 2014 09:39:03 +0000 (09:39 +0000)]
Merge "Added Nonnull annotation for get operation"
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>
Robert Varga [Mon, 15 Sep 2014 09:36:01 +0000 (09:36 +0000)]
Merge "very basic tests for yang-binding-util"
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>
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>
Tony Tkacik [Fri, 12 Sep 2014 11:11:13 +0000 (11:11 +0000)]
Merge "BUG-865: migrate tests to use BindingGeneratorImpl(boolean)"
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>
Tony Tkacik [Thu, 11 Sep 2014 09:10:34 +0000 (09:10 +0000)]
Merge "BUG-1794: use QName.cachedReference in static references"
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>
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>
Robert Varga [Tue, 9 Sep 2014 13:02:51 +0000 (13:02 +0000)]
Merge "Bug 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>
Tony Tkacik [Mon, 8 Sep 2014 08:42:39 +0000 (08:42 +0000)]
Merge "Bug 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 */ instaed of */
Change-Id: I754812fac0be45d037fe3a65c60c63c11150b5c8
Signed-off-by: Ladislav Borak <lborak@cisco.com>
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>
Tony Tkacik [Fri, 5 Sep 2014 07:55:28 +0000 (07:55 +0000)]
Merge "Added 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>
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
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>
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>
Tony Tkacik [Mon, 1 Sep 2014 19:54:27 +0000 (19:54 +0000)]
Merge "Bug 1478 - Autoboxing support"
Tony Tkacik [Mon, 1 Sep 2014 18:35:57 +0000 (18:35 +0000)]
Merge "Improve TypeProviderImpl.sortTypeDefinitionAccordingDepth()"
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>
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>
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>
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>
Robert Varga [Fri, 29 Aug 2014 20:54:16 +0000 (20:54 +0000)]
Merge "BUG-576: fixed possible null pointer dereference in BindingGeneratorImpl"
Robert Varga [Fri, 29 Aug 2014 20:52:17 +0000 (20:52 +0000)]
Merge "BUG-1433: augmentation field visibility changed to default"
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"
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."
Tony Tkacik [Thu, 28 Aug 2014 14:39:09 +0000 (14:39 +0000)]
Merge "BUG-576: fixed invalid if conditions in LazyGeneratedCodecRegistry."
Tony Tkacik [Thu, 28 Aug 2014 12:18:31 +0000 (12:18 +0000)]
Merge "BUG-576: fixed test sources loading in YangModuleInfoCompilationTest."
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>
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>
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>
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>
Tony Tkacik [Wed, 27 Aug 2014 14:19:24 +0000 (14:19 +0000)]
Merge "Bug 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>
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>
Tony Tkacik [Wed, 27 Aug 2014 12:09:12 +0000 (12:09 +0000)]
Merge "BUG-650: add missing bypass"
Tony Tkacik [Wed, 27 Aug 2014 11:19:25 +0000 (11:19 +0000)]
Merge "BUG-650: improve toYangInstanceIdentifier() speed"
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>
Lukas Sedlak [Wed, 27 Aug 2014 09:11:08 +0000 (09:11 +0000)]
Merge "Bug 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>
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>
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>
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>
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>
Robert Varga [Tue, 26 Aug 2014 18:30:56 +0000 (18:30 +0000)]
Merge "BUG-865: removed use of deprecated YangInstanceIdentifier.getPath method"
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"
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>
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"
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>
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>
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>
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>
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>
Tony Tkacik [Mon, 25 Aug 2014 10:32:33 +0000 (10:32 +0000)]
Merge "BUG-1537: improved YangModuleInfo."
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
Tony Tkacik [Mon, 25 Aug 2014 07:59:30 +0000 (07:59 +0000)]
Merge "BUG-1605: Fixup yang-data-api interface"
Tony Tkacik [Mon, 25 Aug 2014 07:59:24 +0000 (07:59 +0000)]
Merge "BUG-1605: Fix yang-binding interfaces"
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Tony Tkacik [Thu, 21 Aug 2014 13:45:11 +0000 (13:45 +0000)]
Merge "Fix ordering fields in generated type builder"
Tony Tkacik [Thu, 21 Aug 2014 13:41:54 +0000 (13:41 +0000)]
Merge "BUG-1425: fix LazyDataObject.toString()"
Lukas Sedlak [Thu, 21 Aug 2014 09:40:51 +0000 (09:40 +0000)]
Merge "add new tests BindingTypesTest, BaseYangTypesTest"
Robert Varga [Thu, 21 Aug 2014 09:24:23 +0000 (09:24 +0000)]
Merge "BUG-1382: eliminate QName.getPrefix() from GeneratorImpl.xtend"
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>
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>
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>
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
Robert Varga [Tue, 19 Aug 2014 11:14:19 +0000 (11:14 +0000)]
Merge "Bug 1531: Fixed incorrect use of leaf types in BindingGeneratorImpl"
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>
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>
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>
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"
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>
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>
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>
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>