yangtools.git
8 years agoBug 3670 (part 1/5): Use of new statement parser in yang-maven-plugin 20/25520/3
Peter Kajsa [Thu, 20 Aug 2015 09:21:38 +0000 (11:21 +0200)]
Bug 3670 (part 1/5): Use of new statement parser in yang-maven-plugin

Parser fixes:
- error message fix
- SchemaContextUtilTest fix
- module source path fix
- module source prep.
- import of multiple revision module without revision specifying fix
- minor fixes of BaseStatementImpl class
- adjustment of decimal64 type to original yang parser behavior
- restrictions to leaf return type fix
- range constraints in decimal64 typedef fix
- xpath validation bug fix
- case short hand augmenting fix
- augment order fix
- module dependency sort in effective schema context fix
- get original statement context fix
- statement context copy type fix
- unknown statements QName resolution fix
- extension definition fix in test models
- moduleImport default revision replace
- default revision fix
- sourcePath resolved correctly via NamedFileInputStream

Change-Id: I54656ff50f681bb1357f7df4e606af3c925341eb
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoMake YangInstanceIdentifier implement Cloneable 22/26122/3
Robert Varga [Thu, 27 Aug 2015 17:17:57 +0000 (19:17 +0200)]
Make YangInstanceIdentifier implement Cloneable

YangInstanceIdentifier should not be cloned, but this may prove useful
some day.

Change-Id: Ice20b45925a1a8e777938a9de98c70f380e7893a
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoMove YangInstanceIdentifier.Builder 21/26121/3
Robert Varga [Thu, 27 Aug 2015 17:22:49 +0000 (19:22 +0200)]
Move YangInstanceIdentifier.Builder

The inline interface definition is in a visually-wrong place. Reader
walking through YangInstanceIdentifier is expecting PathArgument
subclasses after AbstractPathArgument. Move the entire block to the end
of the class.

Change-Id: I6a34f2c1b5b5697be64587271a809cff161997fa
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoReducing cylomatic complexity of BuildGlobalContext 60/19460/9
Debalina Ghosh [Fri, 1 May 2015 22:09:59 +0000 (15:09 -0700)]
Reducing cylomatic complexity of BuildGlobalContext

Change-Id: Ife037a6681a9934c321f90dc5b54f47ce06cd899
Signed-off-by: Debalina Ghosh <debalina.ghosh@hp.com>
8 years agoBUG-4158: ImmutableOffsetMap should not be Cloneable 86/26186/1
Robert Varga [Sat, 29 Aug 2015 09:02:52 +0000 (11:02 +0200)]
BUG-4158: ImmutableOffsetMap should not be Cloneable

Removes Cloneable from ImmutableOffsetMap, as it serves no real purpose.
Also improve test coverage.

Change-Id: I381fd5a796f132fa3620559e7159bd25bf6447b5
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoUse ImmutableOffsetMap for NodeWithKey entries 20/26120/1
Robert Varga [Thu, 27 Aug 2015 17:51:50 +0000 (19:51 +0200)]
Use ImmutableOffsetMap for NodeWithKey entries

Number of elements allowed in NodeWithKey equals to the number of leaf
nodes specified in the 'key' statement. It is usually a small number of
elements, but these tend to have many instances.

This patch optimizes memory usage with more than one key leaf. Instead
of an ImmutableMap, in which each instance has its own unique key set,
we use an ImmutableOffsetMap, which shares the key set across all
instances. The cost here is a LoadingCache lookup which should prove
neglible.

Change-Id: I68afe667415ba1eaddbb081b419fedcae4e4b8f7
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4158: optimize ImmutableOffsetMap 19/26119/1
Robert Varga [Sat, 22 Aug 2015 22:36:51 +0000 (00:36 +0200)]
BUG-4158: optimize ImmutableOffsetMap

This patch providers optimized equals() for both version of OffsetMap.
It also implements an optimized version of MutableOffsetMap.keySet(),
which does not require SimpleEntry instantiation.

Change-Id: I6a65680bbcc7ad37f251431e495cde48f23efb22
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4158: use ImmutableOffsetMap 33/26033/8
Robert Varga [Tue, 25 Aug 2015 09:06:56 +0000 (11:06 +0200)]
BUG-4158: use ImmutableOffsetMap

In order to improve memory efficiency of maps holding children of
container nodes, use ImmutableOffsetMap instead of wrapping constructed
children.

Change-Id: Ib11b8d5adc4d5509ecbbba59348638f78fc2e62b
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4158: Introduce Modifiable/UnmodifiableMapPhase 32/26032/2
Robert Varga [Tue, 25 Aug 2015 08:18:13 +0000 (10:18 +0200)]
BUG-4158: Introduce Modifiable/UnmodifiableMapPhase

Our code frequently uses an access pattern, where we create a modifiable
map, then turn it into an unmodifiable one and then we want to create a
modifiable map containing all the mappings in the unmodifiable one (and
then turn it again into unodifiable).

This patch introduces interfaces which mark the modifiable/unmodifiable
phases of such mapping. They also define the interface contract
implementation must follow to be usable with this usabe pattern.

Change-Id: I08b3077739a3df89e57c54a6937744f2394701bc
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4158: introduce ImmutableOffsetMap 94/25994/10
Robert Varga [Sat, 22 Aug 2015 22:36:51 +0000 (00:36 +0200)]
BUG-4158: introduce ImmutableOffsetMap

ImmutableOffsetMap stores its children in an array and shares the
key-to-offset map with other instances. In order to facilitate the
modification cycle, there is also a MutableOffsetMap, which uses a
LinkedHashMap to record any additions.

The conversion between the two reuses the backing array as much as
possible, to make transitions between modification cycles when no
structural modification occurs efficient.

Change-Id: I100469426c1cf741dd5545c5d11fd29aa3e4ab8b
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoSwitch to using MoreObjects 17/25717/3
Robert Varga [Sat, 22 Aug 2015 09:24:34 +0000 (11:24 +0200)]
Switch to using MoreObjects

