yangtools.git
9 years agoMerge "BUG-461 Test transformation of rpc input using XmlDocumentUtils"
Tony Tkacik [Tue, 29 Jul 2014 09:25:01 +0000 (09:25 +0000)]
Merge "BUG-461 Test transformation of rpc input using XmlDocumentUtils"

9 years agoMerge "BUG-1413: fixed bug in antlr grammar."
Tony Tkacik [Tue, 29 Jul 2014 09:14:02 +0000 (09:14 +0000)]
Merge "BUG-1413: fixed bug in antlr grammar."

9 years agoBUG-1431: make InstnaceIdentifier serializable 06/9406/2
Robert Varga [Mon, 28 Jul 2014 20:43:38 +0000 (22:43 +0200)]
BUG-1431: make InstnaceIdentifier serializable

Straightforward fix for serializability.

Change-Id: I6681e6c85a4ebb8bf23d4dc239204b3a757ea942
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1381: remove getLock() and deprecated constructor 20/9320/4
Robert Varga [Fri, 25 Jul 2014 13:37:26 +0000 (15:37 +0200)]
BUG-1381: remove getLock() and deprecated constructor

All users have been updated to synchronize properly, now remove
getLock(). At the same time, shed the deprecated contructor, too.
Requires I3e962f284132b376f77e9e2665b3fbb47f246514 to go into controller
first.

Change-Id: Ic8b62468a4e829f035e45b3c715966315b3103a0
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Degrade DataNodeContainer.getChildNodes() from Set to Collection"
Tony Tkacik [Mon, 28 Jul 2014 15:03:00 +0000 (15:03 +0000)]
Merge "Degrade DataNodeContainer.getChildNodes() from Set to Collection"

9 years agoMerge "Improve performance of SchemaContext.findModuleByName()"
Tony Tkacik [Mon, 28 Jul 2014 15:01:43 +0000 (15:01 +0000)]
Merge "Improve performance of SchemaContext.findModuleByName()"

9 years agoMerge "Fix Ip{Address,Prefix}Builder performance"
Tony Tkacik [Mon, 28 Jul 2014 15:01:27 +0000 (15:01 +0000)]
Merge "Fix Ip{Address,Prefix}Builder performance"

9 years agoDegrade DataNodeContainer.getChildNodes() from Set to Collection 52/9352/6
Robert Varga [Sat, 26 Jul 2014 02:17:52 +0000 (04:17 +0200)]
Degrade DataNodeContainer.getChildNodes() from Set to Collection

Datastore-geared workload shows that around 1% of CPU is being used by
AbstractDocumentedDataNodeContainer.getChildNodes(). Of that, around 72%
is spent in ImmutableSet.copyOf(). We could perform that copy in the
constructor, but we can actually do better.

As it turns out, there is already a childNodes map, which is immutable
and indexed via QName present. That indexing guarantees that the values
compare as distinct, so we can reuse childNodes.values(), except for the
contract.

None of the callers care if the return is a Collection, so downgrade the
return, such that we can elide copying the stuff completely. Also fixup
all the callers. Requires https://git.opendaylight.org/gerrit/#/c/9340/
to fix controller-based users.

Change-Id: I310b351d80955a37f6672064dd238bb9cb1e16b1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoImprove performance of SchemaContext.findModuleByName() 51/9351/6
Robert Varga [Sat, 26 Jul 2014 05:24:38 +0000 (07:24 +0200)]
Improve performance of SchemaContext.findModuleByName()

Maintaining an index multimap allows us to heavily optimize lookups,
especially when coming from restconf, which accepts the latest revision
of a particular module.

Change-Id: I615a3c08508111d9389821d24f51cd35c06b5eb1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-461 Test transformation of rpc input using XmlDocumentUtils 80/9380/1
Maros Marsalek [Mon, 28 Jul 2014 12:46:08 +0000 (14:46 +0200)]
BUG-461 Test transformation of rpc input using XmlDocumentUtils

Change-Id: I5d1a8c5e2360fc3cfd47c72facac9007c8a2cc4b
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoReuse comparator between sort invocations 50/9350/7
Robert Varga [Sat, 26 Jul 2014 05:23:32 +0000 (07:23 +0200)]
Reuse comparator between sort invocations

Change-Id: Ic7b36c76424a910df6f958ce468d58aef6bcd1fd
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Convert SchemaSourceRegistration to extend ObjectRegistration"
Robert Varga [Mon, 28 Jul 2014 09:50:14 +0000 (09:50 +0000)]
Merge "Convert SchemaSourceRegistration to extend ObjectRegistration"

