yangtools.git
9 years agoMerge "Bug 2362 - Milestone: Basic constraints validation"
Robert Varga [Thu, 16 Apr 2015 10:59:03 +0000 (10:59 +0000)]
Merge "Bug 2362 - Milestone: Basic constraints validation"

9 years agoMerge "Direct schema node lookup in SchemaUtils"
Robert Varga [Thu, 16 Apr 2015 09:11:31 +0000 (09:11 +0000)]
Merge "Direct schema node lookup in SchemaUtils"

9 years agoDirect schema node lookup in SchemaUtils 04/18204/4
Maros Marsalek [Mon, 13 Apr 2015 15:58:31 +0000 (17:58 +0200)]
Direct schema node lookup in SchemaUtils

SchemaUtils.findSchemaForChild now looks up child schema node
directly by querying the parent schema node and uses the
iterative/recursive lookup as fallback.

This is a performance improvement that bypasses the recursive
lookup if possible.

Change-Id: I888e767310713efd42428ef58caf959651643f49
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoworkaround for BUG: 2974 64/18264/5
Vishal Thapar [Tue, 14 Apr 2015 12:40:19 +0000 (18:10 +0530)]
workaround for BUG: 2974

Suggested workaround for bug2974 is to add
yang-types revision to ietf-interfaces.yang
This change imports latest revision as well as
changes the dependency to ietf-yang-type-20130715

Change-Id: If0ad60b435ae311db656d1a7e49402bc3ef6bb2f
Signed-off-by: Vishal Thapar <vishal.thapar@ericsson.com>
9 years agoMerge "Bug 2997: Fixed instanceof checks to use interfaces"
Tony Tkacik [Wed, 15 Apr 2015 13:51:34 +0000 (13:51 +0000)]
Merge "Bug 2997: Fixed instanceof checks to use interfaces"

9 years agoBug 2366 - Effective statements impl for new yang parser. 38/18038/12
Gregor Zatko [Wed, 15 Apr 2015 10:45:19 +0000 (12:45 +0200)]
Bug 2366 - Effective statements impl for new yang parser.

- added implementation of effective statements and integration to
  yang-model-api
- added implementation and tests of augment declared statement and AugmentUtils

Change-Id: Ifc39ce971cd3efd5bb00f3f4f25dbd791ee65c38
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Gregor Zatko <gzatko@cisco.com>
9 years agoBug 2997: Fixed instanceof checks to use interfaces 11/18311/1
Tony Tkacik [Wed, 15 Apr 2015 08:18:51 +0000 (10:18 +0200)]
Bug 2997: Fixed instanceof checks to use interfaces

JSONCodecFactory used instanceof checks for conrete
implementation classes instead of checks for
interfaces describing behaviour.

Change-Id: Ib8a0b259b993a52bd661ac33db6ae91308f46774
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2366 - new parser API - implementation of declared statements 30/16130/26
Martin Ciglan [Tue, 14 Apr 2015 14:31:07 +0000 (16:31 +0200)]
Bug 2366 - new parser API - implementation of declared statements
- added integration between ANTL4 parsing YANG file and new parser
- added test to demonstrate it
- added implementation of yang statements and their definitions resp. support
  classes
- added implementation of effective statements and integration to yang.model.api
- added effective build implementation and unit tests of effective build
- added new namespaces
- added new utils and parsing methods
- added simple unit tests

Bugfixing:
- fix of phases switching bugs on two places
- fix of argument parsing before parent ctx assigment (NPE on null parent)
- fix of values retrieval from sourceLocal and treeScoped namespaces
- fix of tryToComplete method in SourceSpecificContext class. Method did not
  return correct progress result although everything was resolved
  correctly

Change-Id: I5d6acc69bb877b26403d69e276ed5c578e9bd4d9
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
Signed-off-by: Gregor Zatko <gzatko@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoBug 2362 - Milestone: Basic constraints validation 67/14967/15
Jan Hajnar [Fri, 6 Feb 2015 14:26:34 +0000 (15:26 +0100)]
Bug 2362 - Milestone: Basic constraints validation

* added validator class for min and max elements constraint
* added validation method calls from NormalizedNodeContainerModificationStrategy and
UnkeyedListModificationStrategy
* added tests

Change-Id: I384837f1a2a6dc730b824d509f7080df7408fd3f
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2362: Make sure JSON and XML codecs are not losing constraints."
Robert Varga [Tue, 14 Apr 2015 10:38:31 +0000 (10:38 +0000)]
Merge "Bug 2362: Make sure JSON and XML codecs are not losing constraints."