Guava's Objects is deprecated with Java 7, move to using MoreObjects.

Change-Id: I84078b7990219ef31d22f1bd8e49e2455699721a
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoSplitted out incorrectly grouped features. 08/26008/2
Tony Tkacik [Wed, 26 Aug 2015 10:00:29 +0000 (12:00 +0200)]
Splitted out incorrectly grouped features.

Change-Id: I66cbe5aa472479220870daefeee65dd62b48c506
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 3859: Use of reference keyword in a YANG extension 25/26025/1
Martin Ciglan [Fri, 21 Aug 2015 12:48:34 +0000 (14:48 +0200)]
Bug 3859: Use of reference keyword in a YANG extension
    causes YangSyntaxErrorException

Once reference or any other yang statement is defined within use of
extension (unknown statement), this should be correctly parsed
as another unknown statement. This behavior has been
added to RFC6020 ANTLR grammar and tested.

Change-Id: I3eed81e67ba6192e2c98154e7e6800215b1cc4bf
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit e8a7058112bacbafada62cb71fef8207506d38d5)

8 years agoIntroduce CloneableMap 93/25993/2
Robert Varga [Sat, 22 Aug 2015 00:41:29 +0000 (02:41 +0200)]
Introduce CloneableMap

This is generalization of CloneableChildrenMap and will supersede it.

Change-Id: Ie6cbe039510be5734d81fca7e50ed7b4d6e06a07
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoImport YangInstanceIdentifier inner classes 72/25772/3
Robert Varga [Sun, 23 Aug 2015 00:12:18 +0000 (02:12 +0200)]
Import YangInstanceIdentifier inner classes

Instead of specifying YangInstanceIdentifier.NodeIdentifier, import it
directly for brewity.

Change-Id: I106557f5f9757bd66975ee74b30f00233b45a01d
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoUse odlparent version for maven-plugin-plugin 55/25255/4
Thanh Ha [Thu, 13 Aug 2015 16:55:33 +0000 (12:55 -0400)]
Use odlparent version for maven-plugin-plugin

This pulls the version from <pluginManagement> section in odlparent.

Change-Id: I468fb3c084ed50d797e641c4b05c7a219ec9048f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoRemove unnecessary cast 16/25716/2
Robert Varga [Sat, 22 Aug 2015 09:26:11 +0000 (11:26 +0200)]
Remove unnecessary cast

We already have CursorAwareDataTreeModification, no need to perform a
cast.

Change-Id: I005f32db4f22069ed10fd1d5692a7aad0baf0fd4
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoRemoved unused interface and dependency. 60/25560/2
Tony Tkacik [Fri, 21 Aug 2015 09:26:45 +0000 (11:26 +0200)]
Removed unused interface and dependency.

Change-Id: I8cdd07c16af497d1950d9197479d5a5ff19f2389
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoExplicitly set git-review branch to master 35/24435/3
Thanh Ha [Wed, 22 Jul 2015 19:32:48 +0000 (15:32 -0400)]
Explicitly set git-review branch to master

Change-Id: Ideb0097000c0aea29536617781b5d745a98207e1
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in yang-data-api 36/24836/2
Thanh Ha [Thu, 6 Aug 2015 02:55:40 +0000 (22:55 -0400)]
Fix license header violations in yang-data-api

Change-Id: I7daf6904caa9663c66190ae730050de654217ebd
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in yang-model-export 45/24845/2
Thanh Ha [Thu, 6 Aug 2015 03:43:21 +0000 (23:43 -0400)]
Fix license header violations in yang-model-export

Change-Id: I14acb8a5c0adb44046346683938bb0d2464067ab
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in restconf-client-impl 44/24844/2
Thanh Ha [Thu, 6 Aug 2015 03:36:22 +0000 (23:36 -0400)]
Fix license header violations in restconf-client-impl

Change-Id: Ia1f38a95328550612e307d06b607faee57ae654c
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in restconf-client-api 43/24843/2
Thanh Ha [Thu, 6 Aug 2015 03:33:16 +0000 (23:33 -0400)]
Fix license header violations in restconf-client-api

Change-Id: I9acb695fd38f9f8230895e476218ecc698a9dfa1
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in yang-data-codec-gson 42/24842/2
Thanh Ha [Thu, 6 Aug 2015 03:30:20 +0000 (23:30 -0400)]
Fix license header violations in yang-data-codec-gson

Change-Id: Ia5f799e64b213f20230c2eb03ad572a1c51bd092
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in yang-data-operations 41/24841/2
Thanh Ha [Thu, 6 Aug 2015 03:27:37 +0000 (23:27 -0400)]
Fix license header violations in yang-data-operations

Change-Id: I75d74620e58a2041dc3b48ba68c9794cc4d1bec9
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in binding-data-codec 40/24840/2
Thanh Ha [Thu, 6 Aug 2015 03:24:47 +0000 (23:24 -0400)]
Fix license header violations in binding-data-codec

Change-Id: I797ac93efabe9eea6d2ae161ec39f3028ca78807
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in binding-generator-impl 39/24839/2
Thanh Ha [Thu, 6 Aug 2015 03:19:46 +0000 (23:19 -0400)]
Fix license header violations in binding-generator-impl

Change-Id: If155761c145d7b6db8c4378343733a7be256ba98
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in binding-type-provider 38/24838/2
Thanh Ha [Thu, 6 Aug 2015 03:11:52 +0000 (23:11 -0400)]
Fix license header violations in binding-type-provider

Change-Id: Ib00d5625f834a9de12d10f8c3d9cbaaa7e70eb05
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in yang-data-impl 37/24837/2
Thanh Ha [Thu, 6 Aug 2015 03:10:36 +0000 (23:10 -0400)]
Fix license header violations in yang-data-impl

