yangtools.git
9 years agoMerge "Bug 2480: Union objects are generated incorrectly when using bits type"
Robert Varga [Fri, 23 Jan 2015 07:09:26 +0000 (07:09 +0000)]
Merge "Bug 2480: Union objects are generated incorrectly when using bits type"

9 years agoUse Maven Enforcer plugin to require Maven version 37/14237/3
Thanh Ha [Mon, 19 Jan 2015 04:08:42 +0000 (23:08 -0500)]
Use Maven Enforcer plugin to require Maven version

Using the <prerequisites> configuration in pom files is deprecated and
it is recommended to use the maven-enforcer-plugin to enforce these
rules instead.

See:
http://jira.codehaus.org/browse/MNG-5297
http://jira.codehaus.org/browse/MNG-4840

Change-Id: Ia0265ba264693c3ce09ebb24a6a489bad5efa60e
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
9 years agoMerge "Added getModifiedChild to DataTreeCandidateNode."
Robert Varga [Thu, 22 Jan 2015 18:38:01 +0000 (18:38 +0000)]
Merge "Added getModifiedChild to DataTreeCandidateNode."

9 years agoMerge "Bug 2404: RPC and Notification support for Binding Data Codec"
Robert Varga [Thu, 22 Jan 2015 18:31:33 +0000 (18:31 +0000)]
Merge "Bug 2404: RPC and Notification support for Binding Data Codec"

9 years agoMerge "Bug 1305: Review YangTools grammar"
Tony Tkacik [Thu, 22 Jan 2015 16:08:15 +0000 (16:08 +0000)]
Merge "Bug 1305: Review YangTools grammar"

9 years agoBug 1305: Review YangTools grammar 07/13307/6
Martin Ciglan [Tue, 2 Dec 2014 13:38:48 +0000 (14:38 +0100)]
Bug 1305: Review YangTools grammar

Since our grammar uses strings, which are validated in Java code during entering actual statements,
this has been addressed within this commit. Rest of grammar issues have been opened as bugs in bugzilla.

Change-Id: Ia70afeeaa1b59d1b77076b1c71cdacf8c3779d74
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoBug 865: Deprecated Hydrogen Source Repository APIs 77/14377/2
Tony Tkacik [Thu, 22 Jan 2015 11:57:18 +0000 (12:57 +0100)]
Bug 865: Deprecated Hydrogen Source Repository APIs

Deprecated Hydrogen Source Repository APIs, which are not
used in Helium MD-SAL runtime code and
migrated necessary utility methods from deprecated classes
to non-deprecated ones.

Change-Id: I01e2411c501dd221a6126e6fb80edcd0af6bc852
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Improve BaseTemplate speed"
Tony Tkacik [Wed, 21 Jan 2015 14:37:52 +0000 (14:37 +0000)]
Merge "Improve BaseTemplate speed"

9 years agoMerge "Bug 2431: YangTools grammar misses unknown statement in some statements"
Tony Tkacik [Wed, 21 Jan 2015 14:36:02 +0000 (14:36 +0000)]
Merge "Bug 2431: YangTools grammar misses unknown statement in some statements"

9 years agoMerge "Added missing copyright headers to yang-data-impl"
Robert Varga [Wed, 21 Jan 2015 10:41:35 +0000 (10:41 +0000)]
Merge "Added missing copyright headers to yang-data-impl"

9 years agoAdded getModifiedChild to DataTreeCandidateNode. 81/14281/2
Tony Tkacik [Tue, 20 Jan 2015 09:37:22 +0000 (10:37 +0100)]
Added getModifiedChild to DataTreeCandidateNode.

Change-Id: I2e1466d8ef903de2b87a36c49b0b5deba9de9ad8
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoAdded missing copyright headers to yang-data-impl 82/14282/2
Tony Tkacik [Tue, 20 Jan 2015 09:43:42 +0000 (10:43 +0100)]
Added missing copyright headers to yang-data-impl

Change-Id: Ic794c020df39f1a19902a993dfac539f2a6e935f
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-2606: add support for removing augmentations 57/14257/2
Robert Varga [Mon, 19 Jan 2015 16:15:44 +0000 (17:15 +0100)]
BUG-2606: add support for removing augmentations

This patch adds an explicit removeAugmentation() method to the builder.

Change-Id: I2111da008485512930dc2cfe551a787106c5f599
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-2606: formalize the augmentation removal"
Tony Tkacik [Tue, 20 Jan 2015 09:39:18 +0000 (09:39 +0000)]
Merge "BUG-2606: formalize the augmentation removal"