9 years agoBug 2984 - Added Missing space separator for list keys in yin format 05/18205/2
Tony Tkacik [Mon, 13 Apr 2015 16:48:43 +0000 (18:48 +0200)]
Bug 2984 - Added Missing space separator for list keys in yin format

Change-Id: Ibb943777604f61dde20bb84fce2a7f13c38333c7
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "BUG-1485: deprecate length/range methods"
Tony Tkacik [Mon, 13 Apr 2015 09:27:14 +0000 (09:27 +0000)]
Merge "BUG-1485: deprecate length/range methods"

9 years agoMerge "Bug 1260: Implemented Binding Caching Codec"
Robert Varga [Mon, 13 Apr 2015 09:18:48 +0000 (09:18 +0000)]
Merge "Bug 1260: Implemented Binding Caching Codec"

9 years agoMerge "Bug 2374 - YANG Binding: Added support for AugmentationHolder interface"
Robert Varga [Mon, 13 Apr 2015 08:40:23 +0000 (08:40 +0000)]
Merge "Bug 2374 - YANG Binding: Added support for AugmentationHolder interface"

9 years agoBUG-1485: deprecate length/range methods 80/16780/6
Robert Varga [Wed, 18 Mar 2015 17:20:15 +0000 (18:20 +0100)]
BUG-1485: deprecate length/range methods

These methods leak the internals of how constraints are enforced. No
outside parties should rely on them, so lets mark them deprecated. If we
do not get reports of use, we should be removing them in a future
release.

Change-Id: I128c5abe5c894a4808ff30dcebd6af42d8f682cb
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 1260: Implemented Binding Caching Codec 51/17951/6
Tony Tkacik [Wed, 8 Apr 2015 17:41:05 +0000 (19:41 +0200)]
Bug 1260: Implemented Binding Caching Codec

Implemented Bidning Caching Codec which maintains
API-user configured cache of serialized data
from Bidning to NormalizedNode.

These cached data are used in subsequent serializations
in order to not allocate new NormalizedNodes for
logically equivalent data.

Change-Id: Iafaed957453569c3e8ecfbb2aed333f3a1fd418f
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2964 - ClassCastException when querying - 11/18011/3
Jan Hajnar [Thu, 9 Apr 2015 11:41:43 +0000 (13:41 +0200)]
Bug 2964 - ClassCastException when querying -
controller-config/yang-ext:mount/config:modules

* added test for bugfix

Change-Id: I4d82b982471559b3bfc7ce81cce65f91d831aab3
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoFix enum members' name 48/18148/3
Robert Varga [Sat, 11 Apr 2015 20:22:50 +0000 (22:22 +0200)]
Fix enum members' name

Enumeration members are supposed to be capitalized as normal constants.
Fix that before the API is widely used.

Change-Id: I1d0632e9491bd79047d1f71f2a906c498cdd0ad6
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDo not declare RuntimeExceptions as thrown 50/18150/1
Robert Varga [Sat, 11 Apr 2015 20:40:02 +0000 (22:40 +0200)]
Do not declare RuntimeExceptions as thrown

Fix a bunch of sonar warnings around declaring runtime exceptions.

Change-Id: I6e8267e29ef6c0d3f2d220531ca656ff564331ec
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoSquash declared types 45/18145/1
Robert Varga [Sat, 11 Apr 2015 15:11:12 +0000 (17:11 +0200)]
Squash declared types

Rather than binding to particular implementation, make sure we use an
interface.

Change-Id: Ibecbc00a42d1c37339c5f965f6c1c5a63fa24d7f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix constant names 44/18144/1
Robert Varga [Sat, 11 Apr 2015 15:03:58 +0000 (17:03 +0200)]
Fix constant names

Constants should have capitalized names. Fixes a few sonar warnings.

Change-Id: I600b482a817055784874e91f9cb8c5b06b948302
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-2962: add DataTreeTip interface and implement it"
Tony Tkacik [Fri, 10 Apr 2015 09:44:58 +0000 (09:44 +0000)]
Merge "BUG-2962: add DataTreeTip interface and implement it"

9 years agoBug 2362: Make sure JSON and XML codecs are not losing constraints. 10/18010/2
Tony Tkacik [Thu, 9 Apr 2015 07:59:57 +0000 (09:59 +0200)]
Bug 2362: Make sure JSON and XML codecs are not losing constraints.

Change-Id: I9b3659f46438f1ad06ef86e2df33b7e963db40bc
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2362: Added pattern validation for string types."
Robert Varga [Fri, 10 Apr 2015 08:34:20 +0000 (08:34 +0000)]
Merge "Bug 2362: Added pattern validation for string types."

9 years agoMerge "Extracted remaining codecs to protected classes."
Robert Varga [Fri, 10 Apr 2015 08:33:19 +0000 (08:33 +0000)]
Merge "Extracted remaining codecs to protected classes."