Change-Id: I14aecd28c5b0ea1fd2f5248947e47e9131492624
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in yang-parser-impl 35/24835/1
Thanh Ha [Thu, 6 Aug 2015 02:39:13 +0000 (22:39 -0400)]
Fix license header violations in yang-parser-impl

Change-Id: Id23afe407505b79ae35eb5f4cf10e08374881d92
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in yang-model-util 34/24834/1
Thanh Ha [Thu, 6 Aug 2015 02:24:07 +0000 (22:24 -0400)]
Fix license header violations in yang-model-util

Change-Id: I2c5a0c5baf5646563f8da3b44ca493141a8ea519
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in yang-parser-api 33/24833/1
Thanh Ha [Thu, 6 Aug 2015 02:26:54 +0000 (22:26 -0400)]
Fix license header violations in yang-parser-api

Change-Id: I0133243f4ac4239f97c00dca87c9177b8f82ac7a
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in yang-model-api 32/24832/1
Thanh Ha [Thu, 6 Aug 2015 02:26:40 +0000 (22:26 -0400)]
Fix license header violations in yang-model-api

Change-Id: I998b424fe937ed776ddab2119f41b398129308fa
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in yang-common 31/24831/1
Thanh Ha [Thu, 6 Aug 2015 02:26:18 +0000 (22:26 -0400)]
Fix license header violations in yang-common

Change-Id: I30af43e2770a0eac1906e417c818f9cd5ce6851b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in yang-binding 30/24830/1
Thanh Ha [Thu, 6 Aug 2015 02:26:03 +0000 (22:26 -0400)]
Fix license header violations in yang-binding

Change-Id: I3c3fcd27c50ef3aa3c79ddaccddf8dfcf8bad4d8
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix license header violations in common/util 29/24829/1
Thanh Ha [Thu, 6 Aug 2015 02:25:25 +0000 (22:25 -0400)]
Fix license header violations in common/util

Change-Id: I4d26740f5a29b65f522cc1e779d8dfc226dd986a
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBug 2366 - Effective statments impl merge, retest & bugfix 85/20885/98
Peter Kajsa [Mon, 13 Jul 2015 12:51:21 +0000 (14:51 +0200)]
Bug 2366 - Effective statments impl merge, retest & bugfix

- rebase
- integrated changes from https://git.opendaylight.org/gerrit/#/c/21310
- added some JavaDoc, minor fixes in null checking, unneeded code, refactoring etc.
- minor fixes in hashCode(), equals(), getters etc.
- list key relative path fix
- list keys resolution fix
- multiple modules and revisions fix
- rebase on master
- instance identifier type build fix
- bug2649 test
- re-sync of retest with old impl folder (old parser vs. new parser)
- buildType qname fix
- non YANG statement detection implemented
- uses-augment module qname fix
- uses-augment is augmenting fix
- type constraints parsing and validation fix
- Unique statement support added
- identityRef validation simplification
- typedef base type QName resolution fix
- parse with context fix
- typedef order unit test fix
- invalid string patterns parsing fix
- refine unknown statements fix
- union types order fix
- typedef in grouping fix
- identityRef null identity fix
- pick latest revision even when not reverse chronologicaly ordered in module fix
- clean up of SourceSpecificContext & YangStatementParserListenerImpl classes, rebased on master
- types, extended types and type definitions impl and bugfix
- declared types resolution
- statementSourceReference support implemented
- basicType impl proposal
- typeDefEffStmt impl as builder of ExtendedType
- few decl. types resolution fixes done
- identityRefs validation implemented
- fixed tests dealing with unknown stmts
- uses getRefine fix
- load with context retest
- ordering of statements and substatements fix
- augment into unknown statement body fix
- uses or augment in unknown statement body fix
- extension identifier correctly passed to unknown statement for effective resolution phase
- substatements of included submodules appendation fix
- node name collision validation
- refine target validation
- added statement copy type by both Augment and Uses (when augmenting in uses statement)
- some of negative scenarios (arguments/statements validation) fix
- fix of module imports, revision
- augmentation namespace and revision initialization fix
- available augmentation impl fix
- Case shorthand schema path fix
- Case shorthand fix
- Unsupported augment targets fix
- Multiple augments to the same target - reactor fix
- StackOverflowException on cyclic identity hierarchy fix
- include vs. belongsTo linkage resolution fix
- introduces replacement of old YANG parser by new statement parser in
set of existing tests
- some test methods adjusted for new parser data structure

- Types & TypeDefs support & resolution implemented
- BelongsTo namespace added to be able to resolve typedefs from parent
  modules - Identity, IdentityRef support & resolution preparation
- Minor sonar issues fixed
- Effective statements related to types implemented

Bug 2366 - Effective statements implementation (2nd patch)

- added further implementation of Module and Submodule Effective statements and
  initialization of submodules collection in Module effective statement
- implementation of uses-refine
- implementation of Constraints, etc...
- effective statement fields initialization
- added unit tests
- fix of some issues in the parser (ModuleQName default revision date,
  Generics, etc..)

Bug 2366 - Identity, Refine, ... effective statements impl. (3th patch)

- implementation of Identity effective statement
- implementation of Refine effective statement
- initialization of some unitialized effective statments fields
- augmentation process fix
- unit tests

Change-Id: I95cda640136c966bd1b1fd3b0bcb1e143675eac1
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
Signed-off-by: Gregor Zatko <gzatko@cisco.com>
8 years agoRemoving duplicate literal 68/19668/9
Debalina Ghosh [Tue, 5 May 2015 22:33:00 +0000 (15:33 -0700)]
Removing duplicate literal

Change-Id: Ibc2ebe54aedcc8b7ca6f4c2074fd2af8e8cc83b6
Signed-off-by: Debalina Ghosh <debalina.ghosh@hp.com>
8 years agoBUG-1485: remove deprecated range methods 08/22008/12
Robert Varga [Fri, 5 Jun 2015 21:20:55 +0000 (23:20 +0200)]
BUG-1485: remove deprecated range methods