9 years agoMerge "BUG-1412: fixed bug in antlr grammar."
Tony Tkacik [Mon, 28 Jul 2014 09:39:04 +0000 (09:39 +0000)]
Merge "BUG-1412: fixed bug in antlr grammar."

9 years agoConvert SchemaSourceRegistration to extend ObjectRegistration 74/9374/1
Tony Tkacik [Mon, 28 Jul 2014 09:35:35 +0000 (11:35 +0200)]
Convert SchemaSourceRegistration to extend ObjectRegistration

Change-Id: I86a48fb4846fa88fcd459ebe06fa5bcbbe0918a4
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "BUG-432: remove type argument from Registration"
Tony Tkacik [Mon, 28 Jul 2014 08:54:21 +0000 (08:54 +0000)]
Merge "BUG-432: remove type argument from Registration"

9 years agoMerge "Cache public view of children of AbstractImmutableDataContainerNode"
Tony Tkacik [Mon, 28 Jul 2014 08:39:42 +0000 (08:39 +0000)]
Merge "Cache public view of children of AbstractImmutableDataContainerNode"

9 years agoMerge "Optimize AbstractDocumentedDataNodeContainer.getDataChildByName()"
Tony Tkacik [Mon, 28 Jul 2014 08:39:30 +0000 (08:39 +0000)]
Merge "Optimize AbstractDocumentedDataNodeContainer.getDataChildByName()"

9 years agoMerge "BUG-997: Introduce SchemaSource respository and related APIs"
Tony Tkacik [Mon, 28 Jul 2014 08:37:55 +0000 (08:37 +0000)]
Merge "BUG-997: Introduce SchemaSource respository and related APIs"

9 years agoMerge "BUG-865: remove InstanceIdentifier.Builder.getIdentifier()"
Tony Tkacik [Mon, 28 Jul 2014 08:15:17 +0000 (08:15 +0000)]
Merge "BUG-865: remove InstanceIdentifier.Builder.getIdentifier()"

9 years agoMerge "Rework data.api.InstanceIdentifier to work on Iterables"
Tony Tkacik [Mon, 28 Jul 2014 08:13:43 +0000 (08:13 +0000)]
Merge "Rework data.api.InstanceIdentifier to work on Iterables"

9 years agoMerge changes I1a5340f1,I9bb2bdd9
Martin Vitez [Mon, 28 Jul 2014 07:20:10 +0000 (07:20 +0000)]
Merge changes I1a5340f1,I9bb2bdd9

* changes:
  Implement DatastoreIdentifierBuilder
  Add String to known-immutable classes

9 years agoBUG-997: Introduce SchemaSource respository and related APIs 67/9367/2
Robert Varga [Sat, 19 Jul 2014 09:05:53 +0000 (11:05 +0200)]
BUG-997: Introduce SchemaSource respository and related APIs

Change-Id: I9cddf1ca0d1df4360b6110663c0c5eb89bd8f51c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 1392: New yang-common/util classes"
Robert Varga [Mon, 28 Jul 2014 06:41:03 +0000 (06:41 +0000)]
Merge "Bug 1392: New yang-common/util classes"

9 years agoMerge "Bug 1386: Added DeadlockDetectingListeningExecutorService"
Robert Varga [Mon, 28 Jul 2014 06:40:52 +0000 (06:40 +0000)]
Merge "Bug 1386: Added DeadlockDetectingListeningExecutorService"

9 years agoBug 1392: New yang-common/util classes 40/9240/5
Thomas Pantelis [Mon, 14 Jul 2014 16:13:08 +0000 (12:13 -0400)]
Bug 1392: New yang-common/util classes

Needed for https://git.opendaylight.org/gerrit/#/c/9178/

OperationFailedException:

   Generalized exception class that contains an RpcError list.

MappingCheckedFuture:

   Futures#addCallback and Futures#transform call Future#get but
   CheckedFuture doesn't override the get methods to translate exceptions
   to the checked type. Thus you don't get the checked exception when using
   those Futures methods. This kind of defeats the purpose of CheckedFuture.

   The new MappingCheckedFuture class overrides the get methods to translate exceptions.

ExceptionMapper:

   Generalized class for use with CheckedFuture to translate exceptions to a
   specified exception type.

Change-Id: Idb4c7e8b5c2cf17795de2f3af4278989ac7bd116
Signed-off-by: tpantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1413: fixed bug in antlr grammar. 65/9365/1
Martin Vitez [Fri, 25 Jul 2014 12:10:51 +0000 (14:10 +0200)]
BUG-1413: fixed bug in antlr grammar.

Parser was not able to parse unknown node in extension argument declaration.
Added test.

