yangtools.git
8 years agoBumping Apache Maven dependencies from 3.3.3 to 3.3.9 45/38645/3
Michael Vorburger [Tue, 10 May 2016 22:13:29 +0000 (00:13 +0200)]
Bumping Apache Maven dependencies from 3.3.3 to 3.3.9

Just on the off chance that this fixes a class loader issue with yangide
seen in Bug 5863 (highly unlikely, but upgrade still seems like a good
idea anyway)

Change-Id: Idc0caf298cbd51d4b0ae37f72080aed447f9816f
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
8 years agoAddress minor sonar issues in ImmutableOffsetMap 54/38854/2
Robert Varga [Fri, 13 May 2016 08:11:59 +0000 (10:11 +0200)]
Address minor sonar issues in ImmutableOffsetMap

Reorder keywords and rename a temporary variable.

Change-Id: I41594bb9fa9cb265e80ab86e0a11e0c049b4cda0
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoClean up generic type arguments 57/38257/6
Robert Varga [Mon, 2 May 2016 09:34:13 +0000 (11:34 +0200)]
Clean up generic type arguments

Downgrade arguments to ?, so as to eliminate warning from the forced upcast
to Object.

Change-Id: Ie861f25534339d42e01dee1ea726bb126e1a3c57
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBump Checkstyle version from 6.2 to 6.16 11/38211/10
Michael Vorburger [Thu, 28 Apr 2016 23:52:40 +0000 (01:52 +0200)]
Bump Checkstyle version from 6.2 to 6.16

made required code changes in CheckLoggingUtil & CheckstyleTest

Change-Id: I59da3d9c09b1a22a1f8266a2c6875ba10fc881e9
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
8 years agoBug 4662: Introduce a SemanticVersion concept - pre-linkage phase 72/36872/16
Peter Kajsa [Wed, 30 Mar 2016 09:23:29 +0000 (11:23 +0200)]
Bug 4662: Introduce a SemanticVersion concept - pre-linkage phase

Added pre-linkage phase to yang statement parser which collects
available module names and namespaces. The phase is necessary in
order to correct resolution of unknown statements used in subsequent
linkage phase (e.g. semantic version of yang modules).

Change-Id: I20e16f3bff1bedcf6cef48a25adafa6e225badeb
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoCheckstyle dependency to runtime version instead of Maven plugin 15/38815/4
Michael Vorburger [Thu, 28 Apr 2016 23:52:40 +0000 (01:52 +0200)]
Checkstyle dependency to runtime version instead of Maven plugin

Change-Id: Ica9df2305eccfc055641455d40b56f2838fde5b3
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
8 years agoBug 5446: Yangtools UnionStringCodec is not consistent with BinaryStringCodec 69/38669/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>
8 years agoRefactor currentThread into local variable 59/38659/3
Michael Vorburger [Wed, 11 May 2016 11:08:35 +0000 (13:08 +0200)]
Refactor currentThread into local variable

Not that this would fix anything, as Thread.currentThread() shouldn't
change here (or could it?), so consider this more of a "readability"
proposal.

Change-Id: I70ef77f4d2b6e34440168456c0638be6c7045f79
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
8 years agoRevert "Bug 5829 - New yang parser allows two choice cases with identical child elements" 73/38673/1
Alexis de Talhouët [Wed, 11 May 2016 16:12:58 +0000 (12:12 -0400)]
Revert "Bug 5829 - New yang parser allows two choice cases with identical child elements"

This reverts commit e37952ec2815c2619592b1c8108a05e03fa32978.

Change-Id: Id39c673375ffa585ceb90a0946699b83b10b5573
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
8 years agoRevert "Bug 5829 - New yang parser allows two choice cases with identical child elements" 64/38664/2
Robert Varga [Wed, 11 May 2016 12:50:43 +0000 (12:50 +0000)]
Revert "Bug 5829 - New yang parser allows two choice cases with identical child elements"

This reverts commit e37952ec2815c2619592b1c8108a05e03fa32978,
because it breaks config yangs.

Change-Id: I70034b9d99590350336169c0608793ae876dcfb5
Signed-off-by: Robert Varga <nite@hq.sk>
8 years agoUnit test post-clean-up fix 60/38660/1
Igor Foltin [Wed, 11 May 2016 11:26:50 +0000 (13:26 +0200)]
Unit test post-clean-up fix