9 years agoBUG-2606: formalize the augmentation removal 56/14256/1
Robert Varga [Mon, 19 Jan 2015 16:11:36 +0000 (17:11 +0100)]
BUG-2606: formalize the augmentation removal

Setting an augmentation to null has the same effect as removing it,
when accessing it via getAugmentation(). Formalize this actually
removing the mapping, which is more space-efficient.

Change-Id: I994b459161d9d374c80a353b82763dfb31faaf3d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2606: Fixed serialization of null augmentations."
Robert Varga [Mon, 19 Jan 2015 16:03:04 +0000 (16:03 +0000)]
Merge "Bug 2606: Fixed serialization of null augmentations."

9 years agoBug 2404: RPC and Notification support for Binding Data Codec 63/13763/8
Tony Tkacik [Fri, 19 Dec 2014 15:48:14 +0000 (16:48 +0100)]
Bug 2404: RPC and Notification support for Binding Data Codec

Added support for serialization and deserialization of RPC
and Notification data from Binding representation to Normalized
Representation.

Change-Id: I2e071ac1fac9d5f2ac34421f1718dbaa6051975c
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2606: Fixed serialization of null augmentations. 50/14250/1
Tony Tkacik [Mon, 19 Jan 2015 14:24:12 +0000 (15:24 +0100)]
Bug 2606: Fixed serialization of null augmentations.

Binding DTO contract allowed to use addAugmentation(T,null)
to remove augmentation, but this was not supported
by binding-data-codec.

Added explicit ommision of null augmentations.

Change-Id: Ib16f3a18e6b09ab970dcaef83e3fca4f490c9ec3
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoRemove deprecated sonar.profile property 36/14236/1
Thanh Ha [Mon, 19 Jan 2015 04:04:21 +0000 (23:04 -0500)]
Remove deprecated sonar.profile property

sonar.profile is deprecated in Sonar 4.5.x which is used by ODL.

Change-Id: I0d4f6c33c4324682035858c45b14af265be97c4b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
9 years agoRevert "Added generated convenience setters that take Builder<T>" 14/14214/3
Robert Varga [Sat, 17 Jan 2015 10:41:18 +0000 (10:41 +0000)]
Revert "Added generated convenience setters that take Builder<T>"

This reverts commit 0bede1b3a817175f7db70fd5347c08c3f0ff1af1, as it breaks
the controller build. The problem is that it breaks current code which passes
in null argument -- which is ambiguous.

Change-Id: Ie6b8882d7790fc21a6a798f3fa94bca40dc71bd5
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdded generated convenience setters that take Builder<T> 93/14093/6
Ed Warnicke [Mon, 12 Jan 2015 01:14:53 +0000 (19:14 -0600)]
Added generated convenience setters that take Builder<T>

Basically, if we previously had

FooBuilder.setBar(Bar value)

we now also have

FooBuilder.setBar(Builder<Bar> value)

That just calls value.build() and calls the original setter.

Change-Id: I99e19f7a8a51af5c4a48ecb8813c6e6202546857
Signed-off-by: Ed Warnicke <eaw@cisco.com>
9 years agoImproved RPCResultBuilder to have convenience methods that take Builders 26/13926/7
Ed Warnicke [Mon, 5 Jan 2015 23:37:32 +0000 (17:37 -0600)]
Improved RPCResultBuilder to have convenience methods that take Builders

Change-Id: I994d085d194a2aa6b318e18b8f8e3a3fc539cde6
Signed-off-by: Ed Warnicke <eaw@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Added RpcResultBuilder.buildFuture() as a convenience method"
Robert Varga [Fri, 16 Jan 2015 17:34:03 +0000 (17:34 +0000)]
Merge "Added RpcResultBuilder.buildFuture() as a convenience method"

9 years agoImprove BaseTemplate speed 98/14198/2
Robert Varga [Fri, 16 Jan 2015 16:53:54 +0000 (17:53 +0100)]
Improve BaseTemplate speed

String processing is sub-optimal in these aspects:
- string-based methods used when character-based ones are available,
- inefficient use of String.replace() for single-character filtering,
- inefficient use of String.replaceAll() where a pre-compiled Pattern
  should be used.
- inefficient use of StringTokenizer where a Splitter can be used

Change-Id: Iee446a4279b9be343891192d93a84a420b32526c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2258: Fixed Type Definition search in runtime generated codecs"
Robert Varga [Fri, 16 Jan 2015 16:40:46 +0000 (16:40 +0000)]
Merge "Bug 2258: Fixed Type Definition search in runtime generated codecs"

9 years agoBug 2480: Union objects are generated incorrectly when using bits type 35/13535/6
Martin Ciglan [Wed, 10 Dec 2014 13:29:05 +0000 (14:29 +0100)]
Bug 2480: Union objects are generated incorrectly when using bits type