Change-Id: I834cc47bbae8834484ff024f97dcf77f3c5ddbf9
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-1412: fixed bug in antlr grammar. 09/9309/2
Martin Vitez [Fri, 25 Jul 2014 10:28:26 +0000 (12:28 +0200)]
BUG-1412: fixed bug in antlr grammar.

Parser was not able to handle description statement inside unknown statement.
Added test.

Change-Id: I7e3e68ac20694c415bc7bbbc5406967727394967
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBug 1386: Added DeadlockDetectingListeningExecutorService 06/9206/5
Thomas Pantelis [Mon, 14 Jul 2014 04:12:45 +0000 (00:12 -0400)]
Bug 1386: Added DeadlockDetectingListeningExecutorService

Change-Id: I1da4c9ae118e0dd5248d42adccb3dcfff23fe0dd
Signed-off-by: tpantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-432: remove type argument from Registration 62/9362/1
Robert Varga [Sun, 27 Jul 2014 19:56:46 +0000 (21:56 +0200)]
BUG-432: remove type argument from Registration

Change-Id: I5899328c96de8f6f473c1ab8767df10e614b41e0
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoCache public view of children of AbstractImmutableDataContainerNode 53/9353/5
Robert Varga [Sat, 26 Jul 2014 02:30:13 +0000 (04:30 +0200)]
Cache public view of children of AbstractImmutableDataContainerNode

Tracing of a datastore-heavy workload shows about 1% CPU being spent
in getValue(). This allocates 1.8M objects, just to throw them away.
Rather than that, let's wrap the map itself, which guarantes .values()
to be immutable, thus eliding the CPU cost.

Change-Id: Ieef0a2bb791ffd99f934457444d168f1a6c9fd77
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoOptimize AbstractDocumentedDataNodeContainer.getDataChildByName() 49/9349/4
Robert Varga [Sat, 26 Jul 2014 01:55:20 +0000 (03:55 +0200)]
Optimize AbstractDocumentedDataNodeContainer.getDataChildByName()

Datastore-intensive workload shows 2% CPU expended in this method, with
three quarters of that actually eaten up by the iterator (and the rest by
1M invocations of QName.equals()). Given that we know that childNodes
are keyed by the QName, this is utterly wasteful, so let's do a simple
lookup.

Change-Id: I44688cb92031b2d75a09d58bd76c63bb28ccbfae
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-865: remove InstanceIdentifier.Builder.getIdentifier() 48/9348/4
Robert Varga [Sat, 26 Jul 2014 00:58:31 +0000 (02:58 +0200)]
BUG-865: remove InstanceIdentifier.Builder.getIdentifier()

This method has been long-deprecated, so let's just remove it.

Change-Id: Ib4ab7be5c463729607ae75c10d0ae6c500c5990b
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRework data.api.InstanceIdentifier to work on Iterables 30/9330/4
Robert Varga [Thu, 3 Jul 2014 16:22:25 +0000 (18:22 +0200)]
Rework data.api.InstanceIdentifier to work on Iterables

Profiling storage-dominated workloads shows that
InstanceIdentifier.node() is dominating by taking up 16% of the CPU
cycles, with 82% of that being spent in ImmutableList$Builder.addAll().
All of these calls occur in the data change resolution path, where they
account for 53% of CPU time.

This patch removes the ImmutableList at the heart of InstanceIdentifier
with an Iterable, along with all the machinery we know and love from the
binding InstanceIdentifier.

While we are at it, perform complete house-cleaning, compacting code and
tuning it for perfomance.

Change-Id: I52884d5660086ac53647a2a39127578017449b2d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoImplement DatastoreIdentifierBuilder 54/9354/2
Robert Varga [Sat, 26 Jul 2014 15:50:13 +0000 (17:50 +0200)]
Implement DatastoreIdentifierBuilder

This is straightforward enough, so make it work with BA clients.

Change-Id: I1a5340f1ac72148e11cb54554acbb49540251f88
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdd String to known-immutable classes 44/9344/1
Robert Varga [Sat, 26 Jul 2014 00:04:44 +0000 (02:04 +0200)]
Add String to known-immutable classes

All instances of String are guaranteed to be immutable, not sure why
that was not captured anywhere.

Change-Id: I9bb2bdd91a0f54e6a8083c047cfd99c0cd029b4b
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoImprove QNameModule.equals() performance 29/9329/1
Robert Varga [Fri, 25 Jul 2014 19:09:23 +0000 (21:09 +0200)]
Improve QNameModule.equals() performance

URI.equals() is slower than Date.equals(), so let's compare revision
first, hopefully eliding the costlier equality check.

