yangtools.git
9 years agoAdd Anyxml normalized node to yang-data-api. 71/7771/2
Jozef Gloncak [Tue, 17 Jun 2014 07:32:47 +0000 (09:32 +0200)]
Add Anyxml normalized node to yang-data-api.

Proposal of anyxml normalized node interface.
This interface wraps Simple/CompositeNode as inner value.

Change-Id: Ic9c17fa28bc5eb23288162a735d890b4f77938f1
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoMerge "BUG-865: replaced deprecated code from binding-generator-util."
Tony Tkacik [Fri, 13 Jun 2014 11:59:40 +0000 (11:59 +0000)]
Merge "BUG-865: replaced deprecated code from binding-generator-util."

10 years agoMerge changes I6b5ca1b6,Ib9703600,I5eb25590,I5ea885e0,I08ba5d2c
Tony Tkacik [Fri, 13 Jun 2014 11:58:11 +0000 (11:58 +0000)]
Merge changes I6b5ca1b6,Ib9703600,I5eb25590,I5ea885e0,I08ba5d2c

* changes:
  BUG-1143: refactored ChoiceCaseGenTypesTest.
  BUG-1143: refactored AugmentRelativeXPathTest.
  BUG-1143: refactored AugmentedTypeTest.
  BUG-1143: added AbstractTypesTest as base for generated types testing.
  BUG-865: removed use of deprecated methods from tests.

10 years agoMerge "BUG-1069: made InstanceIdentifier.PathArgument implement Comparable."
Tony Tkacik [Fri, 13 Jun 2014 11:56:31 +0000 (11:56 +0000)]
Merge "BUG-1069: made InstanceIdentifier.PathArgument implement Comparable."

10 years agoMerge "BUG-865: replaced deprecated code from yang-binding."
Tony Tkacik [Fri, 13 Jun 2014 11:53:38 +0000 (11:53 +0000)]
Merge "BUG-865: replaced deprecated code from yang-binding."

10 years agoBUG-1069: made InstanceIdentifier.PathArgument implement Comparable. 52/7952/2
Martin Vitez [Thu, 12 Jun 2014 15:32:31 +0000 (17:32 +0200)]
BUG-1069: made InstanceIdentifier.PathArgument implement Comparable.

Change-Id: Ib89d5a4240205234f707290e69f29d80841e3504
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-1143: refactored ChoiceCaseGenTypesTest. 87/7987/1
Martin Vitez [Fri, 13 Jun 2014 11:24:06 +0000 (13:24 +0200)]
BUG-1143: refactored ChoiceCaseGenTypesTest.

Removed test sources which are irrelevant for choice case generated type testing.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-865: replaced some deprecated code from binding-type-provider. 39/7939/2
Martin Vitez [Thu, 12 Jun 2014 11:32:29 +0000 (13:32 +0200)]
BUG-865: replaced some deprecated code from binding-type-provider.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-1143: refactored AugmentRelativeXPathTest. 81/7981/1
Martin Vitez [Fri, 13 Jun 2014 10:02:38 +0000 (12:02 +0200)]
BUG-1143: refactored AugmentRelativeXPathTest.

Removed test sources which are irrelevant for relative path augment generated type testing.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-1143: refactored AugmentedTypeTest. 80/7980/1
Martin Vitez [Fri, 13 Jun 2014 09:37:49 +0000 (11:37 +0200)]
BUG-1143: refactored AugmentedTypeTest.

Removed test sources which are irrelevant for augment generated type testing.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-1143: added AbstractTypesTest as base for generated types testing. 79/7979/1
Martin Vitez [Fri, 13 Jun 2014 09:11:17 +0000 (11:11 +0200)]
BUG-1143: added AbstractTypesTest as base for generated types testing.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-865: removed use of deprecated methods from tests. 14/7914/2
Martin Vitez [Wed, 11 Jun 2014 15:49:20 +0000 (17:49 +0200)]
BUG-865: removed use of deprecated methods from tests.

Removed use of deprecated methods from parser in binding-generator-impl tests.

Change-Id: I08ba5d2c2abc55b818e389502512f35774a90db3
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBug 1193: Use format string correctly and fix corresponding unit test 65/7965/1
Rob Adams [Fri, 13 Jun 2014 00:52:56 +0000 (17:52 -0700)]
Bug 1193: Use format string correctly and fix corresponding unit test
as well

Change-Id: Ib05078ee9045f60cff663407aa401045ac9d885b
Signed-off-by: Rob Adams <readams@readams.net>
10 years agoBUG-865: replaced deprecated code from yang-binding. 44/7944/1
Martin Vitez [Thu, 12 Jun 2014 13:03:19 +0000 (15:03 +0200)]
BUG-865: replaced deprecated code from yang-binding.