This Be-cycle patch removes the methods which have been removed in
Lithium, improving class size and not leaking the enforcement details.

Change-Id: I629df675eecac10c0aad1ed212123dca0f6d81d8
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 2882: Fix off-by-one usage of cursor. 97/23897/1
Tony Tkacik [Wed, 8 Jul 2015 11:23:00 +0000 (13:23 +0200)]
Bug 2882: Fix off-by-one usage of cursor.

DataTreeCandidates#applyToModification
when dealing with cursor-aware transaction
entered writen / element twice - once with enter
and once with write which resulted in exception.

Change-Id: Ifd4023c7ad54f2be1672c42725dd37f4e3ff8282
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoIntroduce isMixin() 22/23822/2
Robert Varga [Wed, 17 Jun 2015 07:59:30 +0000 (09:59 +0200)]
Introduce isMixin()

Instead of using a marker interface, expose an explicit method.

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

8 years agoBUG-2882: implement DataTreeModificationCursor 25/23825/1
Robert Varga [Wed, 17 Jun 2015 11:40:58 +0000 (13:40 +0200)]
BUG-2882: implement DataTreeModificationCursor

This patch makes InMemoryDataTree's snapshots and modifications
implement CursorAware, allowing more efficient traversal.

Change-Id: I279fd6b7d2e14fdfa1827c500a6d323a53207ab5
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 3eed7efd259a1285df1d9206a65579b2171a4007)

8 years agoAllow instantiation of rooted DataTrees 24/23824/1
Robert Varga [Tue, 16 Jun 2015 23:08:50 +0000 (01:08 +0200)]
Allow instantiation of rooted DataTrees

We are not restricted to instantiation of data trees only at the root,
but can also bind them to a particular SchemaPath. Accessing such a data
tree uses relative instance identifiers, thus increasing performance.

Change-Id: I065d224e851c723d775f2b5711f818747592fc74
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 6aced154f28787c22cf002e2faba4b5535695026)

8 years agoEnforce sealed DataTreeModification 23/23823/1
Robert Varga [Tue, 16 Jun 2015 09:12:03 +0000 (11:12 +0200)]
Enforce sealed DataTreeModification

DataTree needs to enforce the modification being sealed before
validation or preparation can proceed.

Change-Id: If0f26002f393f6cae469d755076da283c06c89f0
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 369acc82f1d32abae66a80c1479aa04b07d336a1)

8 years agoFixed sonar issues in o.o.y.util package. 83/19283/2
Tony Tkacik [Wed, 29 Apr 2015 09:25:26 +0000 (11:25 +0200)]
Fixed sonar issues in o.o.y.util package.

Change-Id: I577d3b3795340c33e2407bbecd821e5f1ff6cae7
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoFix bug in ImmutableMapEntryNodeBuilder 73/23673/3
Tom Pantelis [Sat, 20 Jun 2015 09:20:07 +0000 (05:20 -0400)]
Fix bug in ImmutableMapEntryNodeBuilder

In ImmutableMapEntryNodeBuilder#build, for the call to

   getChild(childrenQNamesToPaths.get(key.getValue()));

it should use key.getKey(). As a result, key childs nodes are never
found and thus user-provided nodes are always replaced.

NOTE: https://git.opendaylight.org/gerrit/#/c/23044/ should be merged
first to avoid unit test failure in the controller project.

Change-Id: I736756ce8fc3e15a05641565f2f505a2db32e9fc
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit f965264bb05b1dc5dc921eb1f8e80461e6a1cbb9)

8 years agoRemove unused import 18/23718/1
Robert Varga [Wed, 17 Jun 2015 07:22:56 +0000 (09:22 +0200)]
Remove unused import

YangInstanceIdentifier is only used as base reference to its nested
class, which we already import.

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

8 years agoImport YangInstanceIdentifier nested classes 17/23717/1
Robert Varga [Wed, 17 Jun 2015 06:57:43 +0000 (08:57 +0200)]
Import YangInstanceIdentifier nested classes

Rather than being verbose in referencing them, import and use them using
a short name.

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

8 years agoBug 3834 - Unhelpful error messages when parsing 35/23435/2
Jan Hajnar [Mon, 22 Jun 2015 12:53:04 +0000 (14:53 +0200)]
Bug 3834 - Unhelpful error messages when parsing
incorrect instance identifier in payload

* added custom exception when xpath argument ends with slash (before it
threw string out of bounds exception)
* added null check in DataSchemaContextNode so unknown qname for child
node does not crash on null pointer exception

Change-Id: Ie8db9c3cc1726dd73306437cb4eebb24f88eb5d9
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoRemove maven.bundle.version 80/23580/1
Robert Varga [Tue, 30 Jun 2015 09:58:48 +0000 (11:58 +0200)]
Remove maven.bundle.version

Plugin is already declared in odlparent, no need to specify version.

Change-Id: I1d09c934fd26e3aec2da1cda54d842373ce1f7fd
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoMake more mathods static 33/23533/1
Robert Varga [Mon, 29 Jun 2015 20:22:54 +0000 (22:22 +0200)]
Make more mathods static

Private methods not touching object state can be made static, make it
so. Also remove an open-coded version of Strings.isNullOrEmpty().

Change-Id: I6e62ce1a4eb4b1556654172554eb69542df60403
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoRemove unneeded cast 32/23532/1
Robert Varga [Mon, 29 Jun 2015 20:22:15 +0000 (22:22 +0200)]
Remove unneeded cast

This cast is reported as unneeded by eclipse, remove it.

Change-Id: I45b9c91fb0576859b48aba9a68b429cd79b9097e
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoFix some minor sonar warnings 48/23048/4
Robert Varga [Sun, 21 Jun 2015 20:56:35 +0000 (22:56 +0200)]
Fix some minor sonar warnings

Mostly misplaced 'final' modifiers.