Change-Id: Ia42e13917432c696c756758c95c3f6a668396ff9
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix Ip{Address,Prefix}Builder performance 24/9324/1
Robert Varga [Fri, 25 Jul 2014 15:58:48 +0000 (17:58 +0200)]
Fix Ip{Address,Prefix}Builder performance

Using String.matches() incurs major overhead of almost 4ms. Precompile
the pattern and be smart about the use of it. At the same time do a
small optimization to HostBuilder in the form of not instantiating
multiple matchers.

Change-Id: Ifc7f5ff90e71c545acc00275d84780cebe02ec1c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-1381: guide users to use external synchronized block"
Tony Tkacik [Fri, 25 Jul 2014 11:17:10 +0000 (11:17 +0000)]
Merge "BUG-1381: guide users to use external synchronized block"

9 years agoCodecs can handle the same yang "case" from multiple resources 08/9308/2
Martin Sunal [Fri, 25 Jul 2014 09:39:42 +0000 (11:39 +0200)]
Codecs can handle the same yang "case" from multiple resources

- resolves a problem when the same case statements are augmented through different paths

Change-Id: I85a0972e352556c525ab64e093e77ad33abeedba
Signed-off-by: Martin Sunal <msunal@cisco.com>
9 years agoMerge "Fix XmlStreamUtils writing attributes."
Tony Tkacik [Fri, 25 Jul 2014 08:16:26 +0000 (08:16 +0000)]
Merge "Fix XmlStreamUtils writing attributes."

9 years agoMerge "BUG-1414: fix InstanceIdentifier.child(Class, Object)"
Tony Tkacik [Fri, 25 Jul 2014 08:10:53 +0000 (08:10 +0000)]
Merge "BUG-1414: fix InstanceIdentifier.child(Class, Object)"

9 years agoMerge "BUG-1407 fix."
Tony Tkacik [Fri, 25 Jul 2014 07:58:43 +0000 (07:58 +0000)]
Merge "BUG-1407 fix."

9 years agoFix XmlStreamUtils writing attributes. 90/9290/3
Maros Marsalek [Thu, 24 Jul 2014 15:06:09 +0000 (17:06 +0200)]
Fix XmlStreamUtils writing attributes.

The prefix for attributes was no set.
This would result in an exception when no prefix was available by default.

Using RandomPrefix now.

Change-Id: I6110293b262a77f987534fe98abf51755a066be0
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoBUG-1407 fix. 72/9272/4
Alex Fan [Thu, 24 Jul 2014 21:04:15 +0000 (14:04 -0700)]
BUG-1407 fix.

Change-Id: I4a7dbcbdbed61593d0096fa01a32af41a4cec4da
Signed-off-by: Alex Fan <railor33@gmail.com>
9 years agoBUG-1381: guide users to use external synchronized block 94/9094/4
Robert Varga [Wed, 16 Jul 2014 20:56:41 +0000 (22:56 +0200)]
BUG-1381: guide users to use external synchronized block

This will prevent potential misuses and allow us to scale the utility
class further.

Change-Id: I14bbbf76ccfc7e0ff7942880b25d1f6d5964283e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1414: fix InstanceIdentifier.child(Class, Object) 84/9284/1
Robert Varga [Thu, 24 Jul 2014 11:42:18 +0000 (13:42 +0200)]
BUG-1414: fix InstanceIdentifier.child(Class, Object)

The result of the method is always a KeyedInstanceIdentifier, so let's
not force users to use casts.

Change-Id: Icabb8999445ff64936e7a32a69eacfc2c9647c64
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoSpeed up augmentable class serialization 82/9282/1
Robert Varga [Thu, 24 Jul 2014 11:08:37 +0000 (13:08 +0200)]
Speed up augmentable class serialization

During debugging an unrelated issue, we have noticed the following
cropping up in thread dumps quite often:

java.lang.Thread.State: RUNNABLE
  at sun.reflect.Reflection.getCallerClass(Native Method)
  at java.lang.Class.getDeclaredField(Unknown Source)
  at org.opendaylight.yangtools.sal.binding.generator.impl.LazyGeneratedCodecRegistry$AugmentableDispatchCodec.getAugmentations(LazyGeneratedCodecRegistry.java:977)
  at org.opendaylight.yangtools.sal.binding.generator.impl.LazyGeneratedCodecRegistry$AugmentableDispatchCodec.serialize(LazyGeneratedCodecRegistry.java:968)
  at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.bandwidth.object.Bandwidth$Broker$Codec$DOM.toDomStatic(Bandwidth$Broker$Codec$DOM.java)
  at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.path.computation.client.reported.lsp.Path$Broker$Codec$DOM.toDomStatic(Path$Broker$Codec$DOM.java)

