yangtools.git
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 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 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>
9 years agoMerge "Clarify NotificationListener purpose"
Tony Tkacik [Fri, 19 Dec 2014 08:59:22 +0000 (08:59 +0000)]
Merge "Clarify NotificationListener purpose"

9 years agoMerge "Clarify code flow in SchemaAwareApplyOperation"
Tony Tkacik [Fri, 19 Dec 2014 08:59:02 +0000 (08:59 +0000)]
Merge "Clarify code flow in SchemaAwareApplyOperation"

9 years agoPrune empty nodes from transaction when it is sealed 76/13576/3
Robert Varga [Thu, 11 Dec 2014 17:03:14 +0000 (18:03 +0100)]
Prune empty nodes from transaction when it is sealed

When we seal() a ModifiedNode tree, check also whether we have unmodified
children and prune them. Also turn a SUBTREE_MODIFIED with empty nodes
into an UNMODIFIED node.

Change-Id: I077d23023fdbfb4ab232ed826cc32b4541779e87
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMove InMemoryDataTreeModification.mergeImpl() 73/13573/4
Robert Varga [Thu, 11 Dec 2014 16:03:45 +0000 (17:03 +0100)]
Move InMemoryDataTreeModification.mergeImpl()

The merge implementation should really live on
OperationWithModification, so this operation routing is consistent. This
has the side effect of speeding up verification on merges.

Change-Id: I2c07fa65b5846f618a476cc6f7f9d0c862b85811
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Cleanup delete/merge/write cohesion"
Tony Tkacik [Mon, 15 Dec 2014 11:37:14 +0000 (11:37 +0000)]
Merge "Cleanup delete/merge/write cohesion"

9 years agoMerge "Mark ModifiedNode as NotThreadSafe"
Tony Tkacik [Mon, 15 Dec 2014 08:54:11 +0000 (08:54 +0000)]
Merge "Mark ModifiedNode as NotThreadSafe"

9 years agoMerge "Fix checkstyle if-statements must use braces in yang-model-util"
Tony Tkacik [Mon, 15 Dec 2014 08:48:56 +0000 (08:48 +0000)]
Merge "Fix checkstyle if-statements must use braces in yang-model-util"

9 years agoMerge "Fix checkstyle if-statements must use braces in yang-parser-impl"
Tony Tkacik [Mon, 15 Dec 2014 08:48:51 +0000 (08:48 +0000)]
Merge "Fix checkstyle if-statements must use braces in yang-parser-impl"

9 years agoMerge "Fix checkstyle if-statements must use braces in yang-data-operations"
Tony Tkacik [Mon, 15 Dec 2014 08:48:46 +0000 (08:48 +0000)]
Merge "Fix checkstyle if-statements must use braces in yang-data-operations"

9 years agoMerge "Fix checkstyle if-statements must use braces in binding-generator"
Tony Tkacik [Mon, 15 Dec 2014 08:47:49 +0000 (08:47 +0000)]
Merge "Fix checkstyle if-statements must use braces in binding-generator"

9 years agoMerge "Do not access closed via updater"
Tony Tkacik [Mon, 15 Dec 2014 08:01:49 +0000 (08:01 +0000)]
Merge "Do not access closed via updater"

9 years agoCleanup delete/merge/write cohesion 72/13572/4
Robert Varga [Thu, 11 Dec 2014 15:57:10 +0000 (16:57 +0100)]
Cleanup delete/merge/write cohesion

The three methods are not public, and are not used in fluent way. Group
them together and make sure they look the same.

Change-Id: Ib0acb09020b381e8fc259e862ed6b340bd7260e2
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMark ModifiedNode as NotThreadSafe 75/13575/3
Robert Varga [Thu, 11 Dec 2014 17:16:32 +0000 (18:16 +0100)]
Mark ModifiedNode as NotThreadSafe

The class is not intended to be threadsafe, so mmark it as such. Also
remove an invalid @GuardedBy annotation.