Change-Id: I5197b844e73db00467f7ebb852677c39176e5c94
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-1014: Moved recursive verify of written data to ready() 85/22885/2
Tony Tkacik [Tue, 16 Jun 2015 08:46:53 +0000 (10:46 +0200)]
BUG-1014: Moved recursive verify of written data to ready()

Moved recursive verify of written data to ready(), recursive
verify of written data needs only to be run for write and/or
merge.
For other operations validity of data was tested in previous
transactions or doing the walk of SchemaApplyOperation
to resolve necessary information.

Change-Id: I1958ff747225f87913e8eb603212228910e38df0
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
(cherry picked from commit eebec9b8c818d4c3b8437805809fdec67d2a6616)

8 years agoBug 3821 - Augmentation codecs may be loaded after codec creation. 28/23028/2
Tony Tkacik [Fri, 19 Jun 2015 09:29:40 +0000 (11:29 +0200)]
Bug 3821 - Augmentation codecs may be loaded after codec creation.

In some scenarios - where schema context already contained
schema for introduced augmentation, but class was not known
at time codec creation was triggered - codec for augmenation
was not created and any subsequent uses of codec (class is
already known) failed with IncorrectNestingException.

This patch introduces

  - new exception MissingClassInLoadingStrategy
    which is subclass used by MD-SAL to retry after context update
    or timeout
  - supports loading of  augmentation codec after parent codec
    was created and augmentation is part of schema codec

Change-Id: If85f8e2be614a139947abc5daaa1e141b3c9b22c
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
(cherry picked from commit acf8e80b0747bd0aa724e978288bb83f6ca338ad)

8 years agoBug3659: UnknownSchemaNodeImpl retains empty ArrayLists FIX 53/22353/5
Martin Ciglan [Thu, 11 Jun 2015 11:55:22 +0000 (13:55 +0200)]
Bug3659: UnknownSchemaNodeImpl retains empty ArrayLists FIX

Change-Id: I291eb3f87a3bc1655d0966513e1c74154558cbce
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
8 years agoRemove deprecated YangInstanceIdentifier methods 45/22545/4
Robert Varga [Sun, 14 Jun 2015 08:58:46 +0000 (10:58 +0200)]
Remove deprecated YangInstanceIdentifier methods

this patch removes the internal bridge methods to Iterable path
arguments as well as the long-deprecated getPath() method.

Change-Id: I28168741a5ad852a108b1aa6f711d44bc4748b6a
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoTypeDefinition is a generic type 74/22874/2
Robert Varga [Thu, 11 Jun 2015 11:15:54 +0000 (13:15 +0200)]
TypeDefinition is a generic type

Do not use it in raw format, eliminating warnings.

Change-Id: I6012f812ce7a5aba75f163a8910fb0583fefd6cc
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 35e731b1818688f2aee43f525873087aca25110e)

8 years agoBUG-3793 71/22871/1
Shaleen Saxena [Wed, 17 Jun 2015 22:16:22 +0000 (15:16 -0700)]
BUG-3793
Manually patching in changes from Bug 2291 as it does not cherry-pick cleanly.

Change-Id: I17f1c2347d7aa3a120fac0171253e88c46e99fae
Signed-off-by: Shaleen Saxena <ssaxena@brocade.com>
(cherry picked from commit 9e4ce88404e59aed92fdf8d4242587720d8650ab)

8 years agoBug 3645 - instance-identifier parsing error 93/22693/2
Jan Hajnar [Tue, 16 Jun 2015 07:14:40 +0000 (09:14 +0200)]
Bug 3645 - instance-identifier parsing error

* added method deserializeKeyValue in AbstractStringInstanceIdentifierCodec
* added implementations for deserializeKeyValue for XML and JSON codecs

Change-Id: I97f68534d4ecc7b0cbb8e67ba899c9b4bfe91650
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
(cherry picked from commit 0c092cbca774271a87578432212fb398f61543a4)

8 years agoBug 2583 - illegal escape character if generated files 93/14193/9
Peter Kajsa [Fri, 16 Jan 2015 12:48:44 +0000 (13:48 +0100)]
Bug 2583 - illegal escape character if generated files

When a module file name starts with 'u' character, YangTools generates
comments in file containing '\u...' character sequences which java compiler
interprets as illegal escape character.
Problem is related most probably to windows builds only.

Change-Id: I81329b754710a68ada4e9c034c8980a1acd8a1b7
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoBug 3191: Optimisation of serialisation of IdentityrefTypeDefinition 72/22272/2
Maros Marsalek [Tue, 9 Jun 2015 14:16:30 +0000 (16:16 +0200)]
Bug 3191: Optimisation of serialisation of IdentityrefTypeDefinition

Workaround for the case when prefix and namespace within element
and its value is same as parent namespace.

Change-Id: I1c8f8b503dc38385aa8cd23a517e067531081661
Signed-off-by: Marian Dubai <mdubai@cisco.com>
Signed-off-by: Tomas Cere <tcere@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBug 2721: StackOverflowError for leafref FIX 98/22698/2
Martin Ciglan [Tue, 16 Jun 2015 14:12:51 +0000 (16:12 +0200)]
Bug 2721: StackOverflowError for leafref FIX

Leafref XPath needs to be checked whether it references itself
in order to detect incoming StackOverflowError
and throw appropriate exception if necessary.

Change-Id: Iacfa1a9f9d85f947e590b1d6412c9c482b417dbf
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
8 years agoSonar: remove unused modifiers 23/22723/1
Robert Varga [Tue, 16 Jun 2015 18:59:27 +0000 (20:59 +0200)]
Sonar: remove unused modifiers

public/static/final modifies are implied by the context, e.g. by being
declared in an interface.

Change-Id: Ic2f97172595d7cdb2119510c077eabac55fa0798
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoIntroduce MapAdaptor.initialSnapshot() 67/22667/2
Robert Varga [Mon, 15 Jun 2015 22:28:54 +0000 (00:28 +0200)]
Introduce MapAdaptor.initialSnapshot()