Leading to conjecture that the native call is pretty costly. This
patch introduces a weakly-keyed cache of reflection handles, which
should improve performance.

Change-Id: Ie7001df912c47c77bee8127a2258e8a6a4dce469
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Documented Augmentable Codec"
Robert Varga [Thu, 24 Jul 2014 10:29:16 +0000 (10:29 +0000)]
Merge "Documented Augmentable Codec"

9 years agoDocumented Augmentable Codec 78/9278/1
Tony Tkacik [Thu, 24 Jul 2014 08:01:24 +0000 (10:01 +0200)]
Documented Augmentable Codec

Change-Id: Icecb78a557d41b49bce4af673aeae247c8b258d3
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 1363: Introduced ModifiedNodeDoesNotExistsException. 58/9058/3
Tony Tkacik [Wed, 16 Jul 2014 11:50:53 +0000 (13:50 +0200)]
Bug 1363: Introduced ModifiedNodeDoesNotExistsException.

Introduced new checked exception ModifiedNodeDoesNotExists.
This exception is thrown when node which has subtree
modification did not exist at time of transaction allocation
and also do not exist when allocation was processed
to be commited.

Change-Id: I54f040034b43bfaf4bdda089ad9d2378ddd6ab09
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoRemove XmlDocumentUtils.fromElement() 75/8875/7
Robert Varga [Wed, 9 Jul 2014 18:43:27 +0000 (20:43 +0200)]
Remove XmlDocumentUtils.fromElement()

This method is completely unused, so let's remove it.

Change-Id: I5aa8fd646e925c3a92b0acec5041127be954a06d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-979: reworked data schema nodes ordering"
Tony Tkacik [Tue, 22 Jul 2014 09:30:32 +0000 (09:30 +0000)]
Merge "BUG-979: reworked data schema nodes ordering"

9 years agoMerge "Revert "BUG-1097: implemented check for null or empty list in builder classes.""
Tony Tkacik [Mon, 21 Jul 2014 15:54:59 +0000 (15:54 +0000)]
Merge "Revert "BUG-1097: implemented check for null or empty list in builder classes.""

9 years agoFixed uninitialized DOMResult in XML codecs. 03/9203/1
Tony Tkacik [Mon, 21 Jul 2014 14:59:20 +0000 (16:59 +0200)]
Fixed uninitialized DOMResult in XML codecs.

Change-Id: I8c0833985b42be304edc445c40a5528ed8a2dcbe
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoRevert "BUG-1097: implemented check for null or empty list in builder classes." 02/9202/1
Tony Tkacik [Mon, 21 Jul 2014 14:03:50 +0000 (14:03 +0000)]
Revert "BUG-1097: implemented check for null or empty list in builder classes."

This reverts commit 883ae26ee98953a5df7cc0956afa807a82d58a3a
which was breakage in Binding Specification and should not
be merged without community-wide discussion.

Change-Id: Ifda1124d974b1ce299551be80a84c45b85b4155a
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "BUG-1281: move the default codec"
Tony Tkacik [Mon, 21 Jul 2014 13:29:31 +0000 (13:29 +0000)]
Merge "BUG-1281: move the default codec"

9 years agoMerge "Move XmlDocumentUtils.writeValueByType()"
Tony Tkacik [Mon, 21 Jul 2014 13:29:04 +0000 (13:29 +0000)]
Merge "Move XmlDocumentUtils.writeValueByType()"

9 years agoMerge "BUG-865: get rid of InstanceIdentifier-related warnings"
Tony Tkacik [Mon, 21 Jul 2014 13:12:05 +0000 (13:12 +0000)]
Merge "BUG-865: get rid of InstanceIdentifier-related warnings"

9 years agoMerge "Bug 1329: Use original definition for searching for java class."
Martin Vitez [Mon, 21 Jul 2014 12:45:43 +0000 (12:45 +0000)]
Merge "Bug 1329: Use original definition for searching for java class."

9 years agoBUG-1281: move the default codec 25/9025/3
Robert Varga [Tue, 15 Jul 2014 14:36:28 +0000 (16:36 +0200)]
BUG-1281: move the default codec

This moves the default codec such that it can be shared between various
utility classes.

Change-Id: I570f6fe36a70fe50c35569538d4db29ea4775ce7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMove XmlDocumentUtils.writeValueByType() 74/8874/6
Robert Varga [Wed, 9 Jul 2014 18:39:04 +0000 (20:39 +0200)]
Move XmlDocumentUtils.writeValueByType()