9 years agoBug 2964 - ClassCastException when querying - 30/18030/1
Jan Hajnar [Thu, 9 Apr 2015 13:36:13 +0000 (15:36 +0200)]
Bug 2964 - ClassCastException when querying -
controller-config/yang-ext:mount/config:modules

* fixed referenced identity ref json serialization

Change-Id: Idab6accec5e5c0846f0d6dbb637d8a2806cc5df2
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoMerge "Make sure LOOKUP is a proper constant"
Tony Tkacik [Thu, 9 Apr 2015 12:33:42 +0000 (12:33 +0000)]
Merge "Make sure LOOKUP is a proper constant"

9 years agoMerge "Remove unneeded final modifiers"
Tony Tkacik [Thu, 9 Apr 2015 12:33:21 +0000 (12:33 +0000)]
Merge "Remove unneeded final modifiers"

9 years agoMerge "Remove unused imports"
Tony Tkacik [Thu, 9 Apr 2015 12:33:03 +0000 (12:33 +0000)]
Merge "Remove unused imports"

9 years agoMerge "Fix modifier ordering"
Tony Tkacik [Thu, 9 Apr 2015 12:32:56 +0000 (12:32 +0000)]
Merge "Fix modifier ordering"

9 years agoBug 2362: Added pattern validation for string types. 99/17899/4
Tony Tkacik [Wed, 8 Apr 2015 09:01:31 +0000 (11:01 +0200)]
Bug 2362: Added pattern validation for string types.

Change-Id: Icea2e7cfa87bd746e6da99e6908ab959d6356fd3
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoExtracted remaining codecs to protected classes. 96/17896/4
Tony Tkacik [Wed, 8 Apr 2015 07:46:21 +0000 (09:46 +0200)]
Extracted remaining codecs to protected classes.

Change-Id: I1cf9413b8971ae8c2cd51e7995aae537f6705767
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMake sure LOOKUP is a proper constant 07/18007/1
Robert Varga [Thu, 9 Apr 2015 11:23:22 +0000 (13:23 +0200)]
Make sure LOOKUP is a proper constant

Change-Id: I684ead0df12bdc5c012f8a20e04f4508c5bbb429
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unneeded final modifiers 06/18006/1
Robert Varga [Thu, 9 Apr 2015 11:19:08 +0000 (13:19 +0200)]
Remove unneeded final modifiers

Static methods are implicitly final, no need to declare them as final.

Change-Id: Ia3b085ce0e4cde46952d1b4afc6c908fdec4a506
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2960 - Yang Data Codec Gson: failed to lookup prefix when serializing...
Tony Tkacik [Thu, 9 Apr 2015 11:14:14 +0000 (11:14 +0000)]
Merge "Bug 2960 - Yang Data Codec Gson: failed to lookup prefix when serializing identityref type"

9 years agoRemove unused imports 05/18005/1
Robert Varga [Thu, 9 Apr 2015 11:13:30 +0000 (13:13 +0200)]
Remove unused imports

Change-Id: Ic63dcc4e1dbd25a667ac48195bf6e7af7ec28709
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix modifier ordering 04/18004/1
Robert Varga [Thu, 9 Apr 2015 11:11:05 +0000 (13:11 +0200)]
Fix modifier ordering

JLS specifies annotations need to to come before other modifiers, of
which visbility should be first.

Change-Id: I754ef08c13256647d024c121e75fd3617ef6d064
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2962: add DataTreeTip interface and implement it 77/17877/5
Robert Varga [Tue, 7 Apr 2015 19:09:01 +0000 (21:09 +0200)]
BUG-2962: add DataTreeTip interface and implement it

DataTreeTip forms a point where a modification can be applied to. This
interface can be implemented by DataTreeCandidate instances (as
DataTreeCandidateTip), so users can prepare a sequence of modifications
for commit without actually applying them.

Change-Id: Ic772fa9b813105f3731c6b7cea45b629f9137de1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2964 - ClassCastException when querying - 91/17991/2
Jan Hajnar [Thu, 9 Apr 2015 07:49:06 +0000 (09:49 +0200)]
Bug 2964 - ClassCastException when querying -
controller-config/yang-ext:mount/config:modules

* added recursive call to parseXml if baseType is leafref (otherwise
identityref and instnce identifier values were not serialized
correctly)

Change-Id: Ie17f8cff1b7bb59e541996a277ff6dfefa30a375
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoMerge "Fixed incorrect signature in NotificationListenerInvoker"
Robert Varga [Wed, 8 Apr 2015 22:55:45 +0000 (22:55 +0000)]
Merge "Fixed incorrect signature in NotificationListenerInvoker"