Moved unit tests Bug5712Test and Bug5829Test
to package org.opendaylight.yangtools.yang.stmt.

Change-Id: I2677c6c8f327428ebd1544a51aecaf0eb095c653
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years agoBug 5712: Reference type in same module with prefix fails to compile 99/37599/5
Igor Foltin [Wed, 4 May 2016 09:11:54 +0000 (11:11 +0200)]
Bug 5712: Reference type in same module with prefix fails to compile

Unit test for both old and new yang parser.

Change-Id: Iad60c51c1e6614c15856a1ea68dab7f80763466f
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years agoBug 5829 - New yang parser allows two choice cases with identical child elements 71/38371/4
Peter Kajsa [Wed, 4 May 2016 14:29:39 +0000 (16:29 +0200)]
Bug 5829 - New yang parser allows two choice cases with identical child elements

Added check of name collisions between childs of case nodes in choice.

Change-Id: I4b367a52a7fa37f98646645728de8ff6745b34a3
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoBUG-5626: introduce utility identifiers 21/38621/2
Robert Varga [Tue, 10 May 2016 09:48:48 +0000 (11:48 +0200)]
BUG-5626: introduce utility identifiers

Wrapping String and UUID into an Identifier is useful for bridging worlds
with and without Identifiers. Introduce dedicated wrappers for these two
common cases.

Change-Id: Ib020c34512a826c23099601e3a57d558aa324976
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 5085: Clean-up test and retest JUnit tests 26/38426/2
Igor Foltin [Thu, 5 May 2016 13:49:26 +0000 (15:49 +0200)]
Bug 5085: Clean-up test and retest JUnit tests

Migrated unit tests which used old yang parser to new yang parser.

Change-Id: Ib3dae51fc083734e9b27692f12b6f5528975f4bb
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years agoAddress FIXME for QueuedNotificationManager 78/36978/7
Ryan Goulding [Thu, 31 Mar 2016 21:21:11 +0000 (17:21 -0400)]
Address FIXME for QueuedNotificationManager

The QueuedNotificationManager was originally implemented to loop forever in
attempt to offer the target notification queue a notification.  However, with a
reasonably large queue capacity and long timeout, if queueing is still
unsuccessful, then the listener is likely in an unrecoverable state (deadlock
or endless loop).  To avoid one rogue listener bringing everyone to a halt, the
number of tries is limited to 10 (10 minutes), and an appropriate warning
message is printed if the offer attempt fails.

Change-Id: Ie01ee475cfdda2c93c346d3b7ea823ccfc609b83
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
8 years agoBug 5819 - Violation of synchronization rules in AbstractSchemaRepository 36/38236/5
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>
8 years agoUse depends-maven-version from odlparent 92/36092/5
Thanh Ha [Fri, 11 Mar 2016 02:21:38 +0000 (21:21 -0500)]
Use depends-maven-version from odlparent

Change-Id: I5eea247cae71ef15083762d96bc3f6f30c25ed89
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFixed Eclipse specific compilation error related to generics 89/38289/2
Michael Vorburger [Mon, 2 May 2016 16:55:58 +0000 (18:55 +0200)]
Fixed Eclipse specific compilation error related to generics

until https://bugs.eclipse.org/bugs/show_bug.cgi?id=492838 is resolved

Change-Id: I910996a06341e44b2a7bc588bfa17264be0f0b08
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
8 years agoAdded list of changes in YANG 1.1 81/37081/3
Tony Tkacik [Mon, 4 Apr 2016 14:43:55 +0000 (16:43 +0200)]
Added list of changes in YANG 1.1

Change-Id: Ifc3baeea73b47a1110ba463050b2c10a901e3a35
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 1441: Implement XML Stream Reader to Normalized Node Writer 31/37031/5
Igor Foltin [Sat, 2 Apr 2016 11:06:34 +0000 (13:06 +0200)]
Bug 1441: Implement XML Stream Reader to Normalized Node Writer

This patch introduces new XML Parser which walks the DOM tree
and emits events into a NormalizedNodeStreamWriter.

The parser is found in the newly created module yang-data-codec-xml.

Classes which are shared by XML and JSON Parser were moved to module yang-data-util.

Added documentation for the XML parser.