Removed groupId declaration from pom (duplicate of parent groupId).

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-865: replaced deprecated code from binding-generator-util. 40/7940/1
Martin Vitez [Thu, 12 Jun 2014 11:45:10 +0000 (13:45 +0200)]
BUG-865: replaced deprecated code from binding-generator-util.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-1172: nested uses-augmentation fails in code-generation phase. 02/7902/2
Martin Vitez [Wed, 11 Jun 2014 14:02:12 +0000 (16:02 +0200)]
BUG-1172: nested uses-augmentation fails in code-generation phase.

Added test case.

Change-Id: I22e506fcaf4f643f5cecb995e3e5f0e5d8ef1fa8
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-1024: reorganize code for clarity 13/7113/4
Robert Varga [Fri, 16 May 2014 13:00:46 +0000 (15:00 +0200)]
BUG-1024: reorganize code for clarity

This reorganizes the code quite a bit and stops executing as soon as a
result is known.

Change-Id: I9537227e0e6230ee66253aa83ab0c5c2963725e4
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoFixed handling of submodules in yang-maven-plugin. 97/7897/1
Martin Vitez [Wed, 11 Jun 2014 11:10:37 +0000 (13:10 +0200)]
Fixed handling of submodules in yang-maven-plugin.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoJanitor: add missing copyright headers 70/7770/2
Robert Varga [Thu, 29 May 2014 04:42:04 +0000 (06:42 +0200)]
Janitor: add missing copyright headers

common/feature does not comply to project standards for XML files,
fix that.

Change-Id: I53c78ef55eefdae67ea28f830698cd966c6fa244
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "API Clarity: Documented o.o.y.yang.data.api and o.o.y.yang.data.api.schema...
Robert Varga [Mon, 9 Jun 2014 17:09:14 +0000 (17:09 +0000)]
Merge "API Clarity: Documented o.o.y.yang.data.api and o.o.y.yang.data.api.schema packages."

10 years agoMerge "API Clarity: Documented o.o.y.yang.parser.builder.api"
Robert Varga [Mon, 9 Jun 2014 15:59:45 +0000 (15:59 +0000)]
Merge "API Clarity: Documented o.o.y.yang.parser.builder.api"

10 years agoAPI Clarity: Documented o.o.y.yang.data.api and o.o.y.yang.data.api.schema packages. 24/7824/6
Tony Tkacik [Mon, 9 Jun 2014 08:21:09 +0000 (10:21 +0200)]
API Clarity: Documented o.o.y.yang.data.api and o.o.y.yang.data.api.schema packages.

Fully documented o.o.y.yang.data.api.schema package
Partially documented o.o.y.yang.data.api package

Change-Id: Id2721050abee5120165485dec4b38348f37609b1
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoAPI Clarity: Documented o.o.y.yang.parser.builder.api 77/7677/6
Tony Tkacik [Wed, 4 Jun 2014 11:47:37 +0000 (13:47 +0200)]
API Clarity: Documented o.o.y.yang.parser.builder.api

Change-Id: I75c524c7d4d41a4d65004a0ed86065af6a2ae523
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Fixed mismatch in ietf-restconf-version variable"
Tony Tkacik [Mon, 9 Jun 2014 12:41:50 +0000 (12:41 +0000)]
Merge "Fixed mismatch in ietf-restconf-version variable"

10 years agoBug 981: Removed direct access to parent fields. 76/7676/3
Tony Tkacik [Wed, 4 Jun 2014 11:47:01 +0000 (13:47 +0200)]
Bug 981: Removed direct access to parent fields.

Change-Id: I21389b168e2796be23d280a7152a48ddb23de67e
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoAPI Clarity: Documentented o.o.y.yang.parser.impl.util 47/7647/3
Tony Tkacik [Tue, 3 Jun 2014 15:51:51 +0000 (17:51 +0200)]
API Clarity: Documentented o.o.y.yang.parser.impl.util

Change-Id: Ic98387e4e5f191cbd920279c9a5520ffa81d3607
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoFixed mismatch in ietf-restconf-version variable 22/7822/1
Giovanni Meo [Mon, 9 Jun 2014 07:11:25 +0000 (09:11 +0200)]
Fixed mismatch in ietf-restconf-version variable

- ietf-restconf-version is defined to be 2013.09.04.1-SNAPSHOT while
the module is defined to be 2013.10.19.1-SNAPSHOT. The mismatch causes
issue in the usage as well in the releasing process

Change-Id: Ieee018314370416fc3ba37e0f7f7eb2f1f55c06b
Signed-off-by: Giovanni Meo <gmeo@cisco.com>
10 years agoBUG-868: do not use ParserUtils.createSchemaPath() 10/7810/1
Robert Varga [Sun, 8 Jun 2014 07:20:05 +0000 (09:20 +0200)]
BUG-868: do not use ParserUtils.createSchemaPath()