In some circumstances we have an idea about how many entries will there
be in a map. This could cost us perform one additional copy, so expose a
method to create the appropriate map, behaving just as the one returned
by takeSnapshot(Collections.emptyMap()).

Also use ImmutableMaps for empty map, as it being immutable is recognized
by Guava, leading to quick reuse.

Change-Id: I40925e5d643c074277e9d11365a3b10fb9f22c1d
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 92fc5cc4436a65c3a63e1fc7afbff2ac42a70880)

8 years agoBUG-1014: TreeType should be Beta 66/22666/1
Robert Varga [Mon, 15 Jun 2015 23:25:03 +0000 (01:25 +0200)]
BUG-1014: TreeType should be Beta

It is not a finalized concept yet, so users should we vary before
relying on it.

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

8 years agoUse sizeHints in ImmutableNode builders 02/22602/1
Robert Varga [Fri, 12 Jun 2015 01:09:13 +0000 (03:09 +0200)]
Use sizeHints in ImmutableNode builders

Instead of ignoring the size hint, use it.

Change-Id: I516fbb2a8c18bb6276b5863292f8b0e956ceb6da
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 43a86587a3fa6402a4eee19ecffb119b178994f5)

8 years agoBug 1014 - Non-configuration items in the model appear in the config 01/22601/1
Jan Hajnar [Thu, 14 May 2015 12:30:49 +0000 (14:30 +0200)]
Bug 1014 - Non-configuration items in the model appear in the config
namespace

* added TreeType enum for tree type identification
* modified factory methods and constructor for InMemoryDataTree
* Modified factory of SchemaApplyOperation to filter subtree by tree type
* reworked verifyStructure() to recursivelly walk data tree
* added tests for config statement check

Change-Id: I3f4ebe84e4387965ff43714a1f45f75c738d4475
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
(cherry picked from commit 54271a74d07bfd0b4b7e9ed2a061a3ceb23b12f6)

8 years agoIntroduce YangInstanceIdentifier.toOptimized() 00/22600/1
Robert Varga [Sun, 14 Jun 2015 09:12:29 +0000 (11:12 +0200)]
Introduce YangInstanceIdentifier.toOptimized()

Users often need to retain a YangInstanceIdentifier for use in either
addressing the same element in the data tree, or to create child
instance identifiers. Create a new method, toOptimized(), which returns
an equivalent FixedYangInstanceIdentifier instance.

Change-Id: I057db1d539520195cd38c1bfc77a8be1384108e2
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 696e5e72e58b1e227b509c8307ddddf9f70beecf)

8 years agoRemove use of deprecated parser method 99/22599/1
Robert Varga [Fri, 12 Jun 2015 17:04:39 +0000 (19:04 +0200)]
Remove use of deprecated parser method

This simplifies SchemaContext construction in test.

Change-Id: I784075dd28a36aae9e679abbdb8370d9ea415388
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 51cea429d220de41d4383e789512043b2bad1707)

8 years agoLower the size of ModifiedNode children maps 98/22598/1
Robert Varga [Fri, 12 Jun 2015 01:17:20 +0000 (03:17 +0200)]
Lower the size of ModifiedNode children maps

This lowers the default allocation of 16 to 8, hopefully lowering memory
pressure.

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

8 years agoUse an ImmutableMap for empty case 97/22597/1
Robert Varga [Thu, 11 Jun 2015 22:25:34 +0000 (00:25 +0200)]
Use an ImmutableMap for empty case

Instead of using Collections.emptyMap(), use ImmutableMap.of(). This
will result in an immutable map, taking the immutable shortcut in the
previous check.

Change-Id: I83a58b0dcd5f075d0ac7a7b5073b801ce8a47d08
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 03add667832ab33d50eabd046d5c9a93c75a62ab)

8 years agoBUG-2402: introduce CloneableChildrenMap 96/22596/1
Robert Varga [Thu, 11 Jun 2015 20:28:38 +0000 (22:28 +0200)]
BUG-2402: introduce CloneableChildrenMap

This exposes the appropriate interface to create a copy of the
underlying map in the most efficient manner. Makes
AbstractImmutableDataContainerNodeBuilder check for presence of the
interface and use it to create an efficient copy.

Change-Id: I8ad8159076fa199f315857e339fc83363ce73289
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 05442d7e5fb59112453c5096851f2cd0a2b26a7f)

8 years agoCleanup NodeIdentifierWithPredicates references 95/22595/1
Robert Varga [Thu, 11 Jun 2015 21:05:01 +0000 (23:05 +0200)]
Cleanup NodeIdentifierWithPredicates references

Import NodeIdentifierWithPredicates directly, so we do not have to
qualify it with YangInstanceIdentifier.

Change-Id: Ibfaf62bf808b683bae57b120749db23fed3683eb
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 032463a27c486136db139d000f472c981e0633cf)

8 years agoMake methods static 94/22594/1
Robert Varga [Thu, 11 Jun 2015 10:40:28 +0000 (12:40 +0200)]
Make methods static

All these can be made static, so improve their efficiency.

Change-Id: Ie6aa238eab7fef728dd22af12a64a155a9db776e
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 12beaed7c9f1953562f79ef9699273d0ea53926c)

8 years agoMake BaseYangTypes.TYPE_MAP immutable 93/22593/1
Robert Varga [Thu, 11 Jun 2015 10:32:44 +0000 (12:32 +0200)]
Make BaseYangTypes.TYPE_MAP immutable

The lookup map is expected to be immutable.

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

8 years agoImprove stored map memory efficiency 92/22592/1
Robert Varga [Wed, 10 Jun 2015 09:25:01 +0000 (11:25 +0200)]
Improve stored map memory efficiency

When we deal with small maps, we can improve our memory efficiency by
turning it into an ImmutableMap instead of wrapping it in another
instance.