Change-Id: I5b7de341333f94ad75bc2ff93b0f47f2c007e793
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years ago.gitignore .pmd files created by PMD Eclipse plugin 77/38177/2
Michael Vorburger [Wed, 27 Apr 2016 23:15:30 +0000 (01:15 +0200)]
.gitignore .pmd files created by PMD Eclipse plugin

Change-Id: I80d24481b6904dfd1c844b5e8a7ab6e06a404531
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
8 years agoFixed Eclipse workspace red broken build due to missing ANTLR gen. src 78/38178/3
Michael Vorburger [Wed, 27 Apr 2016 23:45:38 +0000 (01:45 +0200)]
Fixed Eclipse workspace red broken build due to missing ANTLR gen. src

build-helper-maven-plugin plugin declaration is needed for
target/generated-sources/parser to be added as a source folder.

Change-Id: Ie2819ea3c65f8b5a0d34cca787fb57a498ad3238
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
8 years agoBug 5484: Fix of Yang statement lexer 90/38190/2
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>
8 years ago.gitignore .checkstyle files created by Checkstyle Eclipse plugin 24/38124/2
Michael Vorburger [Tue, 26 Apr 2016 20:21:50 +0000 (22:21 +0200)]
.gitignore .checkstyle files created by Checkstyle Eclipse plugin

Change-Id: I70b073c2b629e5b7caacba47dbf1406f1707ab23
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
8 years agoEffectiveSchemaContext small clean-up 17/38017/3
Martin Ciglan [Fri, 22 Apr 2016 13:35:18 +0000 (15:35 +0200)]
EffectiveSchemaContext small clean-up

- unused import
- incorrect year in licence header
- toString() content fixed

Change-Id: I7b5697d57df6a55da9fd37f9b94b9051ff07154d
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
8 years agoBug 5647: Add schema-less version of XMLStreamNormalizedNodeStreamWriter 75/36975/5
Tom Pantelis [Thu, 31 Mar 2016 18:08:45 +0000 (14:08 -0400)]
Bug 5647: Add schema-less version of XMLStreamNormalizedNodeStreamWriter

Added a schema-less version of XMLStreamNormalizedNodeStreamWriter
for use when one doesn't have a SchemaContext or doesn't have a valid
SchemaContext context (as is the case with CDS recovery if the
SchemaContext doesn't match the recovered data but we want to be able to
dump the node in a readable format for troubleshooting).

Change-Id: I2c7e09af60c5eb831fc211df85f7c0e2e05c32ab
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 5693: IOException after first parsing phase - stream closed 25/37425/8
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>
8 years agoImprove error message when child schema not found 44/37044/2
Tom Pantelis [Mon, 4 Apr 2016 00:03:15 +0000 (20:03 -0400)]
Improve error message when child schema not found

In AbstractNodeContainerModificationStrategy, added the parent id to the
error messages to provide more context for troubleshooting.

Change-Id: I87fe94b8eab35f50de022db3406b14e667ad691e
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoReplace tabs in java files with spaces 68/37568/3
Ryan Goulding [Wed, 13 Apr 2016 18:11:42 +0000 (14:11 -0400)]
Replace tabs in java files with spaces

A tab may be interpreted as a different number of columns depending on
environment.  On the hand, a space is always interpreted as just one column.
This change replaces all instances of tab characters with 4 spaces within
java files.

The following UNIX command was run in order to automate replacement:

> find . -type f -name "*.java" -exec sed -i 's/\t/    /g' {} \;

An appropriate comment was added to CheckCodingStyleTestClass.java to indicate
that the class contains intentional checkstyle errors (i.e., tabs) to test
the efficacy of checkstyle rules.

Change-Id: Ie51eadda2169d1bb15c8aef1ce01e625b9b9972d
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
8 years agoDrop unneeded generic type specifiers 50/37550/2
Stephen Kitt [Wed, 13 Apr 2016 15:03:25 +0000 (17:03 +0200)]
Drop unneeded generic type specifiers

Change-Id: Ifd28a6dda26da901925970ae86dc8c4c1a5bd4ee
Signed-off-by: Stephen Kitt <skitt@redhat.com>
8 years agoAdd a couple of toString() implementations 43/37243/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>
8 years agoFix LOG formatting issues 77/36977/2
Ryan Goulding [Thu, 31 Mar 2016 20:20:31 +0000 (16:20 -0400)]
Fix LOG formatting issues