9 years agoFixed incorrect signature in NotificationListenerInvoker 54/17954/1
Tony Tkacik [Wed, 8 Apr 2015 17:42:29 +0000 (19:42 +0200)]
Fixed incorrect signature in NotificationListenerInvoker

Change-Id: I01e54f6193e54b1488a506ae47d24ba8c808281a
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2362: Wired integer value validating codec."
Robert Varga [Wed, 8 Apr 2015 16:34:00 +0000 (16:34 +0000)]
Merge "Bug 2362: Wired integer value validating codec."

9 years agoBug 2960 - Yang Data Codec Gson: failed to lookup prefix when 12/17912/2
Jan Hajnar [Wed, 8 Apr 2015 11:38:04 +0000 (13:38 +0200)]
Bug 2960 - Yang Data Codec Gson: failed to lookup prefix when
serializing identityref type

* added module qname as an input to JSONStringIdentityrefCodec, if no
prefix is specified this module qname is used for value deserialization.

Change-Id: I260eac6104cc8474008dd5eab23990408f86687e
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoBug 2362: Wired integer value validating codec. 57/17857/5
Tony Tkacik [Tue, 7 Apr 2015 15:02:06 +0000 (17:02 +0200)]
Bug 2362: Wired integer value validating codec.

Wired integer value validating codecs and fixed
tests which were using incorrect values.

Change-Id: If8fa1da1ec456049460e2b72477c0b0a86a4830d
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "BUG-2955: Fix error reporting for wrong YangInstanceIdentifier"
Tony Tkacik [Wed, 8 Apr 2015 11:13:43 +0000 (11:13 +0000)]
Merge "BUG-2955: Fix error reporting for wrong YangInstanceIdentifier"

9 years agoBUG-2955: Fix error reporting for wrong YangInstanceIdentifier 53/17853/4
Robert Varga [Tue, 7 Apr 2015 14:38:00 +0000 (16:38 +0200)]
BUG-2955: Fix error reporting for wrong YangInstanceIdentifier

As turns out, attempting to load the wrong value will be reported via
UncheckedExecutionException, which we failed to account for. Make sure
we also catch this type and convert it into an Optional.absent() -- that
will trigger callers to properly report an IllegalArgumentException.

Change-Id: I50441cce4be94a2ef0fcf12591c6ec0e437f1084
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMoved DerivedTypes to yang-model-util 56/17856/4
Tony Tkacik [Thu, 5 Mar 2015 19:09:52 +0000 (20:09 +0100)]
Moved DerivedTypes to yang-model-util

Derived* types make more sense and are more usable
if present in yang-model-util instead of yang-model-export.

Their presence in yang-model-util allows for better reuse
and simplification of code dealing with yang-types.

Change-Id: I259325f830d7e8d0095c0cfbfe3c0a5a450d05a1
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "BUG 2908 - Unable to read data from netconf northbound loopback connection."
Tony Tkacik [Wed, 8 Apr 2015 09:09:00 +0000 (09:09 +0000)]
Merge "BUG 2908 - Unable to read data from netconf northbound loopback connection."

9 years agoBUG 2908 - Unable to read data from netconf northbound loopback connection. 49/17249/6
Tomas Cere [Fri, 27 Mar 2015 15:32:19 +0000 (16:32 +0100)]
BUG 2908 - Unable to read data from netconf northbound loopback connection.

In case of a model with multiple revisions, read from mount-point can
fail due to schema node lookup from the wrong revision of a module.
Fixed so findFirstChild in schemaUtils returns newest revision.

Change-Id: I269f35767696364e761d3c3bf245b22830f0f850
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoBug 2362: Added range validation as last part of deserialization. 55/17855/3
Tony Tkacik [Tue, 7 Apr 2015 14:46:38 +0000 (16:46 +0200)]
Bug 2362: Added range validation as last part of deserialization.

Change-Id: I801aa22f868a13c098686aa077c46a378af8dfe4
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMoved implementation of (U)Int* codecs to separate classes 51/17851/1
Tony Tkacik [Tue, 7 Apr 2015 14:10:31 +0000 (16:10 +0200)]
Moved implementation of (U)Int* codecs to separate classes

Change-Id: I589eff7a961d19486529f5d2b5dbc5433988b931
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoIntroduced AbstractIntegerStringCodec. 42/17842/1
Tony Tkacik [Tue, 7 Apr 2015 13:11:20 +0000 (15:11 +0200)]
Introduced AbstractIntegerStringCodec.

All integer codecs were implementing deserialization in
same fashion - detect number format and actual deserialization.

This patchset introduces common abstract class which
does this same and concrete classes only implement construction
of objects.