Moves from ParserUtils.createSchemaPath() to new SchemaPath utility
APIs.

Change-Id: I3671e72a39d0975dcec49f9c99ea84df1fc89cc7
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-981: Migrate from deprecated private method to public"
Robert Varga [Sat, 7 Jun 2014 09:55:17 +0000 (09:55 +0000)]
Merge "BUG-981: Migrate from deprecated private method to public"

10 years agoBUG-981: Migrate from deprecated private method to public 44/7644/3
Maros Marsalek [Tue, 3 Jun 2014 14:02:02 +0000 (16:02 +0200)]
BUG-981: Migrate from deprecated private method to public

Change-Id: I8c75db4700351f53843fd273286df5d0849731b0
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-584: tests update, removed use of deprecated elements. 86/7586/3
Martin Vitez [Mon, 2 Jun 2014 12:18:22 +0000 (14:18 +0200)]
BUG-584: tests update, removed use of deprecated elements.

Change-Id: I3416c8009cf1bbdcefee8042f570b4d407fc73a2
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "bug 1128:POM Restructuring for Automated Release"
Robert Varga [Fri, 6 Jun 2014 15:03:05 +0000 (15:03 +0000)]
Merge "bug 1128:POM Restructuring for Automated Release"

10 years agobug 1128:POM Restructuring for Automated Release 97/6397/10
Vaishali Mithbaokar [Thu, 10 Apr 2014 01:39:04 +0000 (18:39 -0700)]
bug 1128:POM Restructuring for Automated Release

Temporarily hosting odlrootparent as part of the project just for review purpose

Change-Id: Ia9f14f1f5544e3ef5a543cf8e0e904fb31ffbeee
Signed-off-by: Surekha Bejgam <sbejgam@cisco.com>
Signed-off-by: Vaishali Mithbaokar <vmithbao@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: do not call hashCode() from IdentifiableItem.equals() 77/7777/1
Robert Varga [Fri, 6 Jun 2014 12:37:25 +0000 (14:37 +0200)]
BUG-582: do not call hashCode() from IdentifiableItem.equals()

This call would make sense if we had cached hashCode -- but we do not.
We have two options here, either cache hashCode, or not call it from
equals().

Tracing ODL identified that the only other caller of
hashCode() is HashCodeBuilder.nextHashCode() -- thus the hash code is
used only once.

So caching it would add useless overhead of 4 bytes -- so let's just say
no to that.

Change-Id: I19ae0e5025fb6aec5b4d1019b55976ca5ca2e9d4
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: eliminate useless null checks 76/7776/1
Robert Varga [Fri, 6 Jun 2014 12:19:37 +0000 (14:19 +0200)]
BUG-582: eliminate useless null checks

These checks are not useful, as the fields checked have been verified to
be non-null. Also optimizes AbstractPathArgument.hashCode() by directly
referring to the type -- we assume storing the PathArgument alongside
with the class is not going to be used very often.

Change-Id: Id3f4d67819de8462801823880e482a480843fa1e
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: optimize InstanceIdentifier.firstIdentifierOf() 65/7765/2
Robert Varga [Thu, 5 Jun 2014 21:46:21 +0000 (23:46 +0200)]
BUG-582: optimize InstanceIdentifier.firstIdentifierOf()

Performance tracing of OpenFlow components found that we are spending
cycles copying arguments in create() when called from firstIdentifierOf().
This does not make sense, as we know the argument list is immutable in
this code path.

As it turns out, the copy guard in create() is not sufficient to prevent
the copy, as the Iterables.limit() instantiates a FluentIterable, not an
ImmutableCollection.

This patch elides the copy by splitting the non-copy part of logic of
create() to a private method, internalCreate(). firstIdentifierOf()
calls this method directly, while create() calls it after potentially
creating a copy.

Change-Id: I5c3dbb5c6b5e26d30a0bb407822f1d40fcc898f5
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-868: migrate to SchemaPath.create() 64/7764/2
Robert Varga [Thu, 5 Jun 2014 21:59:32 +0000 (23:59 +0200)]
BUG-868: migrate to SchemaPath.create()

Removes deprecated direct use of constructor in favor of using factory
method.

Change-Id: Ifc49b7a565d971baad2181715b9104e3bf02ea8f
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-584: added test-models to integration-test project."
Tony Tkacik [Fri, 6 Jun 2014 08:26:59 +0000 (08:26 +0000)]
Merge "BUG-584: added test-models to integration-test project."

10 years agoMerge "BUG-584: moved yangtools-it under integration-test and renamed to bundle-test"
Tony Tkacik [Fri, 6 Jun 2014 08:26:23 +0000 (08:26 +0000)]
Merge "BUG-584: moved yangtools-it under integration-test and renamed to bundle-test"