In a few places, LOG statements are updated to utilize proper
formatting.

Change-Id: Ic1d0f50a6b561ee1e70e76d096b78928d5af65b1
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
8 years agoMove CACHED_FILE_PATTERN constant to correct location 33/36933/3
Ryan Goulding [Thu, 31 Mar 2016 04:33:30 +0000 (00:33 -0400)]
Move CACHED_FILE_PATTERN constant to correct location

Constants are generally put together at the top of the class.

Change-Id: I6ab0ea662066cce3f421253cf4c8b110a5fac8b2
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
8 years agoFilesystemSchemaSourceCache reduce sourceIdToFile(...) visibility 19/36919/4
Ryan Goulding [Wed, 30 Mar 2016 20:47:47 +0000 (16:47 -0400)]
FilesystemSchemaSourceCache reduce sourceIdToFile(...) visibility

Change sourceIdToFile(...) scope to default.  public is not needed, as nothing
calls this function from outside the package.  I pulled autorelease, and
confirmed that no other projects call this function.  Some tests within the
package test this method explicitly, and there is no easy way to decrase
visibility to private.  The @Beta annotation was removed as this API is no
longer advertised publically.

Change-Id: Iacb41bea5eef7477b279f21b0fe2a103dcce3e4b
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
8 years agoFilesystemSchemaSourceCache to use try-with-resources to ensure stream is closed 30/36930/2
Ryan Goulding [Thu, 31 Mar 2016 04:25:00 +0000 (00:25 -0400)]
FilesystemSchemaSourceCache to use try-with-resources to ensure stream is closed

Use try-with-resources to ensure the stream is closed, avoiding leaks.

Change-Id: I367da3e7e0950cb9c5aa7fad3518bc7079dca1fc
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
8 years agoStandardize codec serialization to use java.util.Objects.toString(...) 20/36920/2
Ryan Goulding [Wed, 30 Mar 2016 21:30:06 +0000 (17:30 -0400)]
Standardize codec serialization to use java.util.Objects.toString(...)

Standardize serialization calls where appropriate to use
java.util.Objects.toString(object, "") instead of custom ternary expression
for each implementation.

Change-Id: I1f809b96b35d072fa47cd4a8dfb65f411c843e81
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
8 years agoImprove Error Reporting for non-parsable date for file in schema cache 34/36934/2
Ryan Goulding [Thu, 31 Mar 2016 05:04:38 +0000 (01:04 -0400)]
Improve Error Reporting for non-parsable date for file in schema cache

Add the filename to info message to allow debugging of specific file that
didn't include expected date format.

Change-Id: I548c6bc59ee98fcef964ff96a08d732d3c65de5e
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
8 years agoBug5531: Can't get complete YIN schema on Windows 44/36944/1
Ivan Hrasko [Thu, 31 Mar 2016 10:46:23 +0000 (12:46 +0200)]
Bug5531: Can't get complete YIN schema on Windows

Added unit test trying to write small module to YIN. If result is not
empty and module is complete then test is sucessfull.

Change-Id: I8b0b0c0c0f787c9a6402dd8b4c74173b89a1b8c5
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
8 years agoAdd test scope for junit 21/36221/3
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 5531: Can't get complete YIN schema on Windows 04/36804/3
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>
8 years agoBUG-4268: clarify length constraint API contract 84/29884/5
Robert Varga [Wed, 18 Nov 2015 19:37:01 +0000 (20:37 +0100)]
BUG-4268: clarify length constraint API contract

The contract did not specify whether the returned constraints are
declared or effective. The intent is to return effective constraints,
which include any constraints imposed by base types -- as is the case
with range constraints.

Change-Id: I0d0582edf87c0a78db3e8664655f139f827217a7
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-4268: clarify API contract of range constraints 83/29883/5
Robert Varga [Wed, 18 Nov 2015 19:42:27 +0000 (20:42 +0100)]
BUG-4268: clarify API contract of range constraints

The API definition is not clear whether the constraints show the
declared or effective view of range constraints.

Implementations have been returning the effective view, e.g. including
ranges from base types, which is the API intent. Clarify the API.