Change-Id: Ib2a5ee9710ff41447ff999d5056ae71d06b328a3
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Match InMemoryDataTreeModification.write() argument name"
Tony Tkacik [Mon, 15 Dec 2014 07:52:09 +0000 (07:52 +0000)]
Merge "Match InMemoryDataTreeModification.write() argument name"

9 years agoDo not access closed via updater 26/13626/1
Robert Varga [Sun, 14 Dec 2014 17:25:34 +0000 (18:25 +0100)]
Do not access closed via updater

This is a volatile field and an Updater.get() is equivalent to a read.
Use a direct read, thus making the field visibly used. This removes the
need for a warning suppression.

Change-Id: I0799ae80c2431b9d48bb5f62f681ed4fe5289f41
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix checkstyle if-statements must use braces in yang-model-util 24/13624/1
Thanh Ha [Sun, 14 Dec 2014 16:42:17 +0000 (11:42 -0500)]
Fix checkstyle if-statements must use braces in yang-model-util

Change-Id: I5535870da8d317999b10b4e07e79d849ccc531a4
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
9 years agoFix checkstyle if-statements must use braces in yang-parser-impl 23/13623/1
Thanh Ha [Sun, 14 Dec 2014 16:42:05 +0000 (11:42 -0500)]
Fix checkstyle if-statements must use braces in yang-parser-impl

Change-Id: If6e41ded71028c7f506e87b310f1ea5b8cdc22af
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
9 years agoFix checkstyle if-statements must use braces in yang-data-operations 22/13622/1
Thanh Ha [Sun, 14 Dec 2014 16:38:46 +0000 (11:38 -0500)]
Fix checkstyle if-statements must use braces in yang-data-operations

Change-Id: Ia51055f22e2e3bc7693f35337c6d86e3d6663531
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
9 years agoFix checkstyle if-statements must use braces in binding-generator 21/13621/1
Thanh Ha [Sun, 14 Dec 2014 16:38:03 +0000 (11:38 -0500)]
Fix checkstyle if-statements must use braces in binding-generator

Change-Id: I929ee367d7263ba22eecd788d39688fd719bfd6b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
9 years agoMatch InMemoryDataTreeModification.write() argument name 71/13571/2
Robert Varga [Thu, 11 Dec 2014 15:54:24 +0000 (16:54 +0100)]
Match InMemoryDataTreeModification.write() argument name

This is an implementation of an interface method, so make sure the
argument name matches.

Change-Id: Ia2ee1d5e614aafac9d232abcefec65253c016bc9
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2470: fix ADD/DELETE state compression 70/13570/2
Robert Varga [Thu, 11 Dec 2014 15:41:04 +0000 (16:41 +0100)]
BUG-2470: fix ADD/DELETE state compression

If we are deleting a previously-modified node, we need check whether the
node existed before the transaction. It was there the modification needs
to be turned into a DELETE. But it this transaction introduced it, we
need to turn into a no-op -- otherwise we will trigger a wrong path.

If we don't the user will experience the effects of attempting to delete
a non-existing node, which is clearly not what the user intended.

Change-Id: Iceb926d69e1e9df359b3299e2e38a90ba3565fd1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoImprove readability of ordered checking 65/13565/1
Robert Varga [Thu, 11 Dec 2014 13:36:49 +0000 (14:36 +0100)]
Improve readability of ordered checking

Rather than overwriting the default, move it to an explicit else path.
This highlights the fact the value is initialized precisely once.

Change-Id: Ic8340705d3c68d6b40b04467af69e4d6a717d9de
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-2470: implement InMemoryDataTree.toString()"
Tony Tkacik [Wed, 10 Dec 2014 15:34:58 +0000 (15:34 +0000)]
Merge "BUG-2470: implement InMemoryDataTree.toString()"

9 years agoMerge "Bypass data tree generation on empty merge"
Tony Tkacik [Wed, 10 Dec 2014 15:33:55 +0000 (15:33 +0000)]
Merge "Bypass data tree generation on empty merge"