Now that we're using XMLStreamWriter, the only user lives in DomUtils,
so let's move the functionality over there.

Change-Id: Ia3cb69f5222ffb9c645bc91f79d1aa908b4fe971
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFixed missing root document node for XmlStreamWriter 92/9192/1
Tony Tkacik [Mon, 21 Jul 2014 10:28:09 +0000 (12:28 +0200)]
Fixed missing root document node for XmlStreamWriter

Change-Id: I875ce7a77b646cedc4680c150243f5d74de9eebb
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 626 - It should be possible to create java doc"
Martin Vitez [Mon, 21 Jul 2014 09:46:04 +0000 (09:46 +0000)]
Merge "Bug 626 - It should be possible to create java doc"

9 years agoMerge "BUG-865: removed use of deprecated code in yang-parser-impl tests."
Tony Tkacik [Mon, 21 Jul 2014 09:15:25 +0000 (09:15 +0000)]
Merge "BUG-865: removed use of deprecated code in yang-parser-impl tests."

9 years agoMerge "BUG-865: removed use of deprecated schema path creation."
Tony Tkacik [Mon, 21 Jul 2014 09:15:06 +0000 (09:15 +0000)]
Merge "BUG-865: removed use of deprecated schema path creation."

9 years agoMerge "Tests for TreeNodeUtils"
Tony Tkacik [Mon, 21 Jul 2014 09:11:21 +0000 (09:11 +0000)]
Merge "Tests for TreeNodeUtils"

9 years agoMerge "BUG-865: prune deprecated constructors"
Tony Tkacik [Mon, 21 Jul 2014 09:08:41 +0000 (09:08 +0000)]
Merge "BUG-865: prune deprecated constructors"

9 years agoMerge "BUG-1281: switch serialization to use StAX APIs"
Tony Tkacik [Mon, 21 Jul 2014 09:07:11 +0000 (09:07 +0000)]
Merge "BUG-1281: switch serialization to use StAX APIs"

9 years agoBUG-865: get rid of InstanceIdentifier-related warnings 91/9191/1
Robert Varga [Mon, 21 Jul 2014 09:04:12 +0000 (11:04 +0200)]
BUG-865: get rid of InstanceIdentifier-related warnings

InstanceIdentifier has a few deprecated methods, which are still used
all over the place. Migrate their users to new equivalents.

Change-Id: Ifba5dbaee9e3f2a74bc084b085095712f422fb46
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 626 - It should be possible to create java doc 92/8592/14
Ladislav Borak [Thu, 10 Jul 2014 12:39:45 +0000 (14:39 +0200)]
Bug 626 - It should be possible to create java doc

- added interface for documented types
- added fieldto for builders GTO and GT
- modified print method in BaseTemplate, EnumTemplate, ClassTemplate and
  and Interface template
  - fix for Bug 1001 - added description for enum constants
  - fix for Bug 1002 - changed formatting of type description

Change-Id: I5b0ea61369ff86243740d83282a2c4a3115be733
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoBUG-1097: implemented check for null or empty list in builder classes. 20/9120/3
Martin Vitez [Thu, 17 Jul 2014 14:18:00 +0000 (16:18 +0200)]
BUG-1097: implemented check for null or empty list in builder classes.

If one of builder variable is List, do following:
 - for null value create Collections.emptyList()
 - for empty list create Collections.emptyList()
 - for any other list create ImmutableList.copyOf(<arg>)

Added test.

Change-Id: I83e5aaf4f4253aa2e195c23ff5b48b04fc883052
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge changes Ibfbb4deb,I96e28324
Tony Tkacik [Mon, 21 Jul 2014 08:21:35 +0000 (08:21 +0000)]
Merge changes Ibfbb4deb,I96e28324

* changes:
  BUG-1377: fixed code generation for nodes defined under grouping.
  BUG-865: removed unused utility methods from SchemaContextUtil

9 years agoMerge "BUG-1276: fixed generated union constructor"
Tony Tkacik [Mon, 21 Jul 2014 08:15:04 +0000 (08:15 +0000)]
Merge "BUG-1276: fixed generated union constructor"

9 years agoMerge "BUG-532: implemented copy constructor for generated builder classes."
Tony Tkacik [Mon, 21 Jul 2014 08:13:14 +0000 (08:13 +0000)]
Merge "BUG-532: implemented copy constructor for generated builder classes."

9 years agoMerge "While the controller is starting up, we see the following info messages which...
Tony Tkacik [Mon, 21 Jul 2014 07:19:17 +0000 (07:19 +0000)]
Merge "While the controller is starting up, we see the following info messages which seems redundant. o.o.y.y.d.i.s.tree.InMemoryDataTree - Attempting to install schema context SchemaContextImpl<snip>"