Change-Id: I03433a2de54b08b3c23967f4f25f5ba465da0a34
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2909 - Gson codec lost correct type"
Tony Tkacik [Tue, 7 Apr 2015 09:32:07 +0000 (09:32 +0000)]
Merge "Bug 2909 - Gson codec lost correct type"

9 years agoBUG-2939: fixup dynamic nodes to cover overwrites 64/17664/12
Robert Varga [Thu, 2 Apr 2015 17:20:18 +0000 (19:20 +0200)]
BUG-2939: fixup dynamic nodes to cover overwrites

Promote inner classes to their proper equivalents. Perform proper lazy
comparison to cover all possible scenarios where the user might
want to examine terminal nodes in greater depth. This is done by
tracking presence of before/after data and fudging appropriate
modification types.

We make sure to not run equals() on the data, as that may introduce very
steep costs -- an overwrite with the same value is still reported as a
full write, not as unmodified.

Change-Id: I0df100a74cfa82ceddeefcfae0ca2a011c608e08
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Fixed NPE in BindingCodecTree#getSubtreeCodec(YangInstanceIdentifier)"
Robert Varga [Thu, 2 Apr 2015 14:21:46 +0000 (14:21 +0000)]
Merge "Fixed NPE in BindingCodecTree#getSubtreeCodec(YangInstanceIdentifier)"

9 years agoFixed NPE in BindingCodecTree#getSubtreeCodec(YangInstanceIdentifier) 35/17635/1
Tony Tkacik [Thu, 2 Apr 2015 13:35:03 +0000 (15:35 +0200)]
Fixed NPE in BindingCodecTree#getSubtreeCodec(YangInstanceIdentifier)

Change-Id: If77807004779ce6ade106f1bacc9918f98f996ee
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2939: Lazily expanded CandidateNode for writes and deletes 28/17628/3
Tony Tkacik [Thu, 2 Apr 2015 12:39:22 +0000 (14:39 +0200)]
Bug 2939: Lazily expanded CandidateNode for writes and deletes

Introduced Lazily expanded CandidateNodes for writes and deletes
which does not have before or after state and ModificationType
is same for whole subtree.

Change-Id: Ib26774f9a5e76428fefb35e1d053dad95e8752cf
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2393: Extracted CandidateNode from InMemoryDataTreeCandidate 23/17623/1
Tony Tkacik [Thu, 2 Apr 2015 12:27:26 +0000 (14:27 +0200)]
Bug 2393: Extracted CandidateNode from InMemoryDataTreeCandidate

Change-Id: I4941ec32f22456be1411bd7703acac401d81d3de
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoDo not embed java-concurrent-hash-trie-map 06/17506/4
Robert Varga [Tue, 31 Mar 2015 21:44:08 +0000 (23:44 +0200)]
Do not embed java-concurrent-hash-trie-map

The package is a full OSGi bundle, no need to inline it in the user
anymore.

Change-Id: I9560ab80f07769c77a75b9c99043b8dc694ab2a8
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: remove unneeded null check 04/17504/4
Robert Varga [Tue, 31 Mar 2015 21:14:43 +0000 (23:14 +0200)]
BUG-869: remove unneeded null check

Instanceof checks for null implicitly, no need to be explicit.

Change-Id: I2f378567c34fa7ba7adcf8a6c369c2aa6221badf
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: kill more sonar warnings 03/17503/4
Robert Varga [Tue, 31 Mar 2015 21:11:08 +0000 (23:11 +0200)]
BUG-869: kill more sonar warnings

Empty statement, mis-ordered annotations and keywords, unneeded
keywords.

Change-Id: I88a7ba62b5fe22cda96a1b5243a2ae4968c31ab3
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: remove public modifier 02/17502/2
Robert Varga [Tue, 31 Mar 2015 20:55:31 +0000 (22:55 +0200)]
BUG-869: remove public modifier

Public is implied for all methods in an interface, do not specify it
explicitly.

Change-Id: Ic673b60111f9ecf62a6242d3bedf8607036a3403
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: use curly braces 66/17366/4
Robert Varga [Mon, 30 Mar 2015 15:38:45 +0000 (17:38 +0200)]
BUG-869: use curly braces

This clarifies the code a bit.

Change-Id: Icc7c70404942b4497deb060df986ac48610c9204
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agofix for getModifiedChild() in InMemoryDataTreeCandidate 40/17540/1
Jan Hajnar [Wed, 1 Apr 2015 13:28:24 +0000 (15:28 +0200)]
fix for getModifiedChild() in InMemoryDataTreeCandidate

