yangtools.git
7 years agoBug-6195: Fix issue with leafSetEntryNode in SchemaTracker 75/41875/3
Ajay [Fri, 15 Jul 2016 06:37:23 +0000 (06:37 +0000)]
Bug-6195: Fix issue with leafSetEntryNode in SchemaTracker

Changed SchemaTracker:leafSetEntryNode so that if LeafSetEntryNode
is present without it's parent LeafEntryNode in data-change notification,
it's serialization is handled properly.  The existing leafSetEntryNode
functionality is kept around for API compatability reasons, but should
be removed in Boron as stated in the FIXME.

Change-Id: I6cf936752588c671268d11a0c277ccccd806e086
Signed-off-by: Ajay <ajayl.bro@gmail.com>
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
7 years agoBug 6173: Allow refine statement to have no substatements 80/41880/1
Vratko Polak [Tue, 12 Jul 2016 10:44:40 +0000 (12:44 +0200)]
Bug 6173: Allow refine statement to have no substatements

Change-Id: I2c281b8feb10fe25f67ec81de49bd0fbc69c7f45
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
7 years agoAdd a couple of toString() implementations 31/40231/1
Stephen Kitt [Thu, 7 Apr 2016 09:33:09 +0000 (11:33 +0200)]
Add a couple of toString() implementations

These are useful when debugging DataTreeChangeListener conversions.

Change-Id: Ie83bb72b9cd3b3461f758965a673f231755084cb
Signed-off-by: Stephen Kitt <skitt@redhat.com>
(cherry picked from commit 1057e76d8a8a17b0103ee437b6d7d9ba5ba9ca77)

7 years agoBug 5830: Mandatory leaf enforcement is not correct with presence container 42/39942/2
Peter Kajsa [Fri, 20 May 2016 07:46:37 +0000 (09:46 +0200)]
Bug 5830: Mandatory leaf enforcement is not correct with presence container

Some operations (e.g. write of MapEnryNode) don't invoke any method on
PresenceContainerModificationStrategy in order to enforce presence of mandatory nodes.
This fix ensures invoking of MandatoryLeafEnforcer of PresenceContainerModificationStrategy
when verifyStructure method is performed.

Change-Id: I6f5900f555e8f94916a84b747fbd895592606f38
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit dfb9d8c251fc77e434abf46083c3d13dd8c20917)

7 years agoSpeed up toString() for XML elements 08/39608/1
Robert Varga [Mon, 30 May 2016 14:28:27 +0000 (16:28 +0200)]
Speed up toString() for XML elements

Instantiating TransformerFactories is wasteful, use a shared instance.

Change-Id: I595df4553b617875abdb78ba08401fa84ba156bc
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 5200: Yang parser doesn't fill error-app-tag and error-message in constraints 85/39385/2
Peter Kajsa [Thu, 5 May 2016 15:24:26 +0000 (17:24 +0200)]
Bug 5200: Yang parser doesn't fill error-app-tag and error-message in constraints

Length, Pattern, Range statements may contain error-app-tag and error-message
substatements, but yang parser does not fill them correctly when corresponding
constraint objects are created. Instead yang parser always constructs constant formatted
message.

Change-Id: I69edb1fa49bcd50098f247df851c839c2f871782
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoBug 5899: Cardinality check incorrectly limited to 1 for "must" 71/39171/2
Filip Gregor [Thu, 19 May 2016 11:54:45 +0000 (13:54 +0200)]
Bug 5899: Cardinality check incorrectly limited to 1 for "must"

updated cardinality for must statement in
refine statement, added test

Change-Id: I3c31cc902d05a87259970a856a8f0e7efc20c67c
Signed-off-by: Filip Gregor <fgregor@cisco.com>
7 years agoBug 5693: IOException after first parsing phase - stream closed 04/38004/6
Ivan Hrasko [Mon, 11 Apr 2016 07:21:07 +0000 (09:21 +0200)]
Bug 5693: IOException after first parsing phase - stream closed

Solved by creating new stream for every parsing phase and resetting
original stream.

Change-Id: I12c45e5f3c92c17ce5f07f98a551b288245698bb
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 years agoBug 5819 - Violation of synchronization rules in AbstractSchemaRepository 14/38914/1
Alexis de Talhouët [Fri, 29 Apr 2016 11:54:00 +0000 (07:54 -0400)]
Bug 5819 - Violation of synchronization rules in AbstractSchemaRepository

As noted by @GuardedBy annotation, access to sources field need to be
performed while holding the object monitor. Refactor getSchemaSource()
to create a copy under lock and then release it for further processing.

Change-Id: I65fddf5830e657c3601c85fd976f12e3c8bb3ff6
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
Signed-off-by: Robert Varga <nite@hq.sk>
(cherry picked from commit 36bdb3a032d4924b36dc86d782e58043954adadc)

7 years agoDo not advertize features-test in artifacts 51/36551/4
Vratko Polak [Tue, 22 Mar 2016 11:51:58 +0000 (12:51 +0100)]
Do not advertize features-test in artifacts

Features-test was moved to odlparent.
Advertizing it in yangtools artifacts makes jdepend-maven-plugin
throw a warning when building mdsal project.

Change-Id: I59f3191e9684b53d746fbde324ce9309248beb89
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
7 years agoBug 5446: Yangtools UnionStringCodec is not consistent with BinaryStringCodec 53/38853/3
Peter Kajsa [Wed, 11 May 2016 09:04:39 +0000 (11:04 +0200)]
Bug 5446: Yangtools UnionStringCodec is not consistent with BinaryStringCodec