In case of bits typedef within union, method getValue() returning array
of booleans was missing.

Change-Id: If4b0f98d3889facff819d02f44566e816674528d
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoMerge "Bug 2563 - Parser should fail when key statement does not reference leaf."
Tony Tkacik [Fri, 16 Jan 2015 15:04:01 +0000 (15:04 +0000)]
Merge "Bug 2563 - Parser should fail when key statement does not reference leaf."

9 years agoAdded RpcResultBuilder.buildFuture() as a convenience method 23/13923/8
Ed Warnicke [Mon, 5 Jan 2015 21:47:44 +0000 (15:47 -0600)]
Added RpcResultBuilder.buildFuture() as a convenience method

Wraps RpcResult<T> in a Future.

Change-Id: Icf045362b9cd3be83f7168cbd2baee0561d516d2
Signed-off-by: Ed Warnicke <eaw@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2258: Fixed Type Definition search in runtime generated codecs 21/12521/4
Tony Tkacik [Mon, 27 Oct 2014 13:11:37 +0000 (14:11 +0100)]
Bug 2258: Fixed Type Definition search in runtime generated codecs

Type Definition search in runtime generated codecs, did not look
up nested (scoped) type definitions properly, which resulted
in IllegalArgumentException in schema context update which
prevented further working of codec.

Updated code to perform correct nested search in grouping
and type-definitoions.

Change-Id: I3860c2f70b5e0ba3d265b7f2b032e89eadaced08
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2431: YangTools grammar misses unknown statement in some statements 44/14144/2
Martin Ciglan [Wed, 14 Jan 2015 14:43:10 +0000 (15:43 +0100)]
Bug 2431: YangTools grammar misses unknown statement in some statements

Based on existing YANG grammar review, these statements missed unknown statement, wrapped in
statement separator (stmtsep):

submodule-stmt
import-stmt
include-stmt
belongs-to-stmt
revision-stmt

Now fixed.

Change-Id: If0ef7325428b10f10cada5ace427798da6917fe0
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoAdd marker interface Builder<T> to generated Builders 24/13924/7
Ed Warnicke [Mon, 5 Jan 2015 23:02:19 +0000 (17:02 -0600)]
Add marker interface Builder<T> to generated Builders

Change-Id: I6e6e7f33143982e4a719ea6d6399947587a627a3
Signed-off-by: Ed Warnicke <eaw@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2563 - Parser should fail when key statement does not reference leaf. 45/14145/3
Peter Kajsa [Wed, 14 Jan 2015 14:45:55 +0000 (15:45 +0100)]
Bug 2563 - Parser should fail when key statement does not reference leaf.

Change-Id: Idec40d3ae75f09894600856a349154cc7fb4b64a
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
9 years agoBUG-2159: deactivate Java 8 javadoc workaround 86/14186/3
Robert Varga [Thu, 15 Jan 2015 21:38:34 +0000 (22:38 +0100)]
BUG-2159: deactivate Java 8 javadoc workaround

Now that the build is compliant with the stricter rules, remove the
compatibility profile.

Change-Id: I6b53931e75b0aceaf73e40fd8a3838fdd06126f1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2159: fix wrong javadocs 85/14185/3
Robert Varga [Thu, 15 Jan 2015 21:36:14 +0000 (22:36 +0100)]
BUG-2159: fix wrong javadocs

Java 8 javadoc generation is a lot stricter than previous versions. This
patch fixes the offenders.

Change-Id: I8a6d7f11a8fb38919d5fa34ab01c3a82849bfa8f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2159: make sure generated comments are Java-8-safe 91/14191/2
Robert Varga [Fri, 16 Jan 2015 09:47:52 +0000 (10:47 +0100)]
BUG-2159: make sure generated comments are Java-8-safe

The javadoc generator produced output which was not compliant with
default Java 8 javadoc settings. This patch fixes that.

Change-Id: I102e1398d49042d785ce451846aeebc20d5eed58
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Shift Builder<P> from toInstance() to build()"
Robert Varga [Thu, 15 Jan 2015 19:11:48 +0000 (19:11 +0000)]
Merge "Shift Builder<P> from toInstance() to build()"

9 years agoShift Builder<P> from toInstance() to build() 92/14092/2
Ed Warnicke [Mon, 12 Jan 2015 00:25:53 +0000 (18:25 -0600)]
Shift Builder<P> from toInstance() to build()

In order to be able to use Builder<P> as a marker
on generated Builders, it needed to shift to build()