For 1M fake BGP routes, this lowers the memory footprint by ~300MB,
which is about 10%.

Change-Id: I7fbac729f635ea089ac144e8a264df884d94c512
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 877489ac0ab40d8a0d71fe041f9c8ea66a7e3446)

8 years agoThrow an exception from private constructor 91/22591/1
Robert Varga [Tue, 9 Jun 2015 22:58:12 +0000 (00:58 +0200)]
Throw an exception from private constructor

This is a utility class, it should never be instantiated.

Change-Id: Ic2edd90d0cf084a3a38e5a6c068172b9d774799e
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 2e0878d894f821db411c87f2ffff094e9b32b5ee)

8 years agoBug 3336 - Binding DTOs: fix binary-derived constructor 90/22590/1
Jan Hajnar [Mon, 1 Jun 2015 14:40:16 +0000 (16:40 +0200)]
Bug 3336 - Binding DTOs: fix binary-derived constructor

* added condition to only check for null in value assignmet if class has
one property (because then CheckNull is generated before assgnment)

Change-Id: I3bd18ec60347b3d1d5dec32e7bcafa432c56b5ad
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
(cherry picked from commit 0c58b4c45c1caedd1e3ecdfa056c0c4f98185c63)

8 years agoBug 3669 - ietf-restconf binding is incomplete 72/22572/3
Peter Kajsa [Mon, 15 Jun 2015 09:36:29 +0000 (11:36 +0200)]
Bug 3669 - ietf-restconf binding is incomplete

- added implementation of ModuleRevisionBuilder.java

Change-Id: If50041c1b0befcb5fb8678cf95f915ef4b079bfb
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoProvide better error messages when parsing JSON. 67/20167/6
Colin Dixon [Fri, 10 Apr 2015 00:36:49 +0000 (20:36 -0400)]
Provide better error messages when parsing JSON.

Change-Id: Ia3a613964ce74a6179a568098b83f9d3755fb9a4
Signed-off-by: Colin Dixon <colin@colindixon.com>
8 years agoBUG-3674: delete of non-existing data is a no-op 64/22564/1
Robert Varga [Fri, 12 Jun 2015 13:59:56 +0000 (15:59 +0200)]
BUG-3674: delete of non-existing data is a no-op

As noted in the comments, a delete on non-existing data is a no-op. That
means the user should see an UNMODIFIED modification, not a DELETE.

Change-Id: Ic9f79b99eefa352549b363c4754566da66ed0d55
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 130683fbb867372bfa1a1d63fd491b182081aa1b)

8 years agoBug 3687 - StreamWriterGenerator emits UNKNOWN_SIZE 64/22464/2
Tony Tkacik [Fri, 12 Jun 2015 10:28:04 +0000 (12:28 +0200)]
Bug 3687 - StreamWriterGenerator emits UNKNOWN_SIZE

StreamWriterGenerator always emitted sizing hint
for fully-completed data and sometimes even
counting all availble augmentations, which actually
lead-up to larger sizes of collections then needed.

Fix changes the SIZE HINT for "constant" max-sized
types (containers, augmentations, list entries)
to -1 so underlaying implementation could size
them based on actual data.

Change-Id: Ibd446f71c4b066f4dab4a7d73b1bc851d9e62c99
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit b6fdf49d349662ffa82ae6477f99bac405799a3f)

8 years agoFix inefficient String buffering 29/22029/3
Robert Varga [Sat, 6 Jun 2015 13:57:12 +0000 (15:57 +0200)]
Fix inefficient String buffering

Instead of using string concatenation before adding to stribuilder, add
the componets directly.

Change-Id: Ibbd9131f1a1ec5df5f32c84e86c140e52c5ec84d
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoFix sonar warnings 28/22028/3
Robert Varga [Sat, 6 Jun 2015 13:53:10 +0000 (15:53 +0200)]
Fix sonar warnings

Declaring specific implementation class is a no-no, fix that up.

Change-Id: I55f6048fc737046ffd08518eddc0419ee61b276a
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoMake methods static 27/22027/3
Robert Varga [Sat, 6 Jun 2015 13:34:44 +0000 (15:34 +0200)]
Make methods static

These methods can be made static, make them such. Also fix raw types.

Change-Id: I4b697026857aae8579f0545e7e1284a7b8d00d04
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-3641: cache hashCode value 33/22333/1
Robert Varga [Tue, 9 Jun 2015 23:09:51 +0000 (01:09 +0200)]
BUG-3641: cache hashCode value

Builder-derived classes can be used as HashMap keys, which means they
can see their hashcode computed multiple times. Since this is a
recursive operation, the cost of it can be quite high, so dedicate two
fields for caching the hashcode result.

Change-Id: I0d95fd94187a421e4018b2f6992dfeaf2e126732
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 0158f45b9078cdb867d3ce3c44a4ed4746f311fe)

8 years agoBug 1485: Invoke lengthCheck only on non-null object. 73/22273/1
Tony Tkacik [Tue, 9 Jun 2015 12:59:25 +0000 (14:59 +0200)]
Bug 1485: Invoke lengthCheck only on non-null object.

Change-Id: Iec3cf2fe08fbdac4e5139acab7865cd4c4b6224f
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
(cherry picked from commit 8dfd02dec37d796ce7a51866416675b021e85b7c)

8 years agoBUG-706 Ignore anyxml nodes in binding serializer 67/22167/2
Maros Marsalek [Mon, 8 Jun 2015 12:39:02 +0000 (14:39 +0200)]
BUG-706 Ignore anyxml nodes in binding serializer

AnyXml is not supported on that level and currently leads to null pointer ex.

Change-Id: I5c2a64ab9502e4bba02efd822d2b5294ef456cef
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
(cherry picked from commit 8c4ddc66b0b1ef31a65b8cabf55173a16615bab2)