Yangtools union codec serializes byte array via invoking of toString() method
on byte[] which leads to undesirable results.

Change-Id: Ib5c8efb1b28cf7f8e51d9791dd4a30078ebbd6bd
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoBug 5484: Fix of Yang statement lexer 19/38219/3
Peter Kajsa [Tue, 26 Apr 2016 08:43:40 +0000 (10:43 +0200)]
Bug 5484: Fix of Yang statement lexer

Fix of Yang statement lexer to support statement arguments which
contain characters like '=' | '[' | ']' | '+' and which
are not enclosed in quotes or double quotes.

Change-Id: I6d9ba953985eca5018f196cfd16fc11ae5986876
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
(cherry picked from commit 2bb2f1cc8cea334dbe2806dbd919bc810fcba32a)

7 years agoBumping versions by 0.0.1 for next dev cycle 87/38687/1
Thanh Ha [Wed, 11 May 2016 22:05:53 +0000 (18:05 -0400)]
Bumping versions by 0.0.1 for next dev cycle

Change-Id: I69f9f24cdf359ac41525219278c7572432985f50
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
7 years agoRelease Beryllium-SR2 86/38686/1 release/beryllium-sr2
Thanh Ha [Wed, 11 May 2016 22:05:52 +0000 (18:05 -0400)]
Release Beryllium-SR2

Change-Id: Ic10de415279f53e3191a89abb2af0322b5b1c57f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoAdd test scope for junit 83/36883/2
Thanh Ha [Mon, 14 Mar 2016 21:42:59 +0000 (17:42 -0400)]
Add test scope for junit

Change-Id: I35fbf975623e84f44c9477f226a31e9fda2bc780
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBug 5567 NPE - invoking of equals on nullable element 03/36503/2
Martin Sunal [Mon, 21 Mar 2016 13:12:21 +0000 (14:12 +0100)]
Bug 5567 NPE - invoking of equals on nullable element

Change-Id: I51b757b0bf03f3f2cf5862e3624936f961cd5d87
Signed-off-by: Martin Sunal <msunal@cisco.com>
8 years agoBug 5531: Can't get complete YIN schema on Windows 71/36871/1
Ivan Hrasko [Tue, 29 Mar 2016 14:26:06 +0000 (16:26 +0200)]
Bug 5531: Can't get complete YIN schema on Windows

Solved by flushing xml writer when module is completely written to YIN.

Change-Id: I7161ddf602602815eedcb0857af745e33c2ed16d
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
(cherry picked from commit 4e5f308735a1128bbb63554c56413f387034e490)

8 years agoBUG-5504: use Object.toString() without overrides in precondition 90/36290/2
Robert Varga [Wed, 16 Mar 2016 12:57:17 +0000 (13:57 +0100)]
BUG-5504: use Object.toString() without overrides in precondition

The precondition check could end up using a lot of memory due to dump of the
data tree. Implement a simpler version and use that in the message.

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

8 years agoRevert "Bug 5504 - Controller crashes with OOM. oldRoot/currentRoot, toString()" 89/36289/2
Robert Varga [Wed, 16 Mar 2016 13:00:52 +0000 (14:00 +0100)]
Revert "Bug 5504 - Controller crashes with OOM. oldRoot/currentRoot, toString()"

This reverts commit 9703cf5d2ce0323e0e776dec4311f677ddcd2f00.

Change-Id: I4b33e70154de6eb62ed788a1cda0321cc57f84dd
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 5396: Regex processing of yang models is broken. 89/36589/3
Peter Kajsa [Tue, 22 Mar 2016 17:39:20 +0000 (18:39 +0100)]
Bug 5396: Regex processing of yang models is broken.

Yang statement parser should not replace type statement context by potentional
type statement context from the Map of context's substatements.

Change-Id: I9fa90f53bf8d7f9ebb269628abadeab1bf4c03b5
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoBug 5550 - Omit the check of mandatory nodes in uses-augment 24/36424/2
Peter Kajsa [Fri, 18 Mar 2016 07:26:04 +0000 (08:26 +0100)]
Bug 5550 - Omit the check of mandatory nodes in uses-augment

Yang statement parser should omit check of mandatory nodes in uses-augment.

Change-Id: If6d02bf7013717dbe039b214cae69bf177aa073b
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoBumping versions by 0.0.1 for next dev cycle 79/36579/1
Thanh Ha [Wed, 23 Mar 2016 03:14:16 +0000 (23:14 -0400)]
Bumping versions by 0.0.1 for next dev cycle

Change-Id: I1a78051cf72533664e1c242bf2a31e0a92540980
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoRelease Beryllium-SR1 78/36578/1 release/beryllium-sr1
Thanh Ha [Wed, 23 Mar 2016 03:14:15 +0000 (23:14 -0400)]
Release Beryllium-SR1

Change-Id: If6aa7e8e6f8b5f08aa8b2db3e9a349efc25df384
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBug 5504 - Controller crashes with OOM. oldRoot/currentRoot, toString() 48/36148/2
Tom Pantelis [Sat, 12 Mar 2016 04:14:33 +0000 (23:14 -0500)]
Bug 5504 - Controller crashes with OOM. oldRoot/currentRoot, toString()

Change-Id: I4588be0f85eea83989880b75a659b619db7255c8
Signed-off-by: Anil Vishnoi <vishnoianil@gmail.com>
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 5481: When condition of augment added in constraints of augment target 60/36060/1
Peter Kajsa [Wed, 9 Mar 2016 17:22:46 +0000 (18:22 +0100)]
Bug 5481: When condition of augment added in constraints of augment target

