mdsal.git
9 years agoMerge "Bug 2157 - Race condition when adding a RPC implementation with an output"
Tony Tkacik [Thu, 20 Nov 2014 08:51:58 +0000 (08:51 +0000)]
Merge "Bug 2157 - Race condition when adding a RPC implementation with an output"

9 years agoMerge "Improve InstanceIdentifier.keyOf()"
Tony Tkacik [Thu, 20 Nov 2014 08:44:04 +0000 (08:44 +0000)]
Merge "Improve InstanceIdentifier.keyOf()"

9 years agoImprove InstanceIdentifier.keyOf()
Robert Varga [Wed, 19 Nov 2014 17:04:10 +0000 (18:04 +0100)]
Improve InstanceIdentifier.keyOf()

Rather than throwing a ClassCastException, this documents that the
keyOf() method can throw an IllegalArgumentException.

Change-Id: I5d5b9e10c7329c6bc909b28b07c7bc6500cfcd5a
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2157 - Race condition when adding a RPC implementation with an
Jan Hajnar [Wed, 12 Nov 2014 09:21:03 +0000 (10:21 +0100)]
Bug 2157 - Race condition when adding a RPC implementation with an
output

* added wait for schema in 'getRpcQnamesFor()' method

Change-Id: I2baa71f4237a1125db9a6e5ec8077237dc8ef544
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoMerge "ISIS Yang model compilation issue"
Robert Varga [Mon, 10 Nov 2014 22:05:29 +0000 (22:05 +0000)]
Merge "ISIS Yang model compilation issue"

9 years agoISIS Yang model compilation issue
Reinaldo Penno [Thu, 6 Nov 2014 06:30:45 +0000 (22:30 -0800)]
ISIS Yang model compilation issue

Change-Id: Ib4bc98ad68237ebea4eccf5522dfd79db88a7906
Signed-off-by: Reinaldo Penno <rapenno@gmail.com>
9 years agoEliminate warnings
Robert Varga [Fri, 31 Oct 2014 14:01:52 +0000 (15:01 +0100)]
Eliminate warnings

- unused imports
- unused warning suppression
- legacy class usage

Change-Id: Ibcd4debf265c04ad45846ba087a2400376e6e08c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 584: Increate test coverage in binding-generator-util"
Tony Tkacik [Wed, 29 Oct 2014 12:06:02 +0000 (12:06 +0000)]
Merge "Bug 584: Increate test coverage in binding-generator-util"

9 years agoBug 584: Increate test coverage in binding-generator-util
Ladislav Borak [Tue, 23 Sep 2014 06:30:26 +0000 (08:30 +0200)]
Bug 584: Increate test coverage in binding-generator-util

Change-Id: I3b6d4b5d579b77b89fc6acf058c5bce277609027
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoFix for resolving leafSchemaNode asProperty in BindingGeneratorImpl
Ladislav Borak [Wed, 22 Oct 2014 13:37:30 +0000 (15:37 +0200)]
Fix for resolving leafSchemaNode asProperty in BindingGeneratorImpl

Change-Id: Ia844e18de49ff569a027cba7df77551ba2fa763d
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoMerge "BUG-1954: Fix useless Boolean instantiation"
Robert Varga [Wed, 22 Oct 2014 19:51:49 +0000 (19:51 +0000)]
Merge "BUG-1954: Fix useless Boolean instantiation"

9 years agoMerge "Bug 584: Increase test coverage"
Lukas Sedlak [Wed, 22 Oct 2014 13:18:01 +0000 (13:18 +0000)]
Merge "Bug 584: Increase test coverage"

9 years agoMerge "Resolved some sonar issues: Simplify Boolean Expression"
Lukas Sedlak [Wed, 22 Oct 2014 12:58:46 +0000 (12:58 +0000)]
Merge "Resolved some sonar issues: Simplify Boolean Expression"

9 years agoBUG-1954: Fix useless Boolean instantiation
Robert Varga [Thu, 18 Sep 2014 09:40:15 +0000 (11:40 +0200)]
BUG-1954: Fix useless Boolean instantiation

No need to instantiate booleans for string, just use Boolean.TRUE.

Change-Id: I5156d4a8cafd08ced0802c55812cded7bdbe1cee
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 61b4fa02e7b89bba37ac906c05605c79dead57b2)

9 years agoMerge "Fixed potentional NPE in generateTypesFromChoiceCases"
Tony Tkacik [Wed, 22 Oct 2014 11:50:54 +0000 (11:50 +0000)]
Merge "Fixed potentional NPE in generateTypesFromChoiceCases"

9 years agoBug 584: Increase test coverage
Ladislav Borak [Wed, 22 Oct 2014 11:04:07 +0000 (13:04 +0200)]
Bug 584: Increase test coverage