All 'internal' uses for Builder have been changed
to use build().  For things used outside of yangtools,
a depracted toInstance() is maintained on child
interfaces/classes.

Change-Id: I43662296e328133a5b5267be54d407e2ad4b95e8
Signed-off-by: Ed Warnicke <eaw@cisco.com>
9 years agoSet root pom.xml <name> for Sonar 22/14022/3
Thanh Ha [Fri, 9 Jan 2015 19:15:58 +0000 (14:15 -0500)]
Set root pom.xml <name> for Sonar

As mentioned on the mailing list Sonar uses the <name> field of the
pom.xml that is passed to the mvn command as the name of the project in
Sonar. In most cases this is the root pom.xml file in a project. This
patch sets the name to the project shortname.

https://lists.opendaylight.org/pipermail/discuss/2014-November/004024.html

Change-Id: I52a1cc89da77913da6e530b2d2776538887c9b63
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
9 years agoBug 1573: Fixed deserialization of not representable Instance Identifier 03/14003/3
Tony Tkacik [Thu, 8 Jan 2015 15:30:59 +0000 (16:30 +0100)]
Bug 1573: Fixed deserialization of not representable Instance Identifier

Not all YangInstanceIdentifier are representable in Binding form,
codecs were designed to handle this and omit such cases,
but one ommision case was missing in deserializing Instance Identifier
without data and this resulted into returning incorrectly
constructed InstanceIdentifier.

Updated test which was testing incorrect behaviour to test correct
behaviour.

Change-Id: I97215f674f7ff164bc2c87d9eef4a254510b0280
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "BUG-2159: update karaf version to 3.0.2"
Tony Tkacik [Wed, 7 Jan 2015 16:15:43 +0000 (16:15 +0000)]
Merge "BUG-2159: update karaf version to 3.0.2"

9 years agoBug 1559, Bug 2406 - Unknown statement is missing in submodule and revision statements 49/13249/2
Peter Kajsa [Mon, 1 Dec 2014 09:57:50 +0000 (10:57 +0100)]
Bug 1559, Bug 2406 - Unknown statement is missing in submodule and revision statements

Bug 1559 - stmtsep is missing in submodule_stmt.
Bug 2406 - in our grammar unknown-statement can occur only after all revision
statements, but in RFC grammar unknown-statement can occur also before or
between two revision statements etc.

Change-Id: Ide4a9044545af8a397cc8c4074ea6ae91022288d
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
9 years agoBUG-2159: update karaf version to 3.0.2 62/13962/1
Robert Varga [Wed, 7 Jan 2015 13:29:11 +0000 (14:29 +0100)]
BUG-2159: update karaf version to 3.0.2

Karaf 3.0.1 doe snot work correctly with Java 8, specifically it does
not export the 1.7 JavaSE osgi.ee property. This bumps the version used
in integration tests.

Change-Id: I67d7cd3fb3f7e243fab3cf7f8c36ff0ec3d91040
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge changes Ic65eb07d,Iab2814f6
Tony Tkacik [Wed, 7 Jan 2015 12:56:50 +0000 (12:56 +0000)]
Merge changes Ic65eb07d,Iab2814f6

* changes:
  BUG-2350: introduce KeyedListNodeCodecContext
  Drop a FIXME for partially-overwritten writes

9 years agoMerge changes I0eabfe3d,I58faf7df,I7e7758f4,Ic56afe1b,I623aa497
Tony Tkacik [Wed, 7 Jan 2015 12:54:55 +0000 (12:54 +0000)]
Merge changes I0eabfe3d,I58faf7df,I7e7758f4,Ic56afe1b,I623aa497

* changes:
  Publish StoreUtils as NormalizedNodes
  Publish TreeNodeUtils as StoreTreeNodes
  Split off UnkeyedListModificationStrategy
  Add better diagnostic on failed write
  Do not override surefire version

9 years agoMerge "Fix whitespace in binding-parent"
Tony Tkacik [Wed, 7 Jan 2015 12:54:10 +0000 (12:54 +0000)]
Merge "Fix whitespace in binding-parent"

9 years agoBUG-2350: introduce KeyedListNodeCodecContext 65/13865/2
Robert Varga [Thu, 25 Dec 2014 17:53:36 +0000 (18:53 +0100)]
BUG-2350: introduce KeyedListNodeCodecContext

Instead of special-casing calls within ListNodeCodecContext, introduce a
subclass which holds the logic specific to keyed items. Improves memory
overhead very slightly by saving two null fields for unkeyed lists.

Change-Id: Ic65eb07d2ee75c583e39cf458ec7e663dd98d335
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoPublish StoreUtils as NormalizedNodes 61/13861/3
Robert Varga [Thu, 25 Dec 2014 07:32:50 +0000 (08:32 +0100)]
Publish StoreUtils as NormalizedNodes