9 years agoMerge "Making javadoc actually get flagged as javadoc"
Tony Tkacik [Mon, 21 Jul 2014 07:17:31 +0000 (07:17 +0000)]
Merge "Making javadoc actually get flagged as javadoc"

9 years agoBUG-1346: fix wrong prefix generation 43/9143/3
Timotej Kubas [Fri, 18 Jul 2014 14:12:49 +0000 (16:12 +0200)]
BUG-1346: fix wrong prefix generation

Java promotion rules are slightly different than C, so the expression
got promoted to int, which obviously did the wrong thing. Add an
explicit cast to prevent it.

+test

Change-Id: Id9e708ca86b7267b84b2a3db5ad52aeef651763d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Timotej Kubas <tkubas@cisco.com>
9 years agoMerge "BUG-1388: fixed ClassTemplate to avoid unused import of BigInteger."
Robert Varga [Fri, 18 Jul 2014 14:04:25 +0000 (14:04 +0000)]
Merge "BUG-1388: fixed ClassTemplate to avoid unused import of BigInteger."

9 years agoBindingGeneratorUtil.computeDefaultSUID() should not modify lists 48/9148/1
Robert Varga [Fri, 18 Jul 2014 09:21:55 +0000 (11:21 +0200)]
BindingGeneratorUtil.computeDefaultSUID() should not modify lists

This prevents the utility from churning the lists passed in. Also
shares the comparator.

Change-Id: Iaded850b5b0fa98d79e4e4fdbed52175c669e8a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1388: fixed ClassTemplate to avoid unused import of BigInteger. 40/9140/1
Martin Vitez [Fri, 18 Jul 2014 08:43:36 +0000 (10:43 +0200)]
BUG-1388: fixed ClassTemplate to avoid unused import of BigInteger.

Change-Id: I88e3aa6c9456603360de2053b5a2bbeca4877aa7
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-865: prune deprecated constructors 56/9156/1
Robert Varga [Thu, 17 Jul 2014 22:16:31 +0000 (00:16 +0200)]
BUG-865: prune deprecated constructors

This patch removes long-deprecated QName constructors in favor of static
factory methods.

Change-Id: I818cdcd8f1a71a1318c1a688b3594de62581a535
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1377: fixed code generation for nodes defined under grouping. 13/9113/2
Martin Vitez [Thu, 17 Jul 2014 10:23:54 +0000 (12:23 +0200)]
BUG-1377: fixed code generation for nodes defined under grouping.

If node was defined in choice case which parent choice was defined in grouping,
node does not implement ChildOf interface. Fixed by adding search for parent node
also from groupings.

Added test.

Change-Id: Ibfbb4deb719804fd16cce5c091cc0969aeaf821e
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge "BUG-1281: rework XmlStreamUtils a bit more"
Tony Tkacik [Thu, 17 Jul 2014 11:41:16 +0000 (11:41 +0000)]
Merge "BUG-1281: rework XmlStreamUtils a bit more"

9 years agoBUG-865: removed unused utility methods from SchemaContextUtil 03/9103/2
Martin Vitez [Thu, 17 Jul 2014 07:38:40 +0000 (09:38 +0200)]
BUG-865: removed unused utility methods from SchemaContextUtil

By using getOriginal method from DerivableSchemaNode we can avoid searching for original node from grouping. This causes
that some of utility methods from SchemaContextUtil become redundant.

Change-Id: I96e2832436331b2f454e21aedb01fb552e2e2d6e
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoTurned off codec source code generation by default. 04/9104/1
Tony Tkacik [Thu, 17 Jul 2014 08:02:25 +0000 (10:02 +0200)]
Turned off codec source code generation by default.

Change-Id: Iad6eda63c109e3d813c704e2eda56b067c7d1688
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Output generated codec source to files"
Tony Tkacik [Thu, 17 Jul 2014 07:17:22 +0000 (07:17 +0000)]
Merge "Output generated codec source to files"

9 years agoMerge "BUG-994: fix QName not sharing QNameModule"
Martin Vitez [Thu, 17 Jul 2014 07:02:03 +0000 (07:02 +0000)]
Merge "BUG-994: fix QName not sharing QNameModule"

9 years agoOutput generated codec source to files 31/7231/12
tpantelis [Sat, 10 May 2014 16:04:46 +0000 (12:04 -0400)]
Output generated codec source to files

- Added SourceCodeGenerator helper class that holds the generated
  field/method source code until outputGeneratedSource is called to
  generate the source for the entire class and output to a file
  under generated-sources.