10 years agoMerge "Improved sorting of augmentations before code generation."
Tony Tkacik [Fri, 6 Jun 2014 08:24:42 +0000 (08:24 +0000)]
Merge "Improved sorting of augmentations before code generation."

10 years agoMerge "BUG 1130 STRING_DEFAULT_CODEC - deserialize can return null"
Tony Tkacik [Thu, 5 Jun 2014 07:30:49 +0000 (07:30 +0000)]
Merge "BUG 1130 STRING_DEFAULT_CODEC - deserialize can return null"

10 years agoMerge "Bug 484: Fix XmlDocumentUtils.toDocument to handle anyxml"
Robert Varga [Wed, 4 Jun 2014 18:26:57 +0000 (18:26 +0000)]
Merge "Bug 484: Fix XmlDocumentUtils.toDocument to handle anyxml"

10 years agoMerge "Checkstyle coding-style rules"
Robert Varga [Wed, 4 Jun 2014 18:25:20 +0000 (18:25 +0000)]
Merge "Checkstyle coding-style rules"

10 years agoCheckstyle coding-style rules 95/7595/5
Milos Fabian [Mon, 2 Jun 2014 14:07:26 +0000 (16:07 +0200)]
Checkstyle coding-style rules

-avoid using tabs
-avoid trailing whitespaces
-no windows eol chars
-indentation offset 4
-imports order - static imports first, alphabetical order
-avoid unused imports

Change-Id: I4ea8193089f7c5cf77ee432c85cb1c8249043495
Signed-off-by: Milos Fabian <milfabia@cisco.com>
10 years agoBUG 1130 STRING_DEFAULT_CODEC - deserialize can return null 64/7664/3
Jozef Gloncak [Wed, 4 Jun 2014 07:15:07 +0000 (09:15 +0200)]
BUG 1130 STRING_DEFAULT_CODEC - deserialize can return null

Change-Id: I797fb2849a6997f1b5af7098442b324bf3701d89
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoMerge "Bug 724: Handle hashCode/equals properly in InstanceIdentifier"
Tony Tkacik [Tue, 3 Jun 2014 16:13:11 +0000 (16:13 +0000)]
Merge "Bug 724: Handle hashCode/equals properly in InstanceIdentifier"

10 years agoMerge "Bug 1123 - Fixed incorrect augment target resolving"
Robert Varga [Tue, 3 Jun 2014 15:11:58 +0000 (15:11 +0000)]
Merge "Bug 1123 - Fixed incorrect augment target resolving"

10 years agoBug 724: Handle hashCode/equals properly in InstanceIdentifier 19/7519/5
tpantelis [Mon, 26 May 2014 21:56:17 +0000 (17:56 -0400)]
Bug 724: Handle hashCode/equals properly in InstanceIdentifier

Modified InstanceIdentifier.NodeIdentifierWithPredicates and
InstanceIdentifier.NodeWithValue classes to perform deep hashCode/equals
to handle byte] values.

Added unit tests.

Change-Id: I92befd04e145e7390ffcc4780c2f428da740df47
Signed-off-by: tpantelis <tpanteli@brocade.com>
10 years agoBug 1123 - Fixed incorrect augment target resolving 87/7587/3
Tony Tkacik [Mon, 2 Jun 2014 14:10:24 +0000 (16:10 +0200)]
Bug 1123 - Fixed incorrect augment target resolving

- Introduced new ParserUtils#findSchemaNodeInModule
  in parser utils
  which uses SchemaPath, Iterable and full QName match
  to lookup builders for augmentations

- Updated augmentation resolution to use findSchemaNodeInModule
  to lookup correct augmentation target using
  full QName match (namespace, revision, localName) instead
  original algorithm using localName only.

- Updated incorrect negative tests for augmentations
  Added conflicting augmentations.

Change-Id: I36b814a85759605ef43eb65485d9ec592871fb15
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBUG-1120: add ExecutorServiceUtil 13/7613/3
Robert Varga [Mon, 2 Jun 2014 22:08:44 +0000 (00:08 +0200)]
BUG-1120: add ExecutorServiceUtil

ExecutorServiceUtil encapsulates the utilities needed to implement a
blocking-queue based, growing thread pool executor service. This is
useful in both the controller and the openflow plugin.

Change-Id: I888e9bbd7732dd589ec153cfac67d6a2b032103d
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoFix a documentation typo 30/7630/1
Robert Varga [Tue, 3 Jun 2014 08:44:29 +0000 (10:44 +0200)]
Fix a documentation typo

Fixes missing } in deprecation link.