Move the widely useful functionality, which requires only API elements
into the API package, so it can be reused elsewhere.

Change-Id: I0eabfe3dbd1e0035f5ba96a0beee4b4c4d8d4114
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix javadoc reference 64/13864/2
Robert Varga [Thu, 25 Dec 2014 09:34:24 +0000 (10:34 +0100)]
Fix javadoc reference

Javadoc points to a controller package, where this code originated. Make
sure the pointer is uptodate.

Change-Id: I92271808f7b0763700997279482d52886a94db93
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDrop a FIXME for partially-overwritten writes 59/13859/3
Robert Varga [Thu, 25 Dec 2014 08:13:39 +0000 (09:13 +0100)]
Drop a FIXME for partially-overwritten writes

When a user performs a write, followed by a write which changes some
parts of the first one, we arrive at the resulting data in the prepare()
path. That is not right, as we can perform the merge in the seal() path.

The difference is that in MD-SAL the prepare() path is single-threaded,
while the seal() and read() path are executed in the application thread.
We really want to charge application-sourced mess to application
threads.

Change-Id: Iab2814f616ec8ca0d184513e5c8d3a3b8b1f2174
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoPublish TreeNodeUtils as StoreTreeNodes 60/13860/3
Robert Varga [Thu, 25 Dec 2014 07:28:40 +0000 (08:28 +0100)]
Publish TreeNodeUtils as StoreTreeNodes

Publishes the utility methods which rely only on API elements into the
API package, so they can be reused more widely.

Change-Id: I58faf7df17edbc9850bfd6b6fa5cb1d5361a121d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoCleanup and document ModifiedNode 63/13863/2
Robert Varga [Thu, 25 Dec 2014 15:50:45 +0000 (16:50 +0100)]
Cleanup and document ModifiedNode

Clean up method visibility to make the fact this class is not public
more visible. Also remove a FIXME and explain why it is correct to store
the value without taking any further action.

Change-Id: I49fb79bd41bbf1c42fb262c244a2f49460dfc5cf
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoSplit off UnkeyedListModificationStrategy 58/13858/3
Robert Varga [Thu, 25 Dec 2014 07:42:58 +0000 (08:42 +0100)]
Split off UnkeyedListModificationStrategy

It is a complex class, so it deserves its own file.

Change-Id: I7e7758f440f40863cc91f739e0ebed3e61f8e9d3
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdd better diagnostic on failed write 57/13857/3
Robert Varga [Thu, 25 Dec 2014 07:40:57 +0000 (08:40 +0100)]
Add better diagnostic on failed write

Rather than pointing out the class, also print the value being written.

Change-Id: Ic56afe1b9a2a5b113e181021633c37bf35008f4b
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDo not override surefire version 56/13856/3
Robert Varga [Thu, 25 Dec 2014 08:25:22 +0000 (09:25 +0100)]
Do not override surefire version

It is inherited. Also remove empty lines.

Change-Id: I623aa4979297efaf7c6697395eb5c5232962b54c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-2350: do encapsulte null snapshot"
Tony Tkacik [Wed, 7 Jan 2015 10:23:24 +0000 (10:23 +0000)]
Merge "BUG-2350: do encapsulte null snapshot"

9 years agoMerge "Parent schema node input parameter in JsonParserStream"
Tony Tkacik [Wed, 7 Jan 2015 09:45:47 +0000 (09:45 +0000)]
Merge "Parent schema node input parameter in JsonParserStream"

9 years agoMerge "BUG-1382: eliminate QName.getPrefix()"
Tony Tkacik [Wed, 7 Jan 2015 09:36:26 +0000 (09:36 +0000)]
Merge "BUG-1382: eliminate QName.getPrefix()"

9 years agoFix whitespace in binding-parent 45/13845/2
Robert Varga [Wed, 24 Dec 2014 12:44:54 +0000 (13:44 +0100)]
Fix whitespace in binding-parent

Whitespace should be four spaces, as it is the norm across project.

Change-Id: Iba62064a397cb8b28713eb45eabdd8d1ad5d928e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2350: do encapsulte null snapshot 62/13862/2
Robert Varga [Thu, 25 Dec 2014 09:44:48 +0000 (10:44 +0100)]
BUG-2350: do encapsulte null snapshot

getSnapshot() has only one caller in the same package, so performing
Optional.formNullable() just so we can then check for presence means
unnecessary object creation. Remove it and just deal with the potential
nulls.

Also rename methods for clarity and do not allow direct stores of nulls
into the cache.