9 years agoMerge "BUG-1914: bump API requirement"
Tony Tkacik [Wed, 10 Dec 2014 15:33:45 +0000 (15:33 +0000)]
Merge "BUG-1914: bump API requirement"

9 years agoMerge "BUG-2498: optimize enum's forValue() method"
Tony Tkacik [Wed, 10 Dec 2014 15:33:31 +0000 (15:33 +0000)]
Merge "BUG-2498: optimize enum's forValue() method"

9 years agoBUG-2498: optimize enum's forValue() method 32/13532/1
Robert Varga [Wed, 10 Dec 2014 11:12:13 +0000 (12:12 +0100)]
BUG-2498: optimize enum's forValue() method

Use an ImmutableMap, as it provides optimized lookups based on
cardinality. Also hide the map from the package and turn it into a
constant.

Change-Id: I01591e56646705891fcc3fb8b871071169d35093
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1914: bump API requirement 47/12847/3
Robert Varga [Thu, 9 Oct 2014 23:45:55 +0000 (01:45 +0200)]
BUG-1914: bump API requirement

This bumps the required maven API version 3.1.1 and removes the manual
override needed with previous versions.

Change-Id: If3b85169dccc9583ee93114c2b0c4f3fc9e17eb2
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBypass data tree generation on empty merge 31/13531/1
Robert Varga [Wed, 10 Dec 2014 10:30:51 +0000 (11:30 +0100)]
Bypass data tree generation on empty merge

A merge operation may end up not introducing any child nodes. Current
code forces a mutable/immutable cycle. This may end up copying maps or
creating a TrieMap snapshot -- which is not then modified and directly
reused.

This introduces a simple check and a shortcut, which just creates a new
metadata node.

Change-Id: I3fe4d07a139986d473a6bf55a2b40ff4350bd699
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoClarify code flow in SchemaAwareApplyOperation 30/13530/2
Robert Varga [Wed, 10 Dec 2014 10:15:28 +0000 (11:15 +0100)]
Clarify code flow in SchemaAwareApplyOperation

When applying merge, we have a fall-through situation on the code.
Eliminate it by introducing a temporary variable. This makes the code a
bit more readable.

Change-Id: I3f468eb1235866ed627acdf5b60e6f890e44188a
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2470: implement InMemoryDataTree.toString() 83/13483/1
Robert Varga [Tue, 9 Dec 2014 17:09:57 +0000 (18:09 +0100)]
BUG-2470: implement InMemoryDataTree.toString()

For debugging purposes, we need a way to dump the current state of the
data tree. Implement proper toString() method.

Change-Id: I808b83b1e89eaa79d2a8d19b2e551884e7a3dc50
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoClarify NotificationListener purpose 44/13444/1
Robert Varga [Mon, 8 Dec 2014 13:02:51 +0000 (14:02 +0100)]
Clarify NotificationListener purpose

This adds a comment about what the intended use of NotificationListener.

Change-Id: I84116fda4f7f68d63e8ad0e97365087df01b564a
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1914: force maven 3.1.1 46/12846/3
Robert Varga [Mon, 13 Oct 2014 09:27:44 +0000 (11:27 +0200)]
BUG-1914: force maven 3.1.1

Activates maven version enforcement.

Change-Id: I19bbd53e93de3ccbf029a2e029e479217e2c0c09
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix feature-test failing with surefire 2.18 64/13364/2
Robert Varga [Thu, 4 Dec 2014 12:05:20 +0000 (13:05 +0100)]
Fix feature-test failing with surefire 2.18

feature-test fails maven-surefire-plugin 2.18 (but works with 2.17) due
to it assumming the constructor is called only once and modifying global
state. That global state is guarded from multiple modifications with an
Error. Move the offending initialization into static initializer, thus
ensuring we invoke the function only once.