The patch excludes When, Status, Description and Reference statements
from copying of top augment's nodes.

Change-Id: I72bf65aba09e43799ac619cd4de9ed03230ad071
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoBug 5345: Unable to use get-schema RPC due to unsafe class casting 91/35991/2
Martin Ciglan [Wed, 9 Mar 2016 13:44:08 +0000 (14:44 +0100)]
Bug 5345: Unable to use get-schema RPC due to unsafe class casting

This patch represents class cast fix for Beryllium SR1 code base only
due to using of deprecated structures.

Change-Id: I1f1f46f35401a8b4310e16345b1e8419c66f3f35
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
8 years agoBug 5335: augmenting a mandatory node on a presence container 85/35985/1
Peter Kajsa [Thu, 3 Mar 2016 13:46:34 +0000 (14:46 +0100)]
Bug 5335: augmenting a mandatory node on a presence container

Yang parser didn't perform cross module augmentation of mandatory
node on a presence container which belongs to the same module.
RFC6020 section 3.1 considers a presence container as not mandatory
node, therefore such augmentation should be allowed.

Change-Id: I61f45519db3536ab377fdf2987b083806a3aa51e
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoBug 5437: Issue accessing mounted device supporting OpenConfig BGP. 01/35601/1
Peter Kajsa [Tue, 1 Mar 2016 09:52:16 +0000 (10:52 +0100)]
Bug 5437: Issue accessing mounted device supporting OpenConfig BGP.

Yangtools evaluated a relative path of leafref in the incorrect context.
Relative path of leafref should be evaluated in the final context of leafref node.

Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Change-Id: I24821d1b12d4456058e0ec1049542972fe29b903

8 years agoBumping versions by 0.0.1 for next dev cycle 32/34932/1
Thanh Ha [Thu, 18 Feb 2016 19:54:28 +0000 (14:54 -0500)]
Bumping versions by 0.0.1 for next dev cycle

Change-Id: Ib56c1134b82be607c1988480797b712a4ddf18f3
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoRelease Beryllium 31/34931/1 release/beryllium
Thanh Ha [Thu, 18 Feb 2016 19:54:26 +0000 (14:54 -0500)]
Release Beryllium

Change-Id: I140fb4f1d27a9fae2c03ff3273dd640203405b04
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoEnable site generation for yangtools 99/34099/2
Thanh Ha [Wed, 30 Sep 2015 22:20:11 +0000 (18:20 -0400)]
Enable site generation for yangtools

See:
https://nexus.opendaylight.org/content/sites/site/org.opendaylight.releng.builder/master/maven-site.html