Change-Id: I671a075ad6200fc37e586e413256bdd57e9ae4a0
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Turn NodeModification into an abstract class"
Tony Tkacik [Wed, 7 Jan 2015 09:29:35 +0000 (09:29 +0000)]
Merge "Turn NodeModification into an abstract class"

9 years agoMerge "Update xtend and embed it"
Tony Tkacik [Wed, 7 Jan 2015 09:28:23 +0000 (09:28 +0000)]
Merge "Update xtend and embed it"

9 years agoMerge "Do not test bundle activation of maven plugins"
Tony Tkacik [Wed, 7 Jan 2015 09:27:37 +0000 (09:27 +0000)]
Merge "Do not test bundle activation of maven plugins"

9 years agoMerge "BUG-2159: ensure test survies Java 8"
Tony Tkacik [Wed, 7 Jan 2015 09:27:24 +0000 (09:27 +0000)]
Merge "BUG-2159: ensure test survies Java 8"

9 years agoMerge "Use predictable class order"
Tony Tkacik [Wed, 7 Jan 2015 09:23:14 +0000 (09:23 +0000)]
Merge "Use predictable class order"

9 years agoMerge "Add a failure message when compilation test fails"
Tony Tkacik [Wed, 7 Jan 2015 09:22:57 +0000 (09:22 +0000)]
Merge "Add a failure message when compilation test fails"

9 years agoMerge "Limit the references IdentityCodec retains"
Tony Tkacik [Wed, 7 Jan 2015 09:19:53 +0000 (09:19 +0000)]
Merge "Limit the references IdentityCodec retains"

9 years agoMerge "Migrate ClassLoaderUtils user to new package"
Tony Tkacik [Wed, 7 Jan 2015 09:15:20 +0000 (09:15 +0000)]
Merge "Migrate ClassLoaderUtils user to new package"

9 years agoMerge "BUG-2350: improve performance of data tree merges"
Tony Tkacik [Wed, 7 Jan 2015 09:14:03 +0000 (09:14 +0000)]
Merge "BUG-2350: improve performance of data tree merges"

9 years agoMerge topic 'stable/helium'
Tony Tkacik [Wed, 7 Jan 2015 09:13:09 +0000 (09:13 +0000)]
Merge topic 'stable/helium'

* changes:
  BUG-2350: optimize BindingRuntimeContext.getIdentityClass()
  BUG-2350: optimize SchemaRootCodecContext.getYangIdentifierChild()

9 years agoMerge "Add yang-binding dependency to binding-parent."
Jan Medved [Mon, 5 Jan 2015 20:41:40 +0000 (20:41 +0000)]
Merge "Add yang-binding dependency to binding-parent."

9 years agoBUG-1382: eliminate QName.getPrefix() 97/12397/9
Robert Varga [Fri, 31 Oct 2014 10:19:21 +0000 (11:19 +0100)]
BUG-1382: eliminate QName.getPrefix()

QName should not be carrying a prefix entry. Its presence is a
historical leak from yang parser, where it was used as a hack to have aa
QName before a module import was resolved. This is an invalid case, as
an uresolved QName should never be leaked. The parser no longer needs
this and it has been deprecated in the last release -- so prune it.

Change-Id: I467cc9afb65609d160e67d47fa94cd0332b98025
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Remove unused import statements in binding-generator-impl"
Robert Varga [Mon, 5 Jan 2015 19:35:54 +0000 (19:35 +0000)]
Merge "Remove unused import statements in binding-generator-impl"

9 years agoMerge "Remove unused import statements in yang-parser-impl"
Robert Varga [Mon, 5 Jan 2015 19:35:31 +0000 (19:35 +0000)]
Merge "Remove unused import statements in yang-parser-impl"

9 years agoAdd yang-binding dependency to binding-parent. 17/13917/1
Ed Warnicke [Mon, 5 Jan 2015 19:24:02 +0000 (13:24 -0600)]
Add yang-binding dependency to binding-parent.

Change-Id: I2324918362b8d66bfc7fc5f49185cd449a10c491
Signed-off-by: Ed Warnicke <eaw@cisco.com>
9 years agoMerge "Remove unused imports in yang-data-impl"
Robert Varga [Mon, 5 Jan 2015 19:19:34 +0000 (19:19 +0000)]
Merge "Remove unused imports in yang-data-impl"

9 years agoMerge "Remove unnecessary import statements in yang-data-api"
Robert Varga [Mon, 5 Jan 2015 19:19:00 +0000 (19:19 +0000)]
Merge "Remove unnecessary import statements in yang-data-api"