Change-Id: I771ce384927769436ff0c8133471cefe27954a3d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Remove xtend plugin binding-data-codec"
Tony Tkacik [Wed, 3 Dec 2014 10:26:58 +0000 (10:26 +0000)]
Merge "Remove xtend plugin binding-data-codec"

9 years agoDo not use deprecated ClassLoaderUtils 71/13271/1
Robert Varga [Mon, 1 Dec 2014 17:47:16 +0000 (18:47 +0100)]
Do not use deprecated ClassLoaderUtils

Migrates to the class provided from the util package instead.

Change-Id: I988c4cc0d04062780ebd842ab596604b0c7cf287
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove PropertyPair 69/13269/1
Robert Varga [Mon, 1 Dec 2014 17:23:03 +0000 (18:23 +0100)]
Remove PropertyPair

This holder is unused, so remove it, reducing clutter.

Change-Id: Ib808582faf11cfa9937e76a7d025ed2a66a5becf
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove xtend plugin binding-data-codec 68/13268/1
Robert Varga [Mon, 1 Dec 2014 16:57:54 +0000 (17:57 +0100)]
Remove xtend plugin binding-data-codec

The code does not use it, so save some time by not invoking it at all.

Change-Id: I633516da5cb152ea6c253a276d369bef002744ec
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Allow {Class,Method}Generator.process() to throw CannotCompileException"
Tony Tkacik [Mon, 1 Dec 2014 10:52:38 +0000 (10:52 +0000)]
Merge "Allow {Class,Method}Generator.process() to throw CannotCompileException"

9 years agoMerge "Remove unused declarations"
Tony Tkacik [Mon, 1 Dec 2014 09:15:44 +0000 (09:15 +0000)]
Merge "Remove unused declarations"

9 years agoMerge "Bug 2271 - NPE during generation of java binding for case list-grouping-choice"
Tony Tkacik [Mon, 1 Dec 2014 08:32:39 +0000 (08:32 +0000)]
Merge "Bug 2271 - NPE during generation of java binding for case list-grouping-choice"

9 years agoMerge "Fix logging checkstyle"
Robert Varga [Sun, 30 Nov 2014 20:52:31 +0000 (20:52 +0000)]
Merge "Fix logging checkstyle"

9 years agoRemove unused declarations 04/13204/2
Robert Varga [Fri, 28 Nov 2014 07:08:15 +0000 (08:08 +0100)]
Remove unused declarations

These properties are defined in odlparent, no need to repeat them here.

Change-Id: I34e05fa5bdf4d0937c967405c23d40c41c1b4187
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAllow {Class,Method}Generator.process() to throw CannotCompileException 78/13178/3
Robert Varga [Fri, 28 Nov 2014 07:08:42 +0000 (08:08 +0100)]
Allow {Class,Method}Generator.process() to throw CannotCompileException

This exception is naturally thrown by Javassist, so allowing our users
to not encapsulate it is a Good Thing.

Change-Id: Ibc558501e799a2c4c6599d6d7c5da668335c7270
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Add model parent"
Tony Tkacik [Fri, 28 Nov 2014 10:12:36 +0000 (10:12 +0000)]
Merge "Add model parent"

9 years agoBug 2271 - NPE during generation of java binding for case list-grouping-choice 66/12566/5
pkajsa [Thu, 6 Nov 2014 12:24:25 +0000 (13:24 +0100)]
Bug 2271 - NPE during generation of java binding for case list-grouping-choice

The SchemaContextUtil class does not find some types of schema elements nested
in other elements (e.g. groupings in groupings - Bug 2117, groupings in lists,
groupings in Rpcs, groupings in rpc outputs and inputs, groupings in
notifications etc...). Therefore complete rework of findNodeInModule and
related methods has been performed. This version of patch set (i.e. 5) works
also with yang modules containing siblings with the same name.