Change-Id: Iabd86a3e7f72d99e227d76ff563a60d031ef0a86
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoFixed potentional NPE in generateTypesFromChoiceCases
Lukas Sedlak [Tue, 21 Oct 2014 14:17:35 +0000 (16:17 +0200)]
Fixed potentional NPE in generateTypesFromChoiceCases

Added check to verify if parent is not null since not all GeneratedTypes can implement ChildOf<parent> definition.

Change-Id: I9b01dc154fa767e2411c563540135051c3aab678
Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
9 years agoMerge "Bug 584 - Milestone : Increasing unit test coverage, from 44.9% to 60%"
Lukas Sedlak [Mon, 20 Oct 2014 14:14:55 +0000 (14:14 +0000)]
Merge "Bug 584 - Milestone : Increasing unit test coverage, from 44.9% to 60%"

9 years agoBug 584 - Milestone : Increasing unit test coverage, from 44.9% to 60%
Peter Bandzi [Wed, 1 Oct 2014 11:15:46 +0000 (13:15 +0200)]
Bug 584 - Milestone : Increasing unit test coverage, from 44.9% to 60%

Change-Id: I4bab0d83892c15fa198d72e99c262ee2011d9830
Signed-off-by: Peter Bandzi <pbandzi@cisco.com>
9 years agoMerge "Bug 2172 - AbstractGeneratedTypeBuilder check for duplicate elements."
Lukas Sedlak [Mon, 20 Oct 2014 08:50:40 +0000 (08:50 +0000)]
Merge "Bug 2172 - AbstractGeneratedTypeBuilder check for duplicate elements."

9 years agoMerge "Bug 584: Test coverage increase"
Tony Tkacik [Fri, 17 Oct 2014 09:04:12 +0000 (09:04 +0000)]
Merge "Bug 584: Test coverage increase"

9 years agoMerge "Bug 584: test coverage increase"
Tony Tkacik [Fri, 17 Oct 2014 09:04:00 +0000 (09:04 +0000)]
Merge "Bug 584: test coverage increase"

9 years agoMerge "BUG-1902: reuse ConcreteTypeImpl instances"
Tony Tkacik [Fri, 17 Oct 2014 09:03:39 +0000 (09:03 +0000)]
Merge "BUG-1902: reuse ConcreteTypeImpl instances"

9 years agoMerge "Bug 584: Test coverage increase"
Tony Tkacik [Fri, 17 Oct 2014 09:03:00 +0000 (09:03 +0000)]
Merge "Bug 584: Test coverage increase"

9 years agoBug 2172 - AbstractGeneratedTypeBuilder check for duplicate elements.
pkajsa [Fri, 17 Oct 2014 09:00:56 +0000 (11:00 +0200)]
Bug 2172 - AbstractGeneratedTypeBuilder check for duplicate elements.

Check for duplicity of added elements has been added into add* methods
in the AbstractGeneratedTypeBuilder class.

Change-Id: I9ef4caef0a835c0e171e86c2b322c3452bdaada0
Signed-off-by: pkajsa <pkajsa@cisco.com>
9 years agoMerge "Bug 2176 - add property with name == null fix."
Tony Tkacik [Thu, 16 Oct 2014 12:55:03 +0000 (12:55 +0000)]
Merge "Bug 2176 - add property with name == null fix."

9 years agoMerge "Bug 2183: ClassCastException in AbstractTypeMemberBuilder fix"
Tony Tkacik [Thu, 16 Oct 2014 12:51:48 +0000 (12:51 +0000)]
Merge "Bug 2183: ClassCastException in AbstractTypeMemberBuilder fix"

9 years agoBug 2176 - add property with name == null fix.
pkajsa [Thu, 16 Oct 2014 06:45:01 +0000 (08:45 +0200)]
Bug 2176 - add property with name == null fix.

The Preconditions.checkArgument(name != null,..) check has been added into the
addProperty(String name) method in the AbstractGeneratedTypeBuilder class.

Change-Id: I9db2b718011fa397cf1cd659ae56f8764bb8316e
Signed-off-by: pkajsa <pkajsa@cisco.com>
9 years agoBug 584: Test coverage increase
pkajsa [Wed, 15 Oct 2014 11:08:22 +0000 (13:08 +0200)]
Bug 584: Test coverage increase

Unit tests for:
BindingGeneratorUtil
GeneratedPropertyBuilderImpl
GeneratedPropertyImpl

Change-Id: Ibe6811b8dfafd3cef584ed234ee0e85b7dbeae33
Signed-off-by: pkajsa <pkajsa@cisco.com>
9 years agoBug 2183: ClassCastException in AbstractTypeMemberBuilder fix
Martin Ciglan [Tue, 14 Oct 2014 14:46:17 +0000 (16:46 +0200)]
Bug 2183: ClassCastException in AbstractTypeMemberBuilder fix