Change-Id: Id28e5d42f2a5552c1519e6ac57aaf6f053e28735
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoBug 2374 - YANG Binding: Added support for AugmentationHolder interface 40/17440/1
Tony Tkacik [Tue, 31 Mar 2015 12:57:44 +0000 (14:57 +0200)]
Bug 2374 - YANG Binding: Added support for AugmentationHolder interface

Binding specification v1 was originally designed and implemented
in only one implementation of interfaces in mind, which were generated one,
but during Helium additional implementation was introduced, but
specification and generated copy builder constructor did not accounted for
that change. Added additional interface which is implemented by LazyDataObject
that allow copy of augmenations.

Updated code generator to allow for that change and implementation of
LazyDataObject to support new interface contract.

Change-Id: I15aec38259f7f5e95301368d0264dfcf0571e2ba
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2924: DataCodecTree expose (de)serialization methods for path arguments."
Robert Varga [Tue, 31 Mar 2015 11:19:49 +0000 (11:19 +0000)]
Merge "Bug 2924: DataCodecTree expose (de)serialization methods for path arguments."

9 years agoBug 2924: DataCodecTree expose (de)serialization methods for path arguments. 05/17405/1
Tony Tkacik [Tue, 31 Mar 2015 08:39:37 +0000 (10:39 +0200)]
Bug 2924: DataCodecTree expose (de)serialization methods for path arguments.

Change-Id: I21129df70829a6b9a35af8350352907d46d27de2
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-869: remove unused assignment 65/17365/1
Robert Varga [Mon, 30 Mar 2015 15:34:59 +0000 (17:34 +0200)]
BUG-869: remove unused assignment

This assignment in return does not make sense, remove it.

Change-Id: Ie999973df471af9f5364ddf2154a24ce237278dc
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: do not use StringBuffer 64/17364/1
Robert Varga [Mon, 30 Mar 2015 15:33:17 +0000 (17:33 +0200)]
BUG-869: do not use StringBuffer

StringBuilder is the right one, so let's use that one.

Change-Id: Ic84383c05c3cd6bb0eacf9df0bbb3ed9ae46ee3f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: constants should be static 63/17363/1
Robert Varga [Mon, 30 Mar 2015 15:27:13 +0000 (17:27 +0200)]
BUG-869: constants should be static

This makes description a proper constant.

Change-Id: If01937700abd3bc8b8995b1cdbc651007e62c85d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: allow instantiation of SynchronizedDataTreeModification 60/17360/1
Robert Varga [Mon, 30 Mar 2015 15:24:58 +0000 (17:24 +0200)]
BUG-869: allow instantiation of SynchronizedDataTreeModification

create() method should be static.

Change-Id: If0bce2139163fccee8da7d8da4307a6e3d8d2dc3
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: remove public modifier 59/17359/1
Robert Varga [Mon, 30 Mar 2015 15:23:40 +0000 (17:23 +0200)]
BUG-869: remove public modifier

public is implied to all identifiers within the enclosing interface.

Change-Id: I43a50c7d51b73074df6d0456cf0d9d9aab24b819
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: remove empty statements 57/17357/1
Robert Varga [Mon, 30 Mar 2015 15:13:29 +0000 (17:13 +0200)]
BUG-869: remove empty statements

Sonar warnings point to semicolons after method definitions and ;;.
Remove all instances.

Change-Id: I1ba067720abd4c9df3a0c457b947736c9bc6313e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2909 - Gson codec lost correct type 38/17338/1
Jan Hajnar [Mon, 30 Mar 2015 12:33:34 +0000 (14:33 +0200)]
Bug 2909 - Gson codec lost correct type

* changed parseXmlValue() method to parse leafref nodes according to
type referenced by leafref.

Change-Id: I6911e22fd2ef8d5845b507ee47d2b1283fb45784
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoMerge "BUG-2876: prune empty subtree modifications"
Tony Tkacik [Mon, 30 Mar 2015 08:24:52 +0000 (08:24 +0000)]
Merge "BUG-2876: prune empty subtree modifications"

9 years agoMerge "Bug 2366: Introducing support for statement ANTLR4 parser as defined in RFC602...
Tony Tkacik [Mon, 30 Mar 2015 08:24:14 +0000 (08:24 +0000)]
Merge "Bug 2366: Introducing support for statement ANTLR4 parser as defined in RFC6020, part 6.3"

9 years agoMerge "Add DefaultDataTreeCandidate utility class"
Tony Tkacik [Mon, 30 Mar 2015 08:15:43 +0000 (08:15 +0000)]
Merge "Add DefaultDataTreeCandidate utility class"

9 years agoMerge "Bug 2906 - Added support of entering notification by #streamChild()"
Robert Varga [Fri, 27 Mar 2015 10:52:48 +0000 (10:52 +0000)]
Merge "Bug 2906 - Added support of entering notification by #streamChild()"