Change-Id: Ia5f9d437c05ace6d94999eac17308a756c439f82
Signed-off-by: pkajsa <pkajsa@cisco.com>
9 years agoMerge "Resolved some sonar issues: If Stmts Must Use Braces"
Robert Varga [Tue, 25 Nov 2014 16:25:17 +0000 (16:25 +0000)]
Merge "Resolved some sonar issues: If Stmts Must Use Braces"

9 years agoResolved some sonar issues: Hide Utility Class Constructor 30/11930/4
Ladislav Borak [Mon, 13 Oct 2014 18:12:49 +0000 (20:12 +0200)]
Resolved some sonar issues: Hide Utility Class Constructor

Change-Id: I369df97a4de6c32dcb30a87516b0ec174368d38a
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoFix logging checkstyle 10/12910/3
Milos Fabian [Tue, 18 Nov 2014 11:20:09 +0000 (12:20 +0100)]
Fix logging checkstyle

-allow literal string concatenation in log message

Change-Id: Iab33788f5db8e0e640c1f5d3a34494d84c2254d4
Signed-off-by: Milos Fabian <milfabia@cisco.com>
9 years agoMerge "Introduce QNameModule.toString()"
Tony Tkacik [Tue, 25 Nov 2014 08:52:35 +0000 (08:52 +0000)]
Merge "Introduce QNameModule.toString()"

9 years agoResolved some sonar issues: If Stmts Must Use Braces 18/11918/2
Ladislav Borak [Mon, 13 Oct 2014 07:50:27 +0000 (09:50 +0200)]
Resolved some sonar issues: If Stmts Must Use Braces

Change-Id: I904bf50a98ba72f6887c540970a10b951c4f8beb
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoIntroduce QNameModule.toString() 75/13075/1
Robert Varga [Mon, 24 Nov 2014 15:09:22 +0000 (16:09 +0100)]
Introduce QNameModule.toString()

Rather than using the default, let's add a ToStringHelper based
toString().

Change-Id: Ib9240564db8f710d36f9281054b5e2825d9790a0
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1953: perform proper string validation 70/13070/1
Robert Varga [Thu, 18 Sep 2014 12:51:15 +0000 (14:51 +0200)]
BUG-1953: perform proper string validation

Activates the use ot Patterns to enforce the string value has the format
specified by the yang file. Also fixes mutability of the exposed list,
which may have been attacked, injecting wrong strings.

Change-Id: I32d0ceb836df1f5ed04122a10115f66f75bfa1ec
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 106188585a33e10cd910acb16e1d18eba77c8268)

9 years agoMerge "Bug 1677 - Parser: ListSchemaNodeBuilder keys needs to be a LinkedHashSet"
Tony Tkacik [Thu, 20 Nov 2014 11:37:05 +0000 (11:37 +0000)]
Merge "Bug 1677 - Parser: ListSchemaNodeBuilder keys needs to be a LinkedHashSet"

9 years agoDo not use YangInstanceIdentifier#getPath() 75/12975/1
Robert Varga [Wed, 19 Nov 2014 21:02:56 +0000 (22:02 +0100)]
Do not use YangInstanceIdentifier#getPath()

Moves TreeNodeUtils away from using deprecated getPath().

Change-Id: Ida7edbd89b08d7365d30d20a1e9657a106886c10
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2157 - Race condition when adding a RPC implementation with an output"
Tony Tkacik [Thu, 20 Nov 2014 08:51:58 +0000 (08:51 +0000)]
Merge "Bug 2157 - Race condition when adding a RPC implementation with an output"

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

9 years agoMerge "Fix indentation"
Tony Tkacik [Thu, 20 Nov 2014 08:40:05 +0000 (08:40 +0000)]
Merge "Fix indentation"

9 years agoMerge "BUG-2402: add FIXMEs and javadoc"
Tony Tkacik [Thu, 20 Nov 2014 08:39:10 +0000 (08:39 +0000)]
Merge "BUG-2402: add FIXMEs and javadoc"