Change-Id: I118878716dccde4e664a1d9324d54ec0fc5c8bc4
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug 1027: Fixed generation of static QNAME field"
Robert Varga [Mon, 2 Jun 2014 15:18:23 +0000 (15:18 +0000)]
Merge "Bug 1027: Fixed generation of static QNAME field"

10 years agoBug 1027: Fixed generation of static QNAME field 30/7330/3
Tony Tkacik [Thu, 22 May 2014 11:10:55 +0000 (13:10 +0200)]
Bug 1027: Fixed generation of static QNAME field

All YANG modeled entities such as containers, lists
which have Binding-aware interface associated with
it should have static field QNAME with their respective
from YANG models. Only exception are augmentations
which do not have explicit name.

Instance Identifier codec relies on this existence
of QName which was not true for classes derived from
RPC Input and RPC Output

The code was changed to fix this issue:

BindingGeneratorImpl:
  Updated to include QName for all YANG modeled
  data container.

BindingReflections:
  ClassToQNameLoader was updated to derive correct
  qname for RPC inputs and RPC outputs for models
  which was compiled with missing QName field.

Change-Id: I190f569037cb4e88cf2edc7f18c436cf3eb86aeb
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBUG-584: added test-models to integration-test project. 25/7425/3
Martin Vitez [Tue, 27 May 2014 12:09:24 +0000 (14:09 +0200)]
BUG-584: added test-models to integration-test project.

Change-Id: Ib84e16e1722c61a693452a180d7c7a3cbfb5f79c
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-584: moved yangtools-it under integration-test and renamed to bundle-test 02/7402/4
Martin Vitez [Mon, 26 May 2014 15:38:32 +0000 (17:38 +0200)]
BUG-584: moved yangtools-it under integration-test and renamed to bundle-test

Change-Id: Icb4f92b13bb89d3fce20d752816b63f0243a8646
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-1120: expose AbstractRegistration state 68/7568/2
Robert Varga [Sun, 1 Jun 2014 13:31:26 +0000 (15:31 +0200)]
BUG-1120: expose AbstractRegistration state

This patch allows subclasses to infer whether the registration has been
closed.  At the same time we optimize the memory overhead associated with
each instance by not using an AtomicBoolean, but rather a componation of
a volatile int and an AtomicIntegerFieldUpdater.

Change-Id: I672216939f002e42dddef8e6fea73ef8cd109788
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug 1113 - ietf-restconf needs to specify the version of ietf-yangtypes that...
Tony Tkacik [Fri, 30 May 2014 13:39:50 +0000 (13:39 +0000)]
Merge "Bug 1113 - ietf-restconf needs to specify the version of ietf-yangtypes that must be imported."

10 years agoBug 1113 - ietf-restconf needs to specify the version of ietf-yangtypes that must... 36/7536/1
Devin Avery [Thu, 29 May 2014 21:52:23 +0000 (17:52 -0400)]
Bug 1113 - ietf-restconf needs to specify the version of ietf-yangtypes that must be imported.

Modified the internal ietf-restconf to specify the required version of ietf-yangtypes so runtime compilation runs without an issue.

Change-Id: I06f547aee6d26b7865ea93bbcdd76808d46d8151
Signed-off-by: Devin Avery <devin.avery@brocade.com>
10 years agoAPI Clarity: Documented YANG Common. 18/7518/5
Tony Tkacik [Thu, 29 May 2014 15:48:39 +0000 (17:48 +0200)]
API Clarity: Documented YANG Common.

Change-Id: I7b789ba7c180c5b63409ad44000d944e01c26b6f
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoAPI Claratity: Documented package o.o.y.yang.model.util 20/7420/7
Tony Tkacik [Tue, 27 May 2014 10:04:38 +0000 (12:04 +0200)]
API Claratity: Documented package o.o.y.yang.model.util

Documented package o.o.y.yang.model.util,
documented differences between base YANG types
which resulted in different instantiation pattern for
some of built-in types.

Deprecated utility YangTypesConverter which name was
confusing, added replacement methods in BaseTypes
which name is less confusing and more clearly
comunicates its functions.

Improved hashCode and equals after introducing
static constants.

Change-Id: I300d64cb38ded6989afa0eb841dca61a0efbf8f0
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoAPI Claritity: Documented org.opendaylight.yangtools.yang.model.util.repo 96/7396/8
Tony Tkacik [Mon, 26 May 2014 10:49:19 +0000 (12:49 +0200)]
API Claritity: Documented org.opendaylight.yangtools.yang.model.util.repo

Improved documentation of poorly-documented public APIs in
org.opendaylight.yang.model.util.repo which are actually used by
existing implementations.

Added package-info which describes abstract concepts for this package
which are not materialized in interface or class in this package.