- Modified TransformerGenerator and JavassistUtils to use the
  SourceCodeGenerator.

- Other pom changes to eliminate Eclipse errors.

Change-Id: Id910161569835d0cf9659ddf806e21f2545c713b
Signed-off-by: tpantelis <tpanteli@brocade.com>
9 years agoBUG 1359 - to make mdsal karaf features work 99/9099/1
Surekha Bejgam [Wed, 16 Jul 2014 23:54:19 +0000 (16:54 -0700)]
BUG 1359 - to make mdsal karaf features work

Signed-off-by: Surekha Bejgam <sbejgam@cisco.com>
9 years agoBUG-994: fix QName not sharing QNameModule 90/9090/1
Robert Varga [Wed, 16 Jul 2014 18:18:18 +0000 (20:18 +0200)]
BUG-994: fix QName not sharing QNameModule

Fixes the most obvious offender. With this patch >105000 QNameModule
instances are eliminated, bringing down the base memory use by about 8MB.

Change-Id: I63cd091ee9ce4292d0ad8066d01bf0a6120802b8
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-865: removed use of deprecated code in yang-parser-impl tests. 78/9078/1
Martin Vitez [Wed, 16 Jul 2014 14:36:20 +0000 (16:36 +0200)]
BUG-865: removed use of deprecated code in yang-parser-impl tests.

Change-Id: I468807cf3caa2746386c13316fc0f4579bf9c81d
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-865: removed use of deprecated schema path creation. 77/9077/1
Martin Vitez [Wed, 16 Jul 2014 14:19:59 +0000 (16:19 +0200)]
BUG-865: removed use of deprecated schema path creation.

Change-Id: I5110b098e032994c8ea35661b06a0abd00aaf111
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoTests for TreeNodeUtils 72/9072/1
Jan Hajnar [Wed, 16 Jul 2014 13:11:29 +0000 (15:11 +0200)]
Tests for TreeNodeUtils

Change-Id: I6961f810b3aa2f93ad950992a3d49d1cda96a66e
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoBUG-1371: improved parser handling of invalid yang list key. 56/9056/1
Martin Vitez [Wed, 16 Jul 2014 11:34:58 +0000 (13:34 +0200)]
BUG-1371: improved parser handling of invalid yang list key.

Change-Id: I7036ce4e97b14c22604dc396a2612c1f2fd62ca6
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-979: reworked data schema nodes ordering 41/8841/6
Martin Vitez [Wed, 9 Jul 2014 06:54:21 +0000 (08:54 +0200)]
BUG-979: reworked data schema nodes ordering

This patch changes ordering of child nodes - nodes are ordered as they are declared in
yang file (before they were sorted in alphabetical order). This ordering is applied for
schema node builders and also for schema node instances.

Change-Id: I628d40be638fc56ee3e4e1ff9c161ab1cf88ae19
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-532: implemented copy constructor for generated builder classes. 48/9048/1
Martin Vitez [Wed, 16 Jul 2014 08:03:41 +0000 (10:03 +0200)]
BUG-532: implemented copy constructor for generated builder classes.

Added test.

Change-Id: Ic9d6b4c80b431978a624c7a0d7cd0f7f71d4bb8c
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge "BUG-1091: sever the NormalizedNode/Node relationship"
Tony Tkacik [Wed, 16 Jul 2014 07:51:56 +0000 (07:51 +0000)]
Merge "BUG-1091: sever the NormalizedNode/Node relationship"

9 years agoMerge "Modifications RpcResultBuilder class"
Tony Tkacik [Wed, 16 Jul 2014 07:50:20 +0000 (07:50 +0000)]
Merge "Modifications RpcResultBuilder class"

9 years agoBUG-1270: optimize SchemaPath creation for augmentations 42/9042/1
Robert Varga [Tue, 15 Jul 2014 22:15:55 +0000 (00:15 +0200)]
BUG-1270: optimize SchemaPath creation for augmentations

As it turns out, at least in one case we can use
SchemaPath.createChild(), which is much more efficient than the
Iterable-based constructor. Drop a FIXME to investigate whether we can
reuse an existing SchemaPath in the other case.

Change-Id: I1aae1c9855490a21bcda7ffe17d52e081cc7de1d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1270: optimize SchemaPath creation 41/9041/1
Robert Varga [Tue, 15 Jul 2014 21:54:42 +0000 (23:54 +0200)]
BUG-1270: optimize SchemaPath creation

There is no need to instantiate temporary collections. Also
UnionTypeBuilder instantiated the same path over and over again. Fix all
the offenders.

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