8 years agoBUG-3051: Fix error reporting string 57/22157/3
Robert Varga [Mon, 8 Jun 2015 16:43:05 +0000 (18:43 +0200)]
BUG-3051: Fix error reporting string

The exception thrown does not accurately describe what has happened. Be
more user-friendly and report the exact pattern which failed to match.

Change-Id: I0818c92c4a8cdf8c180234635c1efe059ff1c4e2
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 3680886f73ef87fb2818c57b12d3bc76525c3669)

8 years agoBUG-1485: convert BuilderTemplate to use LengthGenerator 56/22156/3
Robert Varga [Sun, 31 May 2015 17:51:43 +0000 (19:51 +0200)]
BUG-1485: convert BuilderTemplate to use LengthGenerator

This converts BuilderTemplate to use the LengthGenerator class as
appropriate, speeding operations up. Also removes caching fields.

Change-Id: I1a0bfc56df8ab36880ae8e14c111cb9aca68c626
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 7998081d8e1761bf4798c1642e8e6107fc4666fc)

8 years agoBUG-1485: Switch ClassTemplate length checker 55/22155/3
Robert Varga [Sun, 31 May 2015 12:05:02 +0000 (14:05 +0200)]
BUG-1485: Switch ClassTemplate length checker

Switch ClassTemplate to use LengthGenerator. Also removes the static field
used to hold ranges, as that is only used by deprecated length() method.

Change-Id: I2a084a71d21c8c63a2d9733fc767aa7ecd3cff67
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 65cf5ea01d87cbe65633a8e13fcbb6713e334ec2)

8 years agoBUG-1485: Create LengthGenerator 64/22164/2
Robert Varga [Sun, 31 May 2015 11:33:03 +0000 (13:33 +0200)]
BUG-1485: Create LengthGenerator

LengthGenerator is akin to AbstractRangeGenerator, only simpler. Since
the type of the checked property can only be an integer, we can live
without subclasses. One weirdness is that it needs to support both
String and byte[] fields, but that is easily catered with two distinct
methods.

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

8 years agoIntroduce NormalizedNodes.findDuplicates() 54/22154/1
Robert Varga [Tue, 2 Jun 2015 08:29:20 +0000 (10:29 +0200)]
Introduce NormalizedNodes.findDuplicates()

This is an analytics utility method to find duplicate entries within a
NormalizedNode subtree.

Change-Id: Iedb3c9f71848c546f6e303b66e3f129b5f4da54f
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 6397b5c1773f5ea825e592a0c27259b5e8631c06)

8 years agoBug 3224 - Parsing data with choice in case via augmentation results in 75/21975/2
Jan Hajnar [Thu, 7 May 2015 15:09:37 +0000 (17:09 +0200)]
Bug 3224 - Parsing data with choice in case via augmentation results in
incorrect parsing

* added tests for multiple choices from augmentation parsing
for json, xml and bindinging aware context
* modified json parsing tests
* fixed choice augmentation resolution in ChoiceNodeCodecContext
and CompositeNodeDataWithSchema
* moved findCorrespondingAugment to SchemaUtils since it is useful for
multiple Classes
* replaced getNodeIdentifierForAugmentation code in SchemaUtils  with
the one from CompositeNodeDataWithSchema.

Change-Id: Ibf57a771b92de14ecb70dcbbe250d7c559066882
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
(cherry picked from commit a8f512b80e661dac1ff85db6c16c72bfbf7f5891)

8 years agoBug 3325 - RPC returns 500. 74/21974/2
Jan Hajnar [Fri, 22 May 2015 11:02:03 +0000 (13:02 +0200)]
Bug 3325 - RPC returns 500.

* added original schema node resolution to getBaseTypeForLeafRef method
(we need to resolve leafref nodes added by grouping  according
to original module)

Change-Id: I80bf350cc442e966986c57ab2a352939a9f687a9
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
(cherry picked from commit dfdb6ad916fe5d9f5ad7b36858e85a6db3ac75c4)

9 years agoAdd a quick identity check for map comparison 72/21972/3
Robert Varga [Wed, 3 Jun 2015 13:14:06 +0000 (15:14 +0200)]
Add a quick identity check for map comparison

This should speed up the case of copied values. Also add a TODO for
future improvement.

Change-Id: Ie5122bd9b4941f05b6a94d30ecacbaab8dab2923
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 9f42a2bded6bb3ac541ce37fcf07598659a87f03)

9 years agoInvoke equals() on a constant reference 71/21971/3
Robert Varga [Thu, 28 May 2015 14:54:54 +0000 (16:54 +0200)]
Invoke equals() on a constant reference

Inverting how we perform the equality check makes it obvious that the
invoked method is bound to a specific class object, helping compiler
just a tiny bit.

Change-Id: Ia8209f50143b0c3af71a962ab2a3ab167396836f
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 1e51b859a08cfdda436fb12d0cf55dd89f00213b)

9 years agoBUG-1485: remove holder for deprecated Class ranges 70/21970/2
Robert Varga [Thu, 28 May 2015 20:34:01 +0000 (22:34 +0200)]
BUG-1485: remove holder for deprecated Class ranges

With the switchover to new range checks, the static caching field is not
needed. We still retain compatibility with possible users out there, but
they are now responsible for caching the result.

Change-Id: I119615255559263f98fc382b324026c4f5d35cfc
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 924235feb5540c5a453c522e85d13fbd1d140c5a)

9 years agoBUG-1485: remove holder for deprecated Builder field ranges 69/21969/2
Robert Varga [Thu, 28 May 2015 20:05:51 +0000 (22:05 +0200)]
BUG-1485: remove holder for deprecated Builder field ranges

Caching the result was important as long as ranges were used internally,
now that they are not, do not retain them and re-generate them on each
call. Any callers out there are now responsible for caching them
themselves.

Change-Id: Idcba7fe54c59e33d6eedb6b596a2bf4f4a5ca10c
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 8d510398ba320a17ba932d27b98423e8bcad1a10)