Change-Id: I6edecae04b9cba3b1452584b7cf7645dfcc5e57b
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBug 5396: Regex processing of yang models is broken. 87/36587/2
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 5567 NPE - invoking of equals on nullable element 95/36495/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-5504: use Object.toString() without overrides in precondition 88/36288/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>
8 years agoBug 5550 - Omit the check of mandatory nodes in uses-augment 23/36423/1
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 agoUse String concatenation instead of StringBuffer/Builder 18/35918/2
Stephen Kitt [Tue, 8 Mar 2016 10:09:29 +0000 (11:09 +0100)]
Use String concatenation instead of StringBuffer/Builder

... and avoid mixing append() and concatenation.

Change-Id: I1860cb191804413c00fa560abdccaa6f2979c70e
Signed-off-by: Stephen Kitt <skitt@redhat.com>
8 years agoRemove unnecessary String() constructor invocations 90/35890/4
Stephen Kitt [Mon, 7 Mar 2016 17:38:26 +0000 (18:38 +0100)]
Remove unnecessary String() constructor invocations

Document legimitate uses, and clean up the containing test classes
(which mostly involves disabling IntelliJ's warnings about invalid
uses of equals()).

Clean up a few only-null variables and a couple of other small
issues.

Change-Id: I7a6177b266589c15b9b169a99a9f2a9054da94ed
Signed-off-by: Stephen Kitt <skitt@redhat.com>
8 years agoBug 3324: Yangtools documentation 50/34550/4
Igor Foltin [Thu, 25 Feb 2016 15:44:24 +0000 (16:44 +0100)]
Bug 3324: Yangtools documentation

Added documentation for the following topic - Working with YANG Model.

Added documentation for the following topic - Working with YANG Data.

Change-Id: Ib07d9a5b2ac2ec96313875481065bcdff695e7e3
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years agoBug 5481: When condition of augment added in constraints of augment target 58/36058/2
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 agoRemove explicit throws of SourceException 72/35872/3
Robert Varga [Mon, 7 Mar 2016 12:46:17 +0000 (13:46 +0100)]
Remove explicit throws of SourceException

SourceException is a RuntimeException, no need to declared it as thrown
(and Sonar is touchy about it).

Change-Id: Ic27e4bda3642f8e7a3fa8c8ab95a32c05dcc00e6
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoAvoid re-throwing exceptions directly 85/35885/3
Stephen Kitt [Mon, 7 Mar 2016 16:26:04 +0000 (17:26 +0100)]
Avoid re-throwing exceptions directly

Change-Id: Ib6ed75dbe762c5465beca0fead6a18455cebe2e1
Signed-off-by: Stephen Kitt <skitt@redhat.com>
8 years agoDrop duplicate Maven dependencies 84/35884/3
Stephen Kitt [Mon, 7 Mar 2016 16:25:41 +0000 (17:25 +0100)]
Drop duplicate Maven dependencies

Change-Id: Ie77dd8612e50a7bbdab245d71d73446bc93f21a8
Signed-off-by: Stephen Kitt <skitt@redhat.com>
8 years agoSimplify boolean expressions 83/35883/3
Stephen Kitt [Mon, 7 Mar 2016 16:23:18 +0000 (17:23 +0100)]
Simplify boolean expressions

* Avoid comparing explicitly with true or false.
* Merge simple conditional return statements.
* Avoid ? true : false.
* Use assertFalse() instead of negating assertTrue().

Change-Id: I6f037da92850bb67710c031fd321f51ca6f3b351
Signed-off-by: Stephen Kitt <skitt@redhat.com>
8 years agoBug 5335: augmenting a mandatory node on a presence container 80/35880/5
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 agoRemove redundant modifiers 82/35882/2
Stephen Kitt [Mon, 7 Mar 2016 16:19:17 +0000 (17:19 +0100)]
Remove redundant modifiers