9 years agoMerge "Use profile in binding-parent to not break without src/main/yang"
Jan Medved [Mon, 5 Jan 2015 16:44:03 +0000 (16:44 +0000)]
Merge "Use profile in binding-parent to not break without src/main/yang"

9 years agoUse profile in binding-parent to not break without src/main/yang 41/13841/3
Ed Warnicke [Wed, 24 Dec 2014 03:49:43 +0000 (21:49 -0600)]
Use profile in binding-parent to not break without src/main/yang

Whitespace has been fixed to use 4 spaces for indent in keeping
with yangtools convention.

Change-Id: Id6f5d7459590b189086c4cc6046d8c60fafb381e
Signed-off-by: Ed Warnicke <eaw@cisco.com>
9 years agoBug 2531: Fix build breakage in absense of src/main/yang directory 01/13801/5
Ed Warnicke [Sun, 21 Dec 2014 16:59:35 +0000 (10:59 -0600)]
Bug 2531: Fix build breakage in absense of src/main/yang directory

Change-Id: Ic5600dc950b048bc48c64a0a976709c6a93ab964
Signed-off-by: Ed Warnicke <eaw@cisco.com>
9 years agoRemove unused import statements in binding-generator-impl 07/13707/3
Thanh Ha [Wed, 17 Dec 2014 03:41:34 +0000 (22:41 -0500)]
Remove unused import statements in binding-generator-impl

Change-Id: I094a012432ddb68e75bd6a64dc55c48caa0dcb2b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
9 years agoRemove unused import statements in yang-parser-impl 06/13706/3
Thanh Ha [Wed, 17 Dec 2014 03:39:26 +0000 (22:39 -0500)]
Remove unused import statements in yang-parser-impl

Change-Id: I23ac4c917da16dcd4190bd9f7c707e962d001eff
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
9 years agoRemove unused imports in yang-data-impl 05/13705/3
Thanh Ha [Wed, 17 Dec 2014 03:37:32 +0000 (22:37 -0500)]
Remove unused imports in yang-data-impl

Change-Id: I353e127afd929f230da9bd70cbe2d599e8e24ea6
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
9 years agoRemove unnecessary import statements in yang-data-api 03/13703/3
Thanh Ha [Wed, 17 Dec 2014 03:30:43 +0000 (22:30 -0500)]
Remove unnecessary import statements in yang-data-api

java.lang are always implicitly imported.

Change-Id: I926516c3a731efe9d4770e379adb9e02b1d81ac5
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
9 years agoTurn NodeModification into an abstract class 80/13480/3
Robert Varga [Tue, 9 Dec 2014 15:46:22 +0000 (16:46 +0100)]
Turn NodeModification into an abstract class

We have a single-implementation case here, plus the interface is
non-public, Turn it into an abstract class to extract the last bit of
performance.

Change-Id: I384ddf7d785d7c323c2ba361c38f4b5a03697a38
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2350: improve performance of data tree merges 95/13795/3
Robert Varga [Sun, 21 Dec 2014 00:53:08 +0000 (01:53 +0100)]
BUG-2350: improve performance of data tree merges

Profiling has revealed that performing a merge on a large subtree
results in all pre-existing nodes being verified. The MD-SAL performs an
empty merge whenever the user asks for parents to be created --
resulting in up to 75% overhead.

Change-Id: I94310b2cb27c8585a8b8c4933ff0f0f658fda9be
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoUpdate xtend and embed it 40/13540/11
Robert Varga [Wed, 24 Dec 2014 13:28:27 +0000 (14:28 +0100)]
Update xtend and embed it

Rather than requiring an osgified version of xtend, let's embed that
dependency. Also upgrade it do 2.7.3 to make things work with Java 8.

Change-Id: I975d9431f3e9bb31a0a364e7b7abfd4155191548
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDo not test bundle activation of maven plugins 53/13853/3
Robert Varga [Wed, 24 Dec 2014 20:52:37 +0000 (21:52 +0100)]
Do not test bundle activation of maven plugins

maven-sal-api-gen-plugin is intended for maven use only. Do not test it
for startability.

Change-Id: Ic40f77c7f65bd27b429680b5dc9064d42b9dab18
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2159: ensure test survies Java 8 50/13850/2
Robert Varga [Wed, 24 Dec 2014 19:14:46 +0000 (20:14 +0100)]
BUG-2159: ensure test survies Java 8

Java 8 has slightly enhanced runtime, which trips the strict checking
done in tests. Fixe them up to pass.

Change-Id: Ia2fcd33c7831d4a1ff7171e6528ee6af5bc22d36
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoUse predictable class order 49/13849/2
Robert Varga [Wed, 24 Dec 2014 16:00:42 +0000 (17:00 +0100)]
Use predictable class order