9 years agoMerge "Reduce SchemaContext cache to weak values"
Tony Tkacik [Thu, 20 Nov 2014 08:38:40 +0000 (08:38 +0000)]
Merge "Reduce SchemaContext cache to weak values"

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

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

Change-Id: I5d5b9e10c7329c6bc909b28b07c7bc6500cfcd5a
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-2304 Fix SchemaContextUtil for augmented nodes."
Tony Tkacik [Wed, 19 Nov 2014 14:04:15 +0000 (14:04 +0000)]
Merge "BUG-2304 Fix SchemaContextUtil for augmented nodes."

9 years agoMerge "Bug 1781: Fix serialization of leafrefs"
Tony Tkacik [Wed, 19 Nov 2014 14:02:57 +0000 (14:02 +0000)]
Merge "Bug 1781: Fix serialization of leafrefs"

9 years agoBUG-2304 Fix SchemaContextUtil for augmented nodes. 85/12785/5
Jozef Gloncak [Tue, 18 Nov 2014 08:52:38 +0000 (09:52 +0100)]
BUG-2304 Fix SchemaContextUtil for augmented nodes.

Also keep backwards compatibility for invalid leafrefs
+ Fix the serialization in XMLStreamNormalizedNodeStreamWriter (btw. interesting name for a class)

Change-Id: I46cfcef46c97267c7e9b5bfebe03e42e9071e1e7
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
9 years agoBug 1781: Fix serialization of leafrefs 66/12666/4
Jozef Gloncak [Thu, 13 Nov 2014 15:40:47 +0000 (16:40 +0100)]
Bug 1781: Fix serialization of leafrefs

- fixed search leafref node specified with relative xpath

Change-Id: I4b6eb6ab94b954ab5b28129dc332590d32b8a7c4
Signed-off-by: Ladislav Borak <lborak@cisco.com>
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
9 years agoBUG-2402: add FIXMEs and javadoc 25/12925/1
Robert Varga [Tue, 18 Nov 2014 17:48:47 +0000 (18:48 +0100)]
BUG-2402: add FIXMEs and javadoc

This adds an explanation about the interfaces being used and makes an
explicit warning for users to not use the exposed method.

Change-Id: I07753bea7380f7d92165b8ecb1840ee07d36dc06
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2401: remove LOG.warn() from entrySet() 24/12924/1
Robert Varga [Tue, 18 Nov 2014 17:37:32 +0000 (18:37 +0100)]
BUG-2401: remove LOG.warn() from entrySet()

As it turns out, entrySet() is called from
AbstractImmutableDataContainerNodeBuilder when it modifies children (via
HashMap(Map) contructor). Remove the warning and add explanation about
what is going on.

Change-Id: Ifbd99458c83d8afa25c3be7778fb28b579d4b2d8
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix indentation 14/12814/3
Robert Varga [Thu, 13 Nov 2014 13:47:00 +0000 (14:47 +0100)]
Fix indentation

Fixes wrong indentation and import ordering.

Change-Id: Ibb5593118a32b79d74edc97bed0ac2dceaa5b881
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2354: Fixed parsing of block comments between statement and argument"
Tony Tkacik [Tue, 18 Nov 2014 10:16:56 +0000 (10:16 +0000)]
Merge "Bug 2354: Fixed parsing of block comments between statement and argument"

9 years agoMerge "Remove unused imports"
Tony Tkacik [Tue, 18 Nov 2014 09:20:26 +0000 (09:20 +0000)]
Merge "Remove unused imports"

9 years agoMerge changes Ic8e48ed1,Ie6bc9bbf,I3e94c637,I84c8ac42
Tony Tkacik [Tue, 18 Nov 2014 08:34:47 +0000 (08:34 +0000)]
Merge changes Ic8e48ed1,Ie6bc9bbf,I3e94c637,I84c8ac42