Change-Id: Id48968286fdbfb1e5f17331a9dced3a92d8af078
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 24/34424/2
Jakub Toth [Fri, 5 Feb 2016 16:02:14 +0000 (17:02 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

test XmlDocumentUtilsTest

Change-Id: I8d4958b048e1bf392182b409d4998429712781b6
Signed-off-by: Jakub Toth <jatoth@cisco.com>
(cherry picked from commit a3f2b690663731627b1d93a41cb447d93a60ba5f)

8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 97/34397/1
Jakub Toth [Mon, 8 Feb 2016 15:08:11 +0000 (16:08 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

test InstanceIdentifierForXmlCodecTest

Change-Id: I3dc7f58309ae900825a10d5ea0a878cf037c24e5
Signed-off-by: Jakub Toth <jatoth@cisco.com>
(cherry picked from commit 5b4fa9654c9013694ab57b404f0798411fdbabc4)

8 years agoBug 4079: Unable to compile pattern defined in module 88/34388/2
Igor Foltin [Wed, 10 Feb 2016 11:09:12 +0000 (12:09 +0100)]
Bug 4079: Unable to compile pattern defined in module
          when using Unicode blocks

The original patch for this bug fixed the problem
only in the old yang parser.

This patch fixes the issue in the new yang parser.

Change-Id: I07c7ad8d00ab0f8f39888afd1468054e74574cb4
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
(cherry picked from commit ee7500aa1604b3c654511d9f41de8281957101a8)

8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 79/34379/1
Jakub Toth [Tue, 9 Feb 2016 13:51:34 +0000 (14:51 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

test RefcountedRegistrationTest

Change-Id: Ie3053de3422ec5ffe4bb8ae7e7bf23b147ac4a4d
Signed-off-by: Jakub Toth <jatoth@cisco.com>
(cherry picked from commit 79a6c2ebfeeb92665ae217a9b7423da3ef92b19e)

8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 18/34318/1
Igor Foltin [Tue, 9 Feb 2016 10:52:34 +0000 (11:52 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

Added unit test for StringPatternCheckingCodec.

Change-Id: I95883efa82d0e987fa0b5b6e507513e105aca267
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years agoBUG-2646: downgrade warnings to debug 27/34127/2
Robert Varga [Fri, 5 Feb 2016 08:51:04 +0000 (09:51 +0100)]
BUG-2646: downgrade warnings to debug

Stop flooding logs with warnings until we find an acceptable solution
for adding augmentations and refines to unknown extensions.

Change-Id: I74a942347690cecc94c4022d7c0a1e397a042d5a
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 19/34219/1
Igor Foltin [Fri, 5 Feb 2016 12:58:34 +0000 (13:58 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

Added unit tests for data tree operations with ordered list

Change-Id: I82314d98fbb04ad336de9e7a15a433ab78454180
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
(cherry picked from commit 983564537028ce789007fdbf1a5540646a355e3f)

8 years agoFix javadoc formatting issues 61/34061/1
Thanh Ha [Thu, 4 Feb 2016 02:30:26 +0000 (21:30 -0500)]
Fix javadoc formatting issues

- Fix javadoc '<' and '>' to &lt; and &gt; escape characters
- Add missing @throws

Change-Id: Idcbc8217f931de655e38687df6a89cc94b346cb2
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
(cherry picked from commit 63391074baa84256f2e66fcef0ce02a686a960ea)

8 years agoBug 5101: Status deprecated must not be propagated via uses statement 10/33810/1
Peter Kajsa [Fri, 29 Jan 2016 12:35:40 +0000 (13:35 +0100)]
Bug 5101: Status deprecated must not be propagated via uses statement

Status of grouping statement is not propagated via uses statement.

Change-Id: I2c2bf9d9222ea1be78b440c5c52ea675dcaeb89d
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
(cherry picked from commit 660b3a15a0da5e2212e64f35edfdd3444d145050)

8 years agoBug 5059: Do not fail when 'refine' targets an extension. 20/33720/2
Peter Kajsa [Tue, 26 Jan 2016 14:13:23 +0000 (15:13 +0100)]
Bug 5059: Do not fail when 'refine' targets an extension.

Yang parser does not fail when 'refine' targets an extension, but
the parser logs a warning and the refine statement is ignored.

Change-Id: I9a4ad46ac254c36b64b44903162361c1e14f4e71
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
(cherry picked from commit d20d90de04fa676f96d117d827fe284370fdc3d9)

8 years agoBug 5019: Add QName param to NormalizedNodeWriter#leafSetEntryNode 11/33611/2
Tom Pantelis [Thu, 21 Jan 2016 15:35:29 +0000 (10:35 -0500)]
Bug 5019: Add QName param to NormalizedNodeWriter#leafSetEntryNode

NormalizedNodeWriter allows us to emit a single LeafSetEntryNode, which
breaks assumptions in NormalizedNodeStreamWriter -- specifically that
the receiver has seen its parent LeafsetNode.

In this case this is not true, so we need to supply the QName to pass
down the identity of the entry.

Change-Id: I45187800c62ec36b276724d230a922634c556a9b
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit d9193a3ec0a76392097f04d14d0547a7c00d5d27)

8 years agoBug 4969: NPE in JSONCodecFactory by attempt to find codec for a leafref 21/33721/1
Peter Kajsa [Fri, 22 Jan 2016 10:39:37 +0000 (11:39 +0100)]
Bug 4969: NPE in JSONCodecFactory by attempt to find codec for a leafref

Attempt to find codec for a leafref results in NPE in JSONCodecFactory, because
SchemaContextUtils cannot find baseType of derived leafref type.

Change-Id: If5288210b4f4d200b18063cf58fdf873b1d12be1
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
(cherry picked from commit 9c98b9b0ea9d0f6ec26e64e8683cb3f1648d10d9)

8 years agoBUG-4295: fix merge callsite 85/33485/1
Robert Varga [Mon, 25 Jan 2016 09:58:55 +0000 (10:58 +0100)]
BUG-4295: fix merge callsite

This is a fixup of the previous patch. The problem was expanding a merge
into a new node, which used a direct value propagation with a merge.
That is not correct, as the merge should be pushed via
ModificationApplyOperation, which in case of unkeyed lists will turn it
into a write.

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

8 years agoBUG-4684: validate changes against effective state 75/33475/1
Robert Varga [Tue, 19 Jan 2016 20:50:35 +0000 (21:50 +0100)]
BUG-4684: validate changes against effective state

In order to deal with merges, we would have to concoct a very fragile
machinery, which would perform the equivalent of apply(), except it
would not produce merged data.

Instead of that let us pass down version, which is all we need to run
the apply operation. Once applied, we will have a preliminary result of
apply, which we can reuse under some circumstances -- which is if the
observed current metadata node does not change and if the SchemaContext
(and hence the associated SchemaAwareApplyOperation object) does not
change.

If either does, we re-calculate the result -- but that may not be
accurate at this point.

Change-Id: I145969e47136b324c07868bd00ded0764ef634f4
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Signed-off-by: Filip.Gregor <fgregor@cisco.com>
8 years agoBUG-4295: handle merge into unkeyed list 72/33472/2
Robert Varga [Mon, 25 Jan 2016 09:58:55 +0000 (10:58 +0100)]
BUG-4295: handle merge into unkeyed list

A merge into an unkeyed list equals to a write.

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

8 years agoAdd leaf context when value deserialization fails 79/33379/1
Robert Varga [Fri, 22 Jan 2016 17:56:06 +0000 (18:56 +0100)]
Add leaf context when value deserialization fails

When the codecs throw an IllegalArgumentException, it is useful to know
which leaf has failed to parse. Catch the exception and chain it to an
exception which gives more context.

Change-Id: I6466b5d86294a1f0116477081267a80c0a696bfb
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBug 4295: Fixed incorrectly introduced nodes when MERGE was followed by DELETE 19/33119/1
Tony Tkacik [Wed, 20 Jan 2016 17:20:32 +0000 (18:20 +0100)]
Bug 4295: Fixed incorrectly introduced nodes when MERGE was followed by DELETE

ModificationNode lost state in situations when
parent node was MERGE which indroduced child nodes
and child node was deleted. That resulted into recording NONE,
which during apply of MERGE was expanded back to original MERGE
which caused reintroduction of deleted node.

Change-Id: Ia2085f5475b49957ef8ac7ab6c629ca3eef803f2
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoFix yang-maven-plugin generating superfluous files 82/33082/2
Robert Varga [Wed, 20 Jan 2016 12:32:42 +0000 (13:32 +0100)]
Fix yang-maven-plugin generating superfluous files

Logic detecting whether a file belongs to the current project has been
broken in change I75c8b67af01212a8ac5b832625f9405bb0108455. It works
most of the time with 'mvn clean install', but fails if there is a
generate-sources phase before dependency projects are
packaged/installed. This typically happens when invoked from IDE such as
Eclipse.

Perform correct checks to see if a particular file was injected from
current project.

The correct fix is to use SchemaContextResolver, where we inject local
files, capture their SchemaSourceIdentifiers, then inject any
dependencies. That way we can perform the lookup based on
ModuleIdentifiers and not rely on the particulars what form was used to
get the source.

Change-Id: I2392dc05bfbc94d613ec896d38fac21734a5bc81
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoIntroduce formatting methods for SourceException 16/33016/2
Robert Varga [Mon, 4 Jan 2016 23:46:14 +0000 (00:46 +0100)]
Introduce formatting methods for SourceException

- throwIf() is similar to Preconditions.checkArgument(), but checks the
  inverse condition
- throwIfNull() is similar to Preconditions.checkNotNull()
- new constructors with string formatting
- fix {Invalid,Missing}SubstatementException not having a version

Change-Id: I95d15fb6a591f77b0be17d9ca50f51d3636c80ed
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
(cherry picked from commit c652590993b1e4660d5d557868665dbfa634ed27)

8 years agoBUG-4295: instantiate MERGE operations lazily 52/32752/2
Peter Kajsa [Tue, 5 Jan 2016 09:14:00 +0000 (10:14 +0100)]
BUG-4295: instantiate MERGE operations lazily

This patch reworks how merges are done in a DataTreeModification by
moving the logic to SchemaAwareApplyOperation, which is the final
recipient of the resulting ModifiedNode.

This way the code is co-located and can be specialized based on
information available for that particular node, and the container merge
code is cleanly separated from the leaf node code, which turns each
merge into a write.

When a merge occurs on a previously-written node, we graft all merged
children onto the write, using recursion only when necessary.

checkPresentChild method renamed.
Fix of ModifiedNode and added unit test.

Change-Id: I674e3d2150e796472e831abdcfa0fad582b69759
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Filip.Gregor <fgregor@cisco.com>
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoBUG-865: deprecate recursive node instantiation 66/32866/2
Robert Varga [Sat, 16 Jan 2016 01:05:31 +0000 (02:05 +0100)]
BUG-865: deprecate recursive node instantiation

Recursive create() method forces a full materialization, which is slow
and not memory-efficient. Lazily-instantiated nodes work equally well
using less memory.

Change-Id: I320f375090df480c1b376f543cb0b00649b44234
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBug 4459 - Parser fails when enum contains illegal characters for QName. 71/32871/1
Peter Kajsa [Tue, 13 Oct 2015 15:29:24 +0000 (17:29 +0200)]
Bug 4459 - Parser fails when enum contains illegal characters for QName.

RFC6020 defines enum argument as string, but we need to parse QName from it
due to binding part of yangtools. However, parsing of the enum containing
illegal characters for QName causes IllegalArgumentException.

Change-Id: Iccd5523e12ca9bdfa44efd0fab09ef764990b837
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoBug 4540: Yang parser exceptions should follow consistent path 68/32868/1
Igor Foltin [Wed, 9 Dec 2015 14:27:20 +0000 (15:27 +0100)]
Bug 4540: Yang parser exceptions should follow consistent path

Replaced FileInputStream with NamedFileInputStream
in order to provide source path.

Replaced several standard Java exceptions with
yang-parser-impl exceptions where appropriate.

Added StatementSourceReference object into error messages.

Code refactoring based on codestyle rules.

Change-Id: I7e0c80d1d1c4644fa8c61a420ba0055ae84d2398
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
(cherry picked from commit afc9771f12441ce707dac07ad282fbbd4022bfb2)

8 years agoAdded support for root in create(TreeType, YangInstanceIdentifier) 29/32829/1
Tony Tkacik [Fri, 8 Jan 2016 10:54:31 +0000 (11:54 +0100)]
Added support for root in create(TreeType, YangInstanceIdentifier)

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

8 years agoUpdate .gitreview for stable/beryllium 82/32682/1
Thanh Ha [Thu, 14 Jan 2016 22:13:01 +0000 (17:13 -0500)]
Update .gitreview for stable/beryllium

Change-Id: I14b6a6f50ac682380ede75a95681c62299b587fa
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBug 4933: Yang parser does not accept deviate "not-supported" 14/32414/7
Peter Kajsa [Tue, 12 Jan 2016 12:45:30 +0000 (13:45 +0100)]
Bug 4933: Yang parser does not accept deviate "not-supported"

The method parseDeviateFromString does not parse input string
to Deviate enum correctly. This problem occurs when yang keyword
does not match java indentifier of Deviate enum.

Change-Id: I188b9539c804a561b13adac9df247fd57fab8599
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoMake NodeWithValue generic 66/26866/10
Robert Varga [Sat, 22 Aug 2015 09:17:02 +0000 (11:17 +0200)]
Make NodeWithValue generic

Retaining the type of contained value is useful in various places, which
means we don't have to add an explicit cast.

Change-Id: Ibf3b16fd7b3348730f3efb3e284a345e69003e30
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 3874: Support of yang modeled AnyXML - JSON deserialization 42/29742/17
Peter Kajsa [Mon, 16 Nov 2015 10:28:29 +0000 (11:28 +0100)]
Bug 3874: Support of yang modeled AnyXML - JSON deserialization

- added support of yang modeled anyXml deserialization from JSON
- basic unit tests

Change-Id: Idd52bfe900a52d5d1b30d2cf25449f606e339d50
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoSimplify Utils.parseStatus() 45/32445/1
Robert Varga [Tue, 12 Jan 2016 21:13:07 +0000 (22:13 +0100)]
Simplify Utils.parseStatus()

No need for a local variable, and use proper log formatting instead of
string concat.

Change-Id: Id5fd1dba61cf984a3aa08f4b2b7ee367ff24e307
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBug 2062 - StreamWriter APIs loses information about leaf-set ordering 58/32258/4
Jan Hajnar [Fri, 7 Aug 2015 12:20:01 +0000 (14:20 +0200)]
Bug 2062 - StreamWriter APIs loses information about leaf-set ordering

* added start methods for OrderedLeafSet
* modified classes that use NormalizedNodeStreamWriter to use
startOrderedLeafSet when needed.

Change-Id: I890a338313229b1600adcf5ac2ef1c8b440a220d
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBug 3874: Support of yang modeled AnyXML - serialization XML/JSON 41/29741/15
Peter Kajsa [Mon, 16 Nov 2015 10:00:47 +0000 (11:00 +0100)]
Bug 3874: Support of yang modeled AnyXML - serialization XML/JSON

- added support of yang modeled anyXml serialization to XML and JSON
- basic unit tests

Change-Id: I60ed3782cd9852c8e2be69c8b8abf825738d16e6
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoBug 3874: Support of yang modeled AnyXML - XML deserialization 38/29738/15
Peter Kajsa [Mon, 16 Nov 2015 09:31:59 +0000 (10:31 +0100)]
Bug 3874: Support of yang modeled AnyXML - XML deserialization

- added support of yang modeled anyXml deserialization from XML
- basic unit tests
- added anyxml-schema-location extension support and removed
  hardcoded extension name from AnyxmlStatementImpl

Change-Id: I2add4bd5613417514d84b52be786074e2cc75f4f
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBug 4657: Added handling of APPEARED, DISAPPEARED. 60/32260/2
Tony Tkacik [Fri, 8 Jan 2016 09:08:29 +0000 (10:08 +0100)]
Bug 4657: Added handling of APPEARED, DISAPPEARED.

In the context of applying candidate to cursor
state APPEARED and DISPAPPEARED should be handled
same way as SUBTREE_MODIFIED.

Change-Id: I220aab3fc94fdec9cf3a158bf4c756c120d9120d
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBUG-4355: mandatory node presence enforcement 66/28666/18
Peter Kajsa [Tue, 1 Dec 2015 10:25:17 +0000 (11:25 +0100)]
BUG-4355: mandatory node presence enforcement

Introduce mandatory leaf validation as specified in RFC6020. Mandatory
node presence is enforced whenever a presence container, a list entry,
and a case node.

The presence of mandatory leaves which do not have any ancestors other
than structural containers are not enforced as mandatory. The reason for
this is that the first transaction on such a DataTree would have to
introduce all mandatory leaves, as their non-presence would make other
transactions fail consistency checks.

Change-Id: I19df441026854955fd37f6e1ff7b4ea3c48c60b8
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoBug 4896: Use HashMap instead of ImmutableMap.Builder in ChoiceModification 59/32259/1
Tony Tkacik [Fri, 8 Jan 2016 08:41:06 +0000 (09:41 +0100)]
Bug 4896: Use HashMap instead of ImmutableMap.Builder in ChoiceModification

Change-Id: Id5f851c65476d9cce94aeec54ccf483d979b2f1a
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoEnforce case uniqueness 12/28712/14
Robert Varga [Thu, 22 Oct 2015 20:41:47 +0000 (22:41 +0200)]
Enforce case uniqueness

Validate case leaf exclusion. RFC6020 requires that at most once case
inside a choice is present at any time. This means we must not allow
leaves which belong to different case statements exist at the same point
in time.

Change-Id: If8235ffc4aff87fd96d5071158b7e794ef8c3c5e
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-865: deprecate SourceStreamAware 34/32134/1
Robert Varga [Tue, 5 Jan 2016 13:27:06 +0000 (14:27 +0100)]
BUG-865: deprecate SourceStreamAware

This interface is only used by Module, where it is a violation of
effective moidel separation from declared model.

Change-Id: I7de48f2c585f8daa7a29bc5b4e6a5ac33c994bbf
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-865: deprecate pre-Beryllium parser elements 91/32091/1
Robert Varga [Mon, 4 Jan 2016 15:54:38 +0000 (16:54 +0100)]
BUG-865: deprecate pre-Beryllium parser elements

This deprecates YangContextParser (in favor of the repository APIs) and
implementation elements of the old parser. These are scheduled for
removal in Boron.

Change-Id: I4ec68576af0a7909a3d8705664d901a62ffcd7a0
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoDo not use deprecated junit API 87/32087/2
Robert Varga [Mon, 4 Jan 2016 15:53:09 +0000 (16:53 +0100)]
Do not use deprecated junit API

Change-Id: Ifcc09ece789c245f8db9e55e5919a6b3cd46e6db
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoRemove an unused import 86/32086/2
Robert Varga [Mon, 4 Jan 2016 15:52:47 +0000 (16:52 +0100)]
Remove an unused import

Change-Id: I5aaf5fa5498c3122a33efe138b441389cae950da
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoPrivate method can be made static 85/32085/2
Robert Varga [Mon, 4 Jan 2016 15:52:17 +0000 (16:52 +0100)]
Private method can be made static

Fixes a strict eclipse warning.

Change-Id: Ie0c0f73cb6f01090505ac09f89d787af5d1116a1
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoExceptions should have serialVersionUid 84/32084/2
Robert Varga [Mon, 4 Jan 2016 15:51:46 +0000 (16:51 +0100)]
Exceptions should have serialVersionUid

Add missing field to fix an eclipse warning.

Change-Id: Ice3d94150c29d0c69a4a6794576f5754191e184d
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoDo not override antlr plugin version 83/32083/2
Robert Varga [Mon, 4 Jan 2016 15:51:12 +0000 (16:51 +0100)]
Do not override antlr plugin version

Fixes a maven warning.

Change-Id: I0ec07c469f9a577c841a445e3ac6979574084088
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoDo not instantiate new maps in LeafRefContextBuilder 97/31997/2
Robert Varga [Sat, 2 Jan 2016 12:05:45 +0000 (13:05 +0100)]
Do not instantiate new maps in LeafRefContextBuilder

LeafRefContext already picks up a constant copy, there is no need to
instantiate new maps. Also adjust names to proper English.

Change-Id: I59c7e0c86bb5eb3580b3f7db8649fca69d7987fe
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoClean LeafRefValidation up 98/31998/2
Robert Varga [Sat, 2 Jan 2016 12:45:09 +0000 (13:45 +0100)]
Clean LeafRefValidation up

- do not use LinkedList
- do not not use single-use temporaries
- do not instantiate YangInstanceIdentifier for PathArgument
- do not use entrySet() where values() is enough
- make temporaries final to indicate when they are initialized

Change-Id: I5859ca886a60bc7cd5c4c109619af6f5a479f3e2
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoQNameWithPredicateBuilder should use an ArrayList 00/32000/2
Robert Varga [Sat, 2 Jan 2016 12:55:34 +0000 (13:55 +0100)]
QNameWithPredicateBuilder should use an ArrayList

Also fix QNameWithPredicateImpl's promise of being Immutable, by copying
the predicates. Otherwise these could be modified by the leaked
collection.

Change-Id: I46105644986bb7a99faf4bd3d6f8b9ff3ff84592
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoQNamePredicate should extends Identifiable<QName> 99/31999/2
Robert Varga [Sat, 2 Jan 2016 12:48:00 +0000 (13:48 +0100)]
QNamePredicate should extends Identifiable<QName>

The interface's getIdentifier() is already matching such a result, reuse
the basic concept.

Change-Id: Id099e90ec0103ef2cdc4c400317caee65060d8e3
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-865: deprecate Module#getSource() 03/32003/2
Robert Varga [Sat, 2 Jan 2016 13:35:36 +0000 (14:35 +0100)]
BUG-865: deprecate Module#getSource()

This method requires implementation to provide YANG text, which is not
always available. SchemaRepository provides the right abstractions for
acquiring the source in the required representation.

Change-Id: Ib769948e3fefc4f1a086f3620a7326fb076f7f95
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoSpell-check Status and UsesNode 04/32004/2
Robert Varga [Sat, 2 Jan 2016 13:47:29 +0000 (14:47 +0100)]
Spell-check Status and UsesNode

Fixes spell-checking warnings.

Change-Id: I97bf10e188b07084c39b48e10e3affb7e8d2c5f8
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoCleanup yang.model.api.meta 05/32005/2
Robert Varga [Sat, 2 Jan 2016 13:52:02 +0000 (14:52 +0100)]
Cleanup yang.model.api.meta

Add proper separators, trim unneeded empty lines, clarify non-null
return of getEffectiveSubstatements().

Change-Id: Ie756cdcf26105556c8be84ccd0df271200c6a968
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoMake getSearchRoot() static 06/32006/2
Robert Varga [Sat, 2 Jan 2016 14:14:51 +0000 (15:14 +0100)]
Make getSearchRoot() static

Private method does not reverence object state, it should be static.

Change-Id: If5456a13d07396477db5d323e95a4288b51cd404
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-865: deprecate internal implementation classes 21/32021/2
Robert Varga [Sat, 2 Jan 2016 15:39:01 +0000 (16:39 +0100)]
BUG-865: deprecate internal implementation classes

Derived*Type and Abstract*Integer are used as DerivedType subclasses and
for realization of deprecated base types. Eventhough they are not
externally visible, deprecate them to make their fate explicit.

Change-Id: Idffbcde09f16942605b66043144c0668557961ba
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBug 4656: Yang parser does not determine configuration true or false properly 74/31774/6
Filip.Gregor [Tue, 22 Dec 2015 14:31:13 +0000 (15:31 +0100)]
Bug 4656: Yang parser does not determine configuration true or false properly

minor fix

Change-Id: I2e58387fcd3012a70d302323b6bd533c285a0211
Signed-off-by: Filip.Gregor <fgregor@cisco.com>
8 years agoBUG-4803: optimize unordered cache 82/31782/3
Robert Varga [Tue, 22 Dec 2015 15:21:31 +0000 (16:21 +0100)]
BUG-4803: optimize unordered cache

This patch side-steps the need to perform kopu operations when the
offsets are already constructed. It also optimizes the number of
ImmutableSet instances present in the system.

Change-Id: I8a9b42e053d88c85bf5e75eb5a58da9bd08ce6d0
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4803: introduce unordered offset maps 26/31726/7
Robert Varga [Mon, 21 Dec 2015 18:42:25 +0000 (19:42 +0100)]
BUG-4803: introduce unordered offset maps

This patch introduces the static factories and methods which allow users
to select the appropriate implementation, either to retain or to ignore
iteration order.

Change-Id: I07dcf77927660461cbd266439463e8d64a1c89db
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4803: fix MutableOffsetMap's insertion order 25/31725/6
Robert Varga [Mon, 21 Dec 2015 17:06:55 +0000 (18:06 +0100)]
BUG-4803: fix MutableOffsetMap's insertion order

When a pairing backed by the array is removed, the order of pairings
would not follow the insertion order. This patch introduces an explicit
removal marker object and when the marker is present we defer to
newKeys map.

Change-Id: Ib27313e0df44754f5219d64126e0ec2a472a503f
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4803: invalidate cache before each test 66/31766/3
Robert Varga [Tue, 22 Dec 2015 11:04:10 +0000 (12:04 +0100)]
BUG-4803: invalidate cache before each test

Running tests will pollute the cache, so we need to clear it before each
test.

Change-Id: I0cc171c22409d81092d82d5570a3c0068bbfc889
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4803: introduce ordered/unordered offsets 11/31711/4
Robert Varga [Mon, 21 Dec 2015 14:46:21 +0000 (15:46 +0100)]
BUG-4803: introduce ordered/unordered offsets

This patch makes an explicit copy of the offset map, ensuring we do not
retain the input reference in copyOf(). We introduce two versions, one
for ordered and one for unordered maps.

This fixes ImmutableOffsetMap potentially not honoring the input
iteration order.

Change-Id: Iff835e2a5028c0dde6de2f39b298b7b4b334826a
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4803: make MutableOffsetMap abstract 05/31705/5
Robert Varga [Mon, 21 Dec 2015 14:16:34 +0000 (15:16 +0100)]
BUG-4803: make MutableOffsetMap abstract

We will need two implementations, one Ordered and Unordered, have make
the base class abstract and implement the Ordered version.

Change-Id: I26826c30470b47aba88ddfb106fd6e7afcd7f288
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4803: make ImmutableOffsetMap abstract 04/31704/4
Robert Varga [Mon, 21 Dec 2015 14:11:49 +0000 (15:11 +0100)]
BUG-4803: make ImmutableOffsetMap abstract

We will need two implementations, ordered and unordered. Make
ImmutableOffsetMap abstract and introduce the Ordered implementation.

Change-Id: I082512d71496c98e2ec3fd8b308ff897703ae01b
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4803: make SharedSingletonMap abstract 03/31703/3
Robert Varga [Mon, 21 Dec 2015 13:26:43 +0000 (14:26 +0100)]
BUG-4803: make SharedSingletonMap abstract

SharedSingletonMap needs to have two implementations, ordered and
unordered. Start off with making the class abstract and introducing the
Ordered version.

Change-Id: Ide1c7abc533e925114fc9452adf04e9f5bd09091
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4803: fix equals() method 19/31519/5
Robert Varga [Thu, 17 Dec 2015 16:18:47 +0000 (17:18 +0100)]
BUG-4803: fix equals() method

The implementation required the map's ordering to be the same, which is
a violation of the Map contract.

Change-Id: I8f3308b9cabd5c011e7c2dadfe520407ad2c4672
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoUse QNameModule#intern() 96/31896/3
Robert Varga [Sat, 26 Dec 2015 16:07:30 +0000 (17:07 +0100)]
Use QNameModule#intern()

QNameModule#cachedReference() is deprecated, use #intern() instead.

Change-Id: Ic60eb4f3968f3e3251e2b798c385043a717c5089
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoMake BitImpl.unknownNodes final 20/32020/3
Robert Varga [Sat, 2 Jan 2016 15:36:31 +0000 (16:36 +0100)]
Make BitImpl.unknownNodes final

This field is really constant, so let's make it final and adjust
hashCode accordingly.

Change-Id: I598b238cadbe74102dcce6db9f7939080db98e92
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoLog attempts to override fraction-digits 18/32018/2
Robert Varga [Sat, 2 Jan 2016 15:07:00 +0000 (16:07 +0100)]
Log attempts to override fraction-digits

We should emit a warning when a model attempts to override
fraction-digits from a base type.

Change-Id: I2aa801288fff8894cc8b8afe22f27c19630e2331
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoUse a constant Charset 96/31996/3
Robert Varga [Sat, 2 Jan 2016 11:28:42 +0000 (12:28 +0100)]
Use a constant Charset

Instead of looking the charset up, use StandardCharsets.

Change-Id: I8d3b00f3472e1a82f705ecb4743b6122c45f752b
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoAdd raw type suppression 91/31991/2
Robert Varga [Sat, 2 Jan 2016 10:41:19 +0000 (11:41 +0100)]
Add raw type suppression

The builder cannot be parameterized without additional casts, add
warning suppression.

Change-Id: I8dab4e0b22143e23d9cfd97d816aca746c2a324e
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoClean codecs up 89/31989/3
Robert Varga [Sat, 2 Jan 2016 10:28:42 +0000 (11:28 +0100)]
Clean codecs up

Add markers for lookups which are not needed with new type
implementation. Also use preconditions instead of explicit if/throw
pairs. Eliminate unneded local variables.

Change-Id: Ifdce997d985276984311fd78c58277d5a1ea738d
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-865: deprecate XmlUtils.resolveBaseTypeFrom() 86/31986/3
Robert Varga [Sat, 2 Jan 2016 09:59:22 +0000 (10:59 +0100)]
BUG-865: deprecate XmlUtils.resolveBaseTypeFrom()

This method was needed with ExtendedType, which did not preserve the
identity of the type. Since the new parser uses yang.model.util.type,
performing an instanceof check on the type directly works as expected.

Change-Id: Ie31aea38cdd70857726e2df20f102a0c6648c11f
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>