9 years agoBug 2906 - Added support of entering notification by #streamChild() 21/17221/2
Tony Tkacik [Fri, 27 Mar 2015 10:04:50 +0000 (11:04 +0100)]
Bug 2906 - Added support of entering notification by #streamChild()

Root Tree Node context did not allowed to enter notification
using binding classes by #streamChild method, since
notifications were cached in different collection.

Added support for entering notifications using such method.

Change-Id: I28779e763a81519d25d71e319776cdc6f179ef33
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2894 - Yang Data Codec Gson: null pointer exception when trying to deseria...
Tony Tkacik [Thu, 26 Mar 2015 16:37:55 +0000 (16:37 +0000)]
Merge "Bug 2894 - Yang Data Codec Gson: null pointer exception when trying to deserialize leafref value"

9 years agoBug 2894 - Yang Data Codec Gson: null pointer exception when trying to 05/17105/2
Jan Hajnar [Tue, 24 Mar 2015 16:52:01 +0000 (17:52 +0100)]
Bug 2894 - Yang Data Codec Gson: null pointer exception when trying to
deserialize leafref value

* added function to serch for module where type was originaly defined,
so correct DataSchemaNode can be found when resolving leafref.

Change-Id: I00fd8fbdfe6f548f465e7e50eed9845e443b1f43
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoBUG-2876: prune empty subtree modifications 68/16968/6
Robert Varga [Sun, 22 Mar 2015 22:25:06 +0000 (23:25 +0100)]
BUG-2876: prune empty subtree modifications

Another container resolution precision improvement: check if operations
under a TOUCH logical operation actually have any effects before
declaring it a SUBTREE_MODIFIED. The improved accuracy allows us to
prune unmodified paths when observed by users of
InMemoryDataTreeCandidate, as we can report actual impact on the data.

Change-Id: I3b71f82c43d6c1bbfa9a9d9008bead572da17bf7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Rename applySubtreeChange()"
Tony Tkacik [Wed, 25 Mar 2015 09:41:07 +0000 (09:41 +0000)]
Merge "Rename applySubtreeChange()"

9 years agoMerge "Rename checkSubtreeModificationApplicable()"
Tony Tkacik [Wed, 25 Mar 2015 09:40:59 +0000 (09:40 +0000)]
Merge "Rename checkSubtreeModificationApplicable()"

9 years agoCleanup checkstyle warnings 87/17087/1
Robert Varga [Wed, 25 Mar 2015 07:01:57 +0000 (08:01 +0100)]
Cleanup checkstyle warnings

We have various reported problems, from missing spaces, javadocs to
undocumented classes and parameters.

Change-Id: I38a15258ea5ba8eb8d97f257a36a4d890165b5a0
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRename applySubtreeChange() 46/17046/1
Robert Varga [Tue, 24 Mar 2015 10:35:48 +0000 (11:35 +0100)]
Rename applySubtreeChange()

This name comes from ModificationType, which does not describe the
logical operation being applied. Rename it to applyTouch() to keep
naming consistent with others.

Change-Id: Id2a1e0f6c1704331bccf8660a13d7bebe8360d7f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRename checkSubtreeModificationApplicable() 45/17045/1
Robert Varga [Tue, 24 Mar 2015 10:32:54 +0000 (11:32 +0100)]
Rename checkSubtreeModificationApplicable()

This name comes from the ModificationType enum, which is no longer
applicable internally. Shorted the name to checkTouchApplicable().

Change-Id: I5e1b844330a7b4a798b6a96403fa07de44813e96
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdd DefaultDataTreeCandidate utility class 28/16928/3
Robert Varga [Fri, 20 Mar 2015 17:58:47 +0000 (18:58 +0100)]
Add DefaultDataTreeCandidate utility class

We have DataTreeCandidate implementations cropping up in the system,
this provides a simple class for reuse.

Change-Id: I3e0b594fd67b194fc38d4d3a1e2643802772aec1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDo not use recursive tree creation 17/17017/1
Robert Varga [Mon, 23 Mar 2015 18:23:34 +0000 (19:23 +0100)]
Do not use recursive tree creation

AbstractValueNodeModificationStrategy is creating leaf entries in the
tree. We know for a fact they do not have children, so there is no need
to eagerly instantiate child tree nodes.

The same thing is true for the root node. Since we can deal with lazily
instantiating tree nodes, we do not have to eagerly allocate them.

Change-Id: I1a55cc9d5f43c8b2c92324d470ab533fc06ad95c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix child ordering assumptions 92/16992/4
Robert Varga [Mon, 23 Mar 2015 10:59:57 +0000 (11:59 +0100)]
Fix child ordering assumptions