* changes:
  BUG-2390: Use child size hints
  BUG-2390: Lower HashMap allocation defaults
  BUG-2384: improve ImmutableUnkeyedListNode efficiency
  BUG-2377: introduce internal UnmodifiableChildrenMap

9 years agoBUG-2390: Use child size hints 38/12838/2
Robert Varga [Fri, 14 Nov 2014 09:50:08 +0000 (10:50 +0100)]
BUG-2390: Use child size hints

This patch makes sure we pass down the sizing hints into the
implementation. This will allow us to make better decisions when
resizing maps.

Change-Id: Ic8e48ed108e20381aa0c91a5d8f7e3bb57acf180
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2390: Lower HashMap allocation defaults 37/12837/2
Robert Varga [Fri, 14 Nov 2014 09:50:17 +0000 (10:50 +0100)]
BUG-2390: Lower HashMap allocation defaults

This lowers the default hashmap capacity to 4, hopefully lowering our
overall overhead. It also introduces sizeHint arguments, to the maps can
be better-sized in the future.

Change-Id: Ie6bc9bbf79e7c5c63c3dd0000585660cbc09d368
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2384: improve ImmutableUnkeyedListNode efficiency 21/12821/4
Robert Varga [Thu, 13 Nov 2014 17:23:43 +0000 (18:23 +0100)]
BUG-2384: improve ImmutableUnkeyedListNode efficiency

With moderately-loaded BGP instance we are using quite a few on empty
unkeyed list nodes. The fact they are empty means we waste about 8 bytes
per instance just tracking empty list. Introduce a dedicated class to
take care of this common special case.

Change-Id: I3e94c637f5d7d47d39d274bae96850307f5c439d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2377: introduce internal UnmodifiableChildrenMap 15/12815/4
Robert Varga [Thu, 13 Nov 2014 13:47:26 +0000 (14:47 +0100)]
BUG-2377: introduce internal UnmodifiableChildrenMap

This new class acts a replacement of java.util.Collection's version of
the same. Unlike the standard class, this one does not retain cached
versions of keySet and entrySet, since those are unused anyway. We can
also perform an instanceof check, which should speed up operations.
Finally, we check for map emptiness and use Collections.emptyMap()
when possible.

Change-Id: I84c8ac428d6b207fafccf8cc898f0555b104a4ee
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unused imports 08/12808/3
Robert Varga [Thu, 13 Nov 2014 12:38:35 +0000 (13:38 +0100)]
Remove unused imports

These imports are unused, creating eclipse warnings.

Change-Id: Id4e9a51131489ec426537a6af32ed77cd0ff161f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG 2353 : LeafSetEntryBuilder does not compare byte array values correctly 20/12820/2
Moiz Raja [Thu, 13 Nov 2014 17:08:04 +0000 (09:08 -0800)]
BUG 2353 : LeafSetEntryBuilder does not compare byte array values correctly

Use Object.deepEquals to compare the value of the NodeIdentifier and the actual
value to be set on the LeafSetEntry

Change-Id: I4482b19d029058a0f78d3b19508d6f7797448710
Signed-off-by: Moiz Raja <moraja@cisco.com>
9 years agoReduce SchemaContext cache to weak values 44/12844/1
Robert Varga [Fri, 14 Nov 2014 13:32:06 +0000 (14:32 +0100)]
Reduce SchemaContext cache to weak values

While constructing a SchemaContext is potentially costly, we do not need
to retain them if they are not used for long periods of time. Soft
references attempt to retain the context until the memory pressure is
pretty high, while weak references are cleared as soon as the object is
proven to be weakly reachable.

Change-Id: I2df2a78218d3b439edadda2192ff541e4c1c0fee
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2354: Fixed parsing of block comments between statement and argument 81/12781/3
Martin Ciglan [Wed, 12 Nov 2014 11:28:42 +0000 (12:28 +0100)]
Bug 2354: Fixed parsing of block comments between statement and argument

Lexer didn't contain BLOCK_COMMENT_MODE in VALUE_MODE,
therefore parser tried to parse comments instead of skipping them