* Use <?> instead of <? extends Object>.
* Delete unnecessary semi-colons.
* Drop public static from interface members (they're the default).
* Drop final from static methods (it's the default).
* Drop private from enum constructors (it's the default).
* Collapse common exception handlers.
* Clean up obsolete imports.

Change-Id: I8f7f74a126f558cba0a99fd0b7376cfdbccc4390
Signed-off-by: Stephen Kitt <skitt@redhat.com>
8 years agoUse Collections.singletonList() instead of Arrays.asList() 86/35886/2
Stephen Kitt [Mon, 7 Mar 2016 16:29:52 +0000 (17:29 +0100)]
Use Collections.singletonList() instead of Arrays.asList()

... for calls with single parameters.

Change-Id: I9481dde463898f4d49061ed99670e42bf7e9aa25
Signed-off-by: Stephen Kitt <skitt@redhat.com>
8 years agoFix TrieMap tests a bit 34/35834/2
Robert Varga [Fri, 4 Mar 2016 21:49:53 +0000 (22:49 +0100)]
Fix TrieMap tests a bit

Assert that the read-only map is isolated from write map. Also do not
use guava where not needed.

Change-Id: I91b16a47125156bf12d27f730c373dfc94060de9
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoReduce cyclomatic complexity 68/35868/1
Robert Varga [Mon, 7 Mar 2016 10:44:10 +0000 (11:44 +0100)]
Reduce cyclomatic complexity

Reduces number of branches in methods.

Change-Id: I79e2b453dd82d0baf1ac3b8c75dea31c7fca4523
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 5437: Issue accessing mounted device supporting OpenConfig BGP. 76/35576/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 agoRename yang test files to match module names 09/35309/5
Andrej Mak [Wed, 24 Feb 2016 06:29:19 +0000 (07:29 +0100)]
Rename yang test files to match module names

Change-Id: I1108fd2b3c66b068c1f22b4bab65e2a3f8f8d3d9
Signed-off-by: Andrej Mak <andmak@cisco.com>
8 years agoBug 3899: Milestone Increase test coverage for YangTools - builder 08/34908/4
Filip Gregor [Wed, 17 Feb 2016 13:51:43 +0000 (14:51 +0100)]
Bug 3899: Milestone Increase test coverage for YangTools - builder

added tests for more builders

Change-Id: I127bcef2c24608321edc9dabd74451baf5e7b151
Signed-off-by: Filip Gregor <fgregor@cisco.com>
8 years agoBug 3899: Milestone Increase test coverage for YangTools - Path 76/34676/11
Filip Gregor [Mon, 15 Feb 2016 13:48:14 +0000 (14:48 +0100)]
Bug 3899: Milestone Increase test coverage for YangTools - Path

added tests for pathargument, yang-common

Change-Id: I84b6b3f8e9b495b49241d983168846314569aa02
Signed-off-by: Filip Gregor <fgregor@cisco.com>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 78/34478/14
Jakub Toth [Thu, 11 Feb 2016 16:30:26 +0000 (17:30 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

UtilTest

Change-Id: I4e1580214ea23f2e9121c9e57866db18c90eae55
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoMove SchemaOrderedNormalizedNodeWriter to yangtools 84/34884/4
Andrej Mak [Thu, 18 Feb 2016 10:01:31 +0000 (11:01 +0100)]
Move SchemaOrderedNormalizedNodeWriter to yangtools

Move SchemaOrderedNormalizedNodeWriter from netconf to yangtools
and refactor to reuse existing code.

Change-Id: Icdd7a1a2b43fd8e8ab0312b770d954b73939ff69
Signed-off-by: Andrej Mak <andmak@cisco.com>
8 years agoSwitch to odlparent-lite 09/35109/3
Robert Varga [Fri, 19 Feb 2016 16:01:45 +0000 (17:01 +0100)]
Switch to odlparent-lite

The aggregator should not be inheriting from the full parent, just lite.

Change-Id: I9b449d48b28b170040f1f14bace8edab8a5e9fb4
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoRemove JDK 8 doclint override 08/35108/3
Robert Varga [Fri, 19 Feb 2016 16:00:01 +0000 (17:00 +0100)]
Remove JDK 8 doclint override

This should not be present here.

Change-Id: I16d43381b38ac1499a8bfdf47f2490399ba51434
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools - declared statements 73/34773/2
Igor Foltin [Tue, 16 Feb 2016 19:05:53 +0000 (20:05 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools - declared statements

Added unit tests for several declared yang statements.

Change-Id: Ic23a7ef0572ccae1931eee2640a50ddc26ef2475
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 57/34657/4
Jakub Toth [Mon, 15 Feb 2016 07:49:17 +0000 (08:49 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

YangToSourcesMojoTest

Change-Id: I3e22b99eec2e8ec974241ea9bcc0a800045529a2
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 38/34538/5
Jakub Toth [Fri, 12 Feb 2016 09:50:51 +0000 (10:50 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

YangSourceInZipFileTest

Change-Id: I04d37c5190ace6f40fe0933911e7d761b7e5157c
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoEliminate SourceException throws declarations 75/34775/2
Robert Varga [Tue, 16 Feb 2016 19:13:07 +0000 (20:13 +0100)]
Eliminate SourceException throws declarations

SourceException is a RuntimeException, no need to declare it, fixing
Sonar warnings.

Change-Id: I1a96ecd098cfcd489a17a2307a27256bce2754fc
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoUse String.indexOf(char) instead of String 74/34774/2
Robert Varga [Tue, 16 Feb 2016 19:15:45 +0000 (20:15 +0100)]
Use String.indexOf(char) instead of String

Fixes sonar warnings and improves performance just bit.

Change-Id: I5b8ce70077af7ba5e13a74e9bdd00aca8822dcc2
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoRemove an unneeded null check 37/34637/3
Robert Varga [Sun, 14 Feb 2016 22:29:41 +0000 (23:29 +0100)]
Remove an unneeded null check

instanceof performs a null check, hence we do not have to do it
ourselves. Saves a branch.

Change-Id: Icb4e29c5adb94a1c971fa8019064324ef1cadbf2
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 51/34551/7
Jakub Toth [Fri, 12 Feb 2016 11:59:51 +0000 (12:59 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

YangToSourcesProcessorTest

Change-Id: Ia82b733cad2308524da0e1ded9b5a9ef3b03571f
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 40/34540/3
Jakub Toth [Fri, 12 Feb 2016 10:31:31 +0000 (11:31 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

YangSourceFromFileTest

Change-Id: I6f0330bc6411c46e5dac9677a44952d648e0bd70
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 43/34443/3
Jakub Toth [Thu, 11 Feb 2016 09:04:51 +0000 (10:04 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

FilesystemSchemaSourceCacheTest

Change-Id: I2f9276ce1cb3e3742115819192b28abcef95eb17
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 12/34412/8
Jakub Toth [Tue, 9 Feb 2016 15:19:01 +0000 (16:19 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

SchemaSourceTransformerTest

Change-Id: I12892be51e74a37faaa7cc513385229f208018e6
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 3899: Milestone Increase test coverage for YangTools - Types 71/34471/9
Filip Gregor [Thu, 11 Feb 2016 11:48:18 +0000 (12:48 +0100)]
Bug 3899: Milestone Increase test coverage for YangTools - Types

tests for types

Change-Id: Ifd2ba78eb2c1bb915c3f172d51d6f4c42421278c
Signed-off-by: Filip Gregor <fgregor@cisco.com>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 53/34453/3
Jakub Toth [Thu, 11 Feb 2016 10:00:33 +0000 (11:00 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

InMemorySchemaSourceCacheTest

Change-Id: I883e053884c514c0c9ac343e1d6485bc9424e7ac
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 3899: Milestone Increase test coverage for YangTools 56/33856/19
Filip Gregor [Mon, 1 Feb 2016 15:25:12 +0000 (16:25 +0100)]
Bug 3899: Milestone Increase test coverage for YangTools

Tests for Dom serializer, builders

Change-Id: Id60b0f8572a64e01a8a0ff3b7792a0e38cbdce65
Signed-off-by: Filip Gregor <fgregor@cisco.com>
8 years agoDo not use String.split() 70/34570/2
Robert Varga [Fri, 12 Feb 2016 17:31:50 +0000 (18:31 +0100)]
Do not use String.split()

Instead of straight array split, use a Splitter and split to list.

Change-Id: If40131a97be64b1bc92e723d5e257e520aea32b4
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agofeatures-test is no longer published from yangtools 67/34567/2
Robert Varga [Fri, 12 Feb 2016 15:15:02 +0000 (16:15 +0100)]
features-test is no longer published from yangtools

It got moved to odlparent, reflect this fact.

Change-Id: I3db53f520a12617e9cc6894fbc7b8e96bac76a3f
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoNoddeWithValue is generic 57/34557/3
Robert Varga [Fri, 12 Feb 2016 13:12:20 +0000 (14:12 +0100)]
NoddeWithValue is generic

This fixes warnings with use of the raw type. Also cleans up references
to YangInstanceIdentifier inner classes.

Change-Id: If2f88f14e14c9b0b858187ba99a491af485e19d2
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 06/34406/2
Igor Foltin [Wed, 10 Feb 2016 15:24:51 +0000 (16:24 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools

Added unit test for DomToNormalizedNodeParserFactory.

Added unit test for declared anyxml statement.
More tests for declared yang statements will be added in the future.

Change-Id: If98d5fe6a4ac634c9060d2bbe186e0cb90482a35
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 72/34172/11
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>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 68/34268/7
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>
8 years agoBug 4079: Unable to compile pattern defined in module 84/34384/1
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>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 24/34324/3
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>
8 years agoBug 3899: Milestone: Increase test coverage for Yangtools 12/34312/2
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 26/34126/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 51/34151/2
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>
8 years agoEnable site generation for yangtools 11/27711/13
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: I280ca59132c90326f43615f9eb5d5ea601a423ae
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix javadoc formatting issues 40/34040/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>
8 years agoBUG-4662: introduce the SemVer concept 55/32455/4
Robert Varga [Wed, 13 Jan 2016 00:12:15 +0000 (01:12 +0100)]
BUG-4662: introduce the SemVer concept

This is a very simple DTO concept for semantic versions.

Change-Id: I752f36198b03c37ef4116088baf1938248a01fd2
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoFix compatibility with Java 8 type inference 90/33890/1
Robert Varga [Tue, 2 Feb 2016 12:24:11 +0000 (13:24 +0100)]
Fix compatibility with Java 8 type inference

Add a raw cast to side-step inference rules being more strict.

Change-Id: I855a687cc2d7141383c6aff57dba6adf0a5eef91
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoopendalight -> opendaylight 57/29657/3
Stephen Kitt [Fri, 13 Nov 2015 15:29:52 +0000 (16:29 +0100)]
opendalight -> opendaylight

and delete a couple of commented lines of code.

Change-Id: Ia27a2e9f049876da04894896f7befff00bf44279
Signed-off-by: Stephen Kitt <skitt@redhat.com>
8 years agoBug 4969: Unable to find base type of leafref for old yang parser types. 51/33851/1
Peter Kajsa [Mon, 1 Feb 2016 13:00:10 +0000 (14:00 +0100)]
Bug 4969: Unable to find base type of leafref for old yang parser types.

Added backward compatibility with old yang parser into
the method SchemaContextUtil.findParentModuleOfReferencingType.

Change-Id: I3e49296cb8beb45c67cda99986bffa7a8ba1a022
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoBug 4969: Invalid regex pattern for xpath conditions stripping. 80/33780/3
Peter Kajsa [Fri, 29 Jan 2016 13:56:10 +0000 (14:56 +0100)]
Bug 4969: Invalid regex pattern for xpath conditions stripping.

Original regex pattern performed greedy match.
The fix excludes square brackets inside a match.

Change-Id: I3a95a041ab87f6d9d7d4c1e1bcf70095ece24fff
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoyang.data.impl.schema.tree clean-up 89/33489/3
Stephen Kitt [Mon, 25 Jan 2016 16:32:41 +0000 (17:32 +0100)]
yang.data.impl.schema.tree clean-up

* Propagate @Nonnull and @Nullable declarations.
* Suppress unused warnings for AbstractCursor's closed field.
* Remove redundant generic type declarations.
* In AbstractDataTreeCandidateNode, make sure that either newData or
  oldData is not null (or both).
* Remove CaseEnforcer::enforceOnTreeNode() which is unused.
* Remove unnecessary semi-colons in MandatoryLeafEnforcer.
* Remove MinMaxElementsValidation::checkOriginalPresent() which is
  unused.
* SchemaAwareApplyOperation::checkConflicting indicates its result
  using an exception, so drop the return value which is always true
  (this method isn't used anywhere else in Boron).
* SchemaAwareApplyOperation::checkNotConflicting is static, so its
  final modifier is redundant.

Change-Id: I7f1ebe53753edd0b0ec5c333ac0cc2850c959f15
Signed-off-by: Stephen Kitt <skitt@redhat.com>