When instantiating nodes during an operation, we first looked up the
strategy and then specified its child handling strategy to all
intermediate nodes. This means we could have ended up specifying
ordering on a node which does not needed, or (worse) not specifying it
where it was needed.

Clean this up by walking the modification and strategy trees in sync,
bailing if we run out of strategy nodes.

While at it, turn the simple boolean into a full-blown enum, as what we
want to pass down is a tri-state: ORDERED, UNORDERED and NONE. The first
two correspond to previous true and false. The last one is useful for
leaves, as they cannot contain children, which means we can skip
instantiation of a mutable map and just use Collections.emptyMap().

Change-Id: I6ffd48b481a149255325dc31f99b7b23eebc928e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMake LatestOperationHolder final 91/16991/3
Robert Varga [Mon, 23 Mar 2015 14:14:43 +0000 (15:14 +0100)]
Make LatestOperationHolder final

The class is really final DTO, so make that explicit. It is used only
within its package, so lower method visibility.

Change-Id: Icfec15a3acc90dbb22c803ff856d3bcc4f862089
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoTurn ModificationApplyOperation into an abstract class 90/16990/3
Robert Varga [Mon, 23 Mar 2015 14:01:15 +0000 (15:01 +0100)]
Turn ModificationApplyOperation into an abstract class

This functionality is not externally-visible, so we can safely reap the
benefits of having a fixed mathod dispatch.

Change-Id: Iefb54cf852fe304419e4d306e7828a4663b0aebc
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoOptimize AbstractDataNodeContainerModificationStrategy loader 97/16997/2
Robert Varga [Mon, 23 Mar 2015 14:29:33 +0000 (15:29 +0100)]
Optimize AbstractDataNodeContainerModificationStrategy loader

The cache loader can be directly instantiated, removing the need for an
intermediate function.

Change-Id: I46329978d93874920adb5b64c00e502418869d6c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRename DataNodeContainerModificationStrategy 89/16989/2
Robert Varga [Mon, 23 Mar 2015 13:43:08 +0000 (14:43 +0100)]
Rename DataNodeContainerModificationStrategy

DataNodeContainerModificationStrategy acts as an abstract base class,
which is further finalized by multiple classes. Make sure we make this
fact explicit in its name by calling it
AbstractDataNodeContainerModificationStrategy.

Change-Id: I7dc2b6e99feb542ab120e52d3c8e5f7ee1c35ddd
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRename NormalizedNodeContainerModificationStrategy 88/16988/2
Robert Varga [Mon, 23 Mar 2015 13:38:33 +0000 (14:38 +0100)]
Rename NormalizedNodeContainerModificationStrategy

This is an abstract class for nodes which can hold other nodes. Rename
it to AbstractNodeContainerModificationStrategy to make this fact
immediately obvious.

Change-Id: I0cbf418d8351098d3eda83fad2def6b23c61427b
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRename ValueNodeModificationStrategy 87/16987/2
Robert Varga [Mon, 23 Mar 2015 13:35:42 +0000 (14:35 +0100)]
Rename ValueNodeModificationStrategy

This is a base class, which is finalized using two different classes.
Make sure it carries 'Abstract' in its name, so it is obvious it is not
a complete strategy.

Change-Id: Ib84bb4574bda7b8f88906b668a5117f69740cddf
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoSplit out static classes 86/16986/2
Robert Varga [Mon, 23 Mar 2015 13:17:44 +0000 (14:17 +0100)]
Split out static classes

We have a lot of subclasses defined in the same files as the abstract
classes they extend. Split the classes out so we get clear file/class
separation.

Change-Id: I22b2b9943b080d2291cb339f84f068a0cc0defe7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoLower method visibility 85/16985/2
Robert Varga [Mon, 23 Mar 2015 13:13:48 +0000 (14:13 +0100)]
Lower method visibility

A couple of methods are declared as public, but are not visible to the
outside world because their classes are package-visible. Reduce the
declared visibility to make sure this fact is immediately obvious.

Change-Id: Ia5de906619f6098974cada1dcec9f47dbac7f139
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove duplicate import 84/16984/2
Robert Varga [Mon, 23 Mar 2015 13:55:55 +0000 (14:55 +0100)]
Remove duplicate import

Removes an unused import and adds final keywords as appropriate.

Change-Id: I8f5fa9620cba67ea425e99b6cc9f64135a28023a
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agocheckApplicable() for DELETE overflows into TOUCH 04/17004/1
Robert Varga [Mon, 23 Mar 2015 15:52:55 +0000 (16:52 +0100)]
checkApplicable() for DELETE overflows into TOUCH

There is a missing split between checking whether DELETE is applicable,
which means we check if TOUCH is applicable, too.

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