Change-Id: I785a48df0af46d363690ed6c733425f8c1790e0d
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBUG-648: do not keep HashMap$Values around 68/7468/2
Robert Varga [Wed, 28 May 2014 21:30:06 +0000 (23:30 +0200)]
BUG-648: do not keep HashMap$Values around

Profiling has identified that we keep a lot (>600K) of HashMap$Values
objects around. This is caused by our class hierarchy, which forces the
Container nodes to supply their Iterable values at construction time --
which means they have to capture children.values() and wrap it in an
UnmodifiableIterable.

This patch creates splits the functionality of
AbstractImmutableNormalizedNode into two:

AbstractImmutableNormalizedNode, which just holds the identifier plus
the infrastructure layout. AbstractImmutableNormalizedValueNode, which
additionally holds the value.

Container nodes are then made subclasses of the former, which allows
them to provide getValue() dynamically, thus avoiding the unnecessary
instantiation.

Change-Id: I3fb894b0eeef3cd4a7b0de7634d4638c72c66fc3
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-648: use MapAdaptor"
Tony Tkacik [Thu, 29 May 2014 12:28:01 +0000 (12:28 +0000)]
Merge "BUG-648: use MapAdaptor"

10 years agoMerge "BUG-648: fix util building"
Tony Tkacik [Thu, 29 May 2014 08:19:38 +0000 (08:19 +0000)]
Merge "BUG-648: fix util building"

10 years agoImproved sorting of augmentations before code generation. 17/7217/5
Martin Vitez [Mon, 19 May 2014 13:36:24 +0000 (15:36 +0200)]
Improved sorting of augmentations before code generation.

Change-Id: I6471f4849fa57a717d85d61293305b0853b851cb
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "Bug 731: Moved list initialization in UnionTypeBuilder before constructing...
Robert Varga [Thu, 29 May 2014 04:34:26 +0000 (04:34 +0000)]
Merge "Bug 731: Moved list initialization in UnionTypeBuilder before constructing UnionType."

10 years agoBUG-648: use MapAdaptor 32/7432/4
Robert Varga [Tue, 27 May 2014 15:58:27 +0000 (17:58 +0200)]
BUG-648: use MapAdaptor

This converts the un-ordered nodes to using the MapAdaptor utility,
which should result in reductions to the amount of copies being made.

Change-Id: I9a427d97d18534a6fb76cb52e4fde59dcd54e9c4
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-648: fix util building 67/7467/1
Robert Varga [Wed, 28 May 2014 19:59:02 +0000 (21:59 +0200)]
BUG-648: fix util building

It turns out that the util package had incorrect build instructions,
resulting in unresolved dependencies. Fix that.

Change-Id: I3ba8ecc5070b2d7aa1804f52511437cca6e504d9
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Fixed setting yang sources to modules."
Tony Tkacik [Wed, 28 May 2014 15:14:21 +0000 (15:14 +0000)]
Merge "Fixed setting yang sources to modules."

10 years agoBUG-648: Create MapAdaptor and friends 31/7431/6
Robert Varga [Tue, 27 May 2014 11:40:19 +0000 (13:40 +0200)]
BUG-648: Create MapAdaptor and friends

This introduces the MapAdaptor class, which allows transforming one Map
implementation to another, balancing the isolation and access patterns.

The core of the idea is that we are using patterns which would benefit
from persistent structures where we can take a point-in-time stable
snapshot, update it and publish the new version all the while clients
accessing the old version suspect nothing. So far we have implemented
the isolation by copying maps around -- which is fine as long as there
are not too many elements.

We do have a persistent strucutre (Ctrie), which allows snapshot and
isolation to happen in O(1), but exacts heavy price on access due to
volatile variables.

Change-Id: I4b745eecc5a915862ab75921703cfce3c2747ab6
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoFixed setting yang sources to modules. 96/7296/5
Martin Vitez [Wed, 21 May 2014 09:57:57 +0000 (11:57 +0200)]
Fixed setting yang sources to modules.

Change-Id: I2f3a070fd3afcb49ac3ecc9ce232fd7f299be71b
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "BUG-864: decrease log level when sorting and parsing modules"
Tony Tkacik [Wed, 28 May 2014 08:43:43 +0000 (08:43 +0000)]
Merge "BUG-864: decrease log level when sorting and parsing modules"

10 years agoMerge "BUG-973: fixed (de)serialization of union type."
Tony Tkacik [Wed, 28 May 2014 08:42:36 +0000 (08:42 +0000)]
Merge "BUG-973: fixed (de)serialization of union type."

10 years agoBug 731: Moved list initialization in UnionTypeBuilder before constructing UnionType. 59/7459/1
Tony Tkacik [Wed, 28 May 2014 07:50:36 +0000 (09:50 +0200)]
Bug 731: Moved list initialization in UnionTypeBuilder before constructing UnionType.