Change-Id: I6d131a45df121570537686006aa31397124ea6ca
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoMerge "Bug 2326 - NormalizeNode equals fails when NormalizeNodes being compared conta...
Tony Tkacik [Thu, 13 Nov 2014 13:42:24 +0000 (13:42 +0000)]
Merge "Bug 2326 - NormalizeNode equals fails when NormalizeNodes being compared contain binary data which is identical."

9 years agoBug 2157 - Race condition when adding a RPC implementation with an 86/12786/2
Jan Hajnar [Wed, 12 Nov 2014 09:21:03 +0000 (10:21 +0100)]
Bug 2157 - Race condition when adding a RPC implementation with an
output

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

Change-Id: I2baa71f4237a1125db9a6e5ec8077237dc8ef544
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoBug 2326 - NormalizeNode equals fails when NormalizeNodes being 60/12760/2
pkajsa [Tue, 11 Nov 2014 07:08:38 +0000 (08:08 +0100)]
Bug 2326 - NormalizeNode equals fails when NormalizeNodes being
compared contain binary data which is identical.

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

9 years agoBug 1677 - Parser: ListSchemaNodeBuilder keys needs to be a LinkedHashSet 36/10836/5
Ladislav Borak [Fri, 5 Sep 2014 06:14:55 +0000 (08:14 +0200)]
Bug 1677 - Parser: ListSchemaNodeBuilder keys needs to be a LinkedHashSet

- changed type of kyes in ListSchemaNodeBuilder

Change-Id: I838d51b76f70f6446169f72407db8da43fb5ee03
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoBUG-2329 Add handling of anyxml nodes in XmlDocumentUtils with schema 75/12575/2
Maros Marsalek [Thu, 6 Nov 2014 14:27:14 +0000 (15:27 +0100)]
BUG-2329 Add handling of anyxml nodes in XmlDocumentUtils with schema

Change-Id: I32fe0658aa495f98b75e804cec58ad9dcea02cf3
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMerge "Bug 1781: Fix serialization of leafrefs"
Tony Tkacik [Thu, 6 Nov 2014 13:25:40 +0000 (13:25 +0000)]
Merge "Bug 1781: Fix serialization of leafrefs"

9 years agoBug 1781: Fix serialization of leafrefs 18/12518/6
Ladislav Borak [Thu, 6 Nov 2014 09:09:38 +0000 (10:09 +0100)]
Bug 1781: Fix serialization of leafrefs

- added functionality to read schema node which is type of leaf ref and
  points to leaf ref, identity ref, instanceidentifier or typedef node.

Change-Id: I150847b859ac0616c2cf160192bb712aea8202bb
Signed-off-by: Ladislav Borak <lborak@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoAdd model parent 83/12083/2
Robert Varga [Mon, 20 Oct 2014 17:19:56 +0000 (19:19 +0200)]
Add model parent

This patch adds an explicit parent pom which can be used by downstream
projects to build API bundles containing a yang model.

Change-Id: I37b9ef0a457679d1909a790b8cbd98edad64da39
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoISIS Yang model compilation issue 42/12542/1
Reinaldo Penno [Thu, 6 Nov 2014 06:30:45 +0000 (22:30 -0800)]
ISIS Yang model compilation issue

Change-Id: Ib4bc98ad68237ebea4eccf5522dfd79db88a7906
Signed-off-by: Reinaldo Penno <rapenno@gmail.com>
9 years agoBUG-1956: bump java-concurrent-hash-trie-map version 0.2.23 55/12155/3
Robert Varga [Fri, 19 Sep 2014 07:46:39 +0000 (09:46 +0200)]
BUG-1956: bump java-concurrent-hash-trie-map version 0.2.23

Bump the version again, this time accounting for the late API change.

Change-Id: I95e947adcef587069ea3579da98b3f5d217a6e58
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 7955cb613c1338ac46e122aac5d71a4f2dc45cf3)