Change-Id: I0d5a21653f958c630c2a573b9cb90af28e59a627
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoResolved some sonar issues: Simplify Boolean Expression
Ladislav Borak [Tue, 14 Oct 2014 11:46:29 +0000 (13:46 +0200)]
Resolved some sonar issues: Simplify Boolean Expression

Change-Id: Ie4d9efb2a00330bede69aac80789065cac895710
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoBUG-1902: reuse ConcreteTypeImpl instances
Robert Varga [Tue, 16 Sep 2014 09:53:44 +0000 (11:53 +0200)]
BUG-1902: reuse ConcreteTypeImpl instances

Instantiate a cache which will act as a lookup for commonly-shared
instances. Also creates shared instances for byte[] and char[] primitive
types and reuses them as much as possible.

Change-Id: Ia70f0e9022c3b19e0f9b0eff34e0cf69958e25f0
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRework version artifact version tracking
Robert Varga [Wed, 8 Oct 2014 22:26:58 +0000 (00:26 +0200)]
Rework version artifact version tracking

This patch reworks the way we track our internal artifacts by moving the
definitions from the aprent pom into a dedicated yangtools-artifacts
versions.

This artifact's dependencyManagement section is then imported into the
parent. This may look unnecessary, but it allows our downstream users to
import the same file and have the versioning work.

An interesting side-effect of that is that the properties cannot be
relied on carrying versions of artifacts and then be picked up by the
features.xml file.

This patch fixes that by introducing a script into the build cycle,
which looks at a template features.xml and resolves the versions as
currently visible in the dependency tree of the artifact.

Change-Id: I193586f777478c12520358b9909cfb61e40d14b4
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 584: test coverage increase
Martin Ciglan [Tue, 14 Oct 2014 09:45:48 +0000 (11:45 +0200)]
Bug 584: test coverage increase

MethodSignatureBuilderImpl.java
MethodSignatureImpl.java

Change-Id: Ifdeb3ba32e751625b212d2e93f66bbedbf76ddfc
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoBug 584: Test coverage increase
pkajsa [Tue, 14 Oct 2014 07:04:55 +0000 (09:04 +0200)]
Bug 584: Test coverage increase

Unit tests for:
AnnotationTypeBuilderImpl
GeneratedTypeBuilderImpl
AbstractGeneratedTypeBuilder
ConstantImpl

Change-Id: I2956ff8a787a1e1db9e6e7db27aa50a5cc159bb5
Signed-off-by: pkajsa <pkajsa@cisco.com>
9 years agoMerge "Bug 584: GeneratedTOBuilder test coverage increase"
Robert Varga [Mon, 13 Oct 2014 09:05:34 +0000 (09:05 +0000)]
Merge "Bug 584: GeneratedTOBuilder test coverage increase"

9 years agoBug 584: MethodParameterImpl test coverage increase
Martin Ciglan [Fri, 10 Oct 2014 12:29:34 +0000 (14:29 +0200)]
Bug 584: MethodParameterImpl test coverage increase

Change-Id: I63ecbdb35266f4549ebc51c49d9a8009f8b57dcb
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoBug 584: GeneratedTOBuilder test coverage increase
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>
9 years agoMerge "BUG-2159: fix sort() conflict"
Tony Tkacik [Thu, 9 Oct 2014 16:07:24 +0000 (16:07 +0000)]
Merge "BUG-2159: fix sort() conflict"

9 years agoMerge "BUG-2159: compilation failure with generics"
Tony Tkacik [Thu, 9 Oct 2014 16:07:03 +0000 (16:07 +0000)]
Merge "BUG-2159: compilation failure with generics"

9 years agoBUG-2159: fix sort() conflict
Robert Varga [Wed, 8 Oct 2014 16:21:01 +0000 (18:21 +0200)]
BUG-2159: fix sort() conflict

Java 8 introduces a default method into java.util.List, which has a
different signature (and semantics) than the xtend extension. This patch
changes the code to not use the syntactic sugar while retaining the use
of the extension.

Change-Id: I4685937ab4da64cfe384db9aad31859ca51e97d7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2159: compilation failure with generics
Robert Varga [Wed, 8 Oct 2014 16:12:29 +0000 (18:12 +0200)]
BUG-2159: compilation failure with generics

http://mail.openjdk.java.net/pipermail/compiler-dev/2013-October/007726.html
seems to be describing why this patch is needed.

Change-Id: Ib23f51e0f319327c3c6a04ff86fb4c89b745e4ae
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdded Test suite for testing of TypeProviderImpl.
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>
9 years agoBug 1423 - Yangtools parser allows 2 cases with same child elements
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>
9 years agoBug 1906: Fixed bug in Binding leafref to union codec
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>
9 years agoBump versions for Lithium
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>
9 years agoMerge "Bug 576 Fixes of critical issues for YT components"
Tony Tkacik [Mon, 15 Sep 2014 14:52:52 +0000 (14:52 +0000)]
Merge "Bug 576 Fixes of critical issues for YT components"

9 years agoBug 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>
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>