Change-Id: I615db54ef37b49c52005016d176640cfc47a6577
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBug 484: Fix XmlDocumentUtils.toDocument to handle anyxml 39/7339/2
tpantelis [Tue, 27 May 2014 17:02:23 +0000 (13:02 -0400)]
Bug 484: Fix XmlDocumentUtils.toDocument to handle anyxml

For anyxml data, a ClassCastException occurs at
XmlDocumentUtils.createXmlRootElement(XmlDocumentUtils.java:180) when
blindly casting the schema instance to DataNodeContainer - the actual
instance is an AnyXmlSchemaNode. To prevent this, the code should first
check "schema instanceof DataNodeContainer". 'childSchema' will be null
but that's expected for anyxml as it doesn't have a schema.

Change-Id: Ib2497e99ddf329961114c214320f6283d13a5272
Signed-off-by: tpantelis <tpanteli@brocade.com>
10 years agoMerge "BUG-1070: split off YangSourceContext"
Tony Tkacik [Tue, 27 May 2014 13:56:36 +0000 (13:56 +0000)]
Merge "BUG-1070: split off YangSourceContext"

10 years agoMerge "BUG-981: remove deprecated elements"
Tony Tkacik [Tue, 27 May 2014 13:54:14 +0000 (13:54 +0000)]
Merge "BUG-981: remove deprecated elements"

10 years agoBUG-981: remove deprecated elements 73/6873/10
Robert Varga [Sun, 11 May 2014 05:27:55 +0000 (07:27 +0200)]
BUG-981: remove deprecated elements

This patch removes deprecated constructor and setters, such that the
RuntimeGeneratedMappingServiceImpl can be instantiated in one go.

Change-Id: I7941479291210be9b1ee37919feae055c63c228c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1070: split off YangSourceContext 18/7418/1
Robert Varga [Sun, 25 May 2014 17:47:55 +0000 (19:47 +0200)]
BUG-1070: split off YangSourceContext

This patch just splits up the various static classes out of
YangSourceContext, making the structure more navigable.

Change-Id: I26c973ebe6d931d870e22d5965ba7baab0cc24e9
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-994: convert users of SchemaPath constructor 27/7327/4
Robert Varga [Thu, 22 May 2014 08:22:16 +0000 (10:22 +0200)]
BUG-994: convert users of SchemaPath constructor

This patch migrates all in-tree users of the deprecated constructor to
the create family of methods.

Change-Id: I7229237763b4a15d30978796fbfe6f2ab44f5889
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 1076: Updated SchemaPath hashcode to behave as previously. 13/7413/1
Tony Tkacik [Tue, 27 May 2014 07:39:09 +0000 (09:39 +0200)]
Bug 1076: Updated SchemaPath hashcode to behave as previously.

Change in hashCode of SchemaPath uncovered other issue
where code was expecting sorted set from HashSet.

Updated hashCode to behave as previously defined.

Change-Id: I2eea3b5890f985553127e11b50143d7714313ced
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "BUG-582: use shared thread-safe SimpleDateFormat"
Tony Tkacik [Mon, 26 May 2014 22:39:17 +0000 (22:39 +0000)]
Merge "BUG-582: use shared thread-safe SimpleDateFormat"

10 years agoMerge "BUG-1070: introduce YangSyntaxErrorException"
Tony Tkacik [Mon, 26 May 2014 22:38:48 +0000 (22:38 +0000)]
Merge "BUG-1070: introduce YangSyntaxErrorException"

10 years agoBUG-582: use shared thread-safe SimpleDateFormat 87/7387/2
Robert Varga [Sun, 25 May 2014 15:50:59 +0000 (17:50 +0200)]
BUG-582: use shared thread-safe SimpleDateFormat

This concentrates the per-parser DateTimeFormat into the pre-existing
yang-common one, lowering resource parser resource usage, while
remaining thread-safe.

Change-Id: I30d677ba4c66196bb5df551349c1d8abc31702b9
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1070: introduce YangSyntaxErrorException 86/7386/2
Robert Varga [Sun, 25 May 2014 10:29:57 +0000 (12:29 +0200)]
BUG-1070: introduce YangSyntaxErrorException

This introduces a proper checked exception, which is trown when a
syntactic error is encountered during parsing of the YANG module text.

Change-Id: If7445edce99d60306bad98e61b34d09c5bf06eb1
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-994: introduce SchemaPath.create() and friends"
Tony Tkacik [Mon, 26 May 2014 19:35:23 +0000 (19:35 +0000)]
Merge "BUG-994: introduce SchemaPath.create() and friends"

10 years agoMerge changes Ib8372167,I1b7aeca9
Tony Tkacik [Mon, 26 May 2014 19:33:57 +0000 (19:33 +0000)]
Merge changes Ib8372167,I1b7aeca9