HashSet has unpredictable iteration order, potentially causing
non-repeatable tests. Use an ImmutableSet to guard against that.

Change-Id: I1d774df0992ef4fc795558c46ae4e37349693fdf
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdd a failure message when compilation test fails 48/13848/1
Robert Varga [Wed, 24 Dec 2014 16:00:14 +0000 (17:00 +0100)]
Add a failure message when compilation test fails

Rather than emitting a cryptic null message, explain that the
compilation failed. The compiler emits errors by default, so it still is
diagnosable.

Change-Id: I32bfddef0c30cca96d225702a516b30c4e4d7040
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2350: optimize BindingRuntimeContext.getIdentityClass() 94/13794/3
Robert Varga [Sat, 20 Dec 2014 23:47:12 +0000 (00:47 +0100)]
BUG-2350: optimize BindingRuntimeContext.getIdentityClass()

BGP traces show this method can take upto 35% of CPU time in some use
cases. Instantiate a LoadingCache to bypass the cost of loading a class.

Change-Id: Iaa49dae655f3987add427e2d9da303b2278f00cb
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2350: optimize SchemaRootCodecContext.getYangIdentifierChild() 93/13793/3
Robert Varga [Sat, 20 Dec 2014 23:15:39 +0000 (00:15 +0100)]
BUG-2350: optimize SchemaRootCodecContext.getYangIdentifierChild()

This particular method has been found to dominate deletion-heavy
workloads, where it can account for up to 30% of time due to loading of
classes.

Eliminate this cost by instantiating a LoadingCache, which short-cuts
the class load.

Change-Id: I45c3f4acd67d85da30f26b71f73226a5beaf2876
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2532: Fix potential NPE in Utils.listFiles"
Robert Varga [Wed, 24 Dec 2014 12:47:07 +0000 (12:47 +0000)]
Merge "Bug 2532: Fix potential NPE in Utils.listFiles"

9 years agoIntroducing binding-parent 02/13802/4
Ed Warnicke [Sun, 21 Dec 2014 17:00:16 +0000 (11:00 -0600)]
Introducing binding-parent

Change-Id: Ib10d4505ea3fe3238d029da3aebdabd9d3241397
Signed-off-by: Ed Warnicke <eaw@cisco.com>
9 years agoBug 2532: Fix potential NPE in Utils.listFiles 00/13800/1
Ed Warnicke [Sun, 21 Dec 2014 16:58:59 +0000 (10:58 -0600)]
Bug 2532: Fix potential NPE in Utils.listFiles

Change-Id: I09fbcb8eaa98ea52e1c0ad09adc083c7a471c9a1
Signed-off-by: Ed Warnicke <eaw@cisco.com>
9 years agoLimit the references IdentityCodec retains 97/13797/2
Robert Varga [Sat, 20 Dec 2014 23:33:31 +0000 (00:33 +0100)]
Limit the references IdentityCodec retains

IdentityCodec does not really need the codec context -- the runtime
context is enough.

Change-Id: I9dcef7e64f326491030b969b53d7b3c61d0bcd04
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMigrate ClassLoaderUtils user to new package 96/13796/2
Robert Varga [Sat, 20 Dec 2014 23:26:22 +0000 (00:26 +0100)]
Migrate ClassLoaderUtils user to new package

ClassLoaderUtils was moved to org.opendaylight.yangtools.util.
Functionality was retained.

Change-Id: I1405cd3be9a2a8aa295eeb20e0d7bd661fe0a82c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG 2468 - leafrefs via import statement 83/13683/3
Jozef Gloncak [Tue, 16 Dec 2014 15:34:09 +0000 (16:34 +0100)]
BUG 2468 - leafrefs via import statement

Adds method which search for base type of leafref in module specified via
QName value.

Change-Id: Ib1979b56604429fccac2d9955387085aa59ed01d
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
9 years agoMerge "Cleanup binding proxy instantiation"
Tony Tkacik [Fri, 19 Dec 2014 15:41:44 +0000 (15:41 +0000)]
Merge "Cleanup binding proxy instantiation"

9 years agoCleanup binding proxy instantiation 57/13757/1
Robert Varga [Fri, 19 Dec 2014 14:04:34 +0000 (15:04 +0100)]
Cleanup binding proxy instantiation

Profiling of BGP topology provider has revealed a performance bottleneck
when instantiating proxies for list children. As it turns out around 68%
of CPU cycles is being burned in looking up the proxy class and its
contructor. This patch performs the obvious tradeoff by caching it and
exposing a utility function to subclasses.

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