* changes:
  BUG-382: optimize BooleanType
  BUG-582: optimize BinaryType

10 years agoMerge "BUG-868: stop using getChildren()"
Tony Tkacik [Mon, 26 May 2014 19:32:20 +0000 (19:32 +0000)]
Merge "BUG-868: stop using getChildren()"

10 years agoBUG-864: decrease log level when sorting and parsing modules 99/7299/4
Martin Vitez [Wed, 21 May 2014 13:08:11 +0000 (15:08 +0200)]
BUG-864: decrease log level when sorting and parsing modules

Decrease log level from debug to trace.

Change-Id: Ife96f80a88efa067745f4853bf521878c91919e3
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-973: fixed (de)serialization of union type. 33/7333/2
Martin Vitez [Thu, 22 May 2014 14:05:41 +0000 (16:05 +0200)]
BUG-973: fixed (de)serialization of union type.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-868: stop using getChildren() 93/7393/1
Robert Varga [Mon, 26 May 2014 09:36:07 +0000 (11:36 +0200)]
BUG-868: stop using getChildren()

This removes users of getChildren() in favor of getValue().

Change-Id: I1b871b46cd3af04dba1d286f386e43148308fbe1
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-382: optimize BooleanType 92/7392/1
Robert Varga [Mon, 26 May 2014 08:39:26 +0000 (10:39 +0200)]
BUG-382: optimize BooleanType

This optimizes the BooleanType definition, reducing it's class memory
footprint.

Change-Id: Ib837216703e5ab19cefd3604a2caa185b7733cbd
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: optimize BinaryType 91/7391/1
Robert Varga [Mon, 26 May 2014 08:30:09 +0000 (10:30 +0200)]
BUG-582: optimize BinaryType

This optimizes the defintion of BinaryType, such that it is smaller and
faster.

Change-Id: I1b7aeca92823743e0fd1995ac4476a3e3cf26698
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-868: Eliminate StringBufferInputStream 85/7385/1
Robert Varga [Sun, 25 May 2014 08:19:48 +0000 (10:19 +0200)]
BUG-868: Eliminate StringBufferInputStream

StringBufferInputStream has been deprected since JDK 1.1 -- so let's not
use it.

Change-Id: Ic436c5082e58ced632957b439ef7bca5412cf583
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: Use Splitter instead of String.split() 84/7384/1
Robert Varga [Sun, 25 May 2014 06:32:26 +0000 (08:32 +0200)]
BUG-582: Use Splitter instead of String.split()

String.split() instantiates a pattern, which in itself is not efficient.
Splitters are a lot more efficient, so let's use one in this codepath.

Change-Id: I896c3e743a6c21041af027f7512e21f5b5533e03
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: Optimize string modification 83/7383/1
Robert Varga [Sat, 24 May 2014 09:37:50 +0000 (11:37 +0200)]
BUG-582: Optimize string modification

This code could potentially end up with a lot of copying around. Pay a
single copy operation, iterate over the character array once and replace
characters as needed.

Change-Id: Ifdb80f83c938fde9c70ec6f34300fd010b01db6a
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: Optimize instantiated Splitter 82/7382/1
Robert Varga [Sat, 24 May 2014 08:58:40 +0000 (10:58 +0200)]
BUG-582: Optimize instantiated Splitter

This just turns the string-based splitter into a char-based one, saving
both memory and CPU cycles.

Change-Id: I9c93f23c79a32d662a8d7358ad928c5757359c37
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: reuse SimpleDataTimeUtil 81/7381/1
Robert Varga [Sat, 24 May 2014 07:37:53 +0000 (09:37 +0200)]
BUG-582: reuse SimpleDataTimeUtil

Thisreuses the already-existing thread-local safe formatter, squeezing
extra performance in this path.

Change-Id: I4f57f8f462cd2f1b82c9c2cd312f375461b312b5
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: Optimize and correct validateJavaPackage 80/7380/1
Robert Varga [Sat, 24 May 2014 07:15:34 +0000 (09:15 +0200)]
BUG-582: Optimize and correct validateJavaPackage

This removes obsolete set and uses it from Binding. Also does the same
for the package prefix -- this in fact was incorrect a happened to work
because YANG version == 1, same as our binding version. Finally we
optimize the validateJavaPackage() since it is a major CPU hog.

Change-Id: Ib189606cbc78a47681d4eb30174ebc51d82e04bc
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: Operate on characters when checking for leading digit 79/7379/1
Robert Varga [Sat, 24 May 2014 06:37:48 +0000 (08:37 +0200)]
BUG-582: Operate on characters when checking for leading digit

Do not use strings when we are checking/reconstructing the leading
character -- this allows for more efficient operation.

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