Robert Varga [Fri, 20 May 2016 12:20:18 +0000 (14:20 +0200)]
BUG-5410: turn Token types into proper constants
This changes the syntax to ensure tokens are initialized
as constants.
Change-Id: I2bcac83c813695444cead29afd172985072f926b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 20 May 2016 10:32:09 +0000 (12:32 +0200)]
BUG-5410: bring the imported source code to Java 7 world
This patch adds generic type arguments to Stack and Hashtable. The
bulk of the patch are Eclipse auto-save actions, performing the following:
- remove unneeded casts
- remove trailing whitespace
- add @Override annotations
- add curly braces around ifs
Change-Id: I118d5559cb5a5edb9a79e097903732911987afe9
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 20 May 2016 09:38:10 +0000 (11:38 +0200)]
BUG-5410: initial import of Xerces RegularExpression
This is a minimal code drop of XSD regular expression implementation
from Xerces-J, subversion commit
1744677.
In order to prevent classpath clashes, the code is imported as
org.opendaylight.yangtools.xsd.regex. We do not import
org.apache.xerces.util.IntStack and use a Stack<Integer> instead.
Change-Id: I3f678f274a2cd8a7c07cc11f631490b127b8323c
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Wed, 1 Jun 2016 06:25:40 +0000 (08:25 +0200)]
Remove usage of deprecated yang parser classes
- stop using deprecated classes related to the old yang parser
- a little bit of code clean-up
Change-Id: Iab22b89b31c4a10b62bf51e022d4dfa435f03426
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Peter Kajsa [Wed, 6 Apr 2016 09:19:27 +0000 (11:19 +0200)]
Test of multiple revisions of module
Added unit test for case when more revisions of a module are available.
Change-Id: I3079171c84ca946d5af4186b5bcdd03d04d22891
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Peter Kajsa [Wed, 30 Mar 2016 11:27:34 +0000 (13:27 +0200)]
Bug 4662: Introduce a SemanticVersion concept - import processing
Added new semantic version processing mode to yang statement parser.
If the mode is enabled, each module import is processed based on the specified
semantic version and revision date of import statement is ignored.
- fix of SemVer's compareTo method
- fix of Yin statements argument parsing
- added Yang unit tests
- added Yin unit tests
- fix of module imports resolving and module dependency sort
for cases when semantic versioning is enabled
- added StatementParserMode
- unit test fix
Change-Id: Ibf0519c3ec8fec85763e0a13059c1b8af91276ba
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Robert Varga [Thu, 2 Jun 2016 17:41:30 +0000 (19:41 +0200)]
Scripted update of if statements
These trigger checkstyle warnings, hence turn both 'if( ' and 'if('
into proper 'if ('. Same for for and while.
Change-Id: I78714d3370806cccc3f42ae9a15d4d14ba1361c3
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Wed, 25 May 2016 14:17:54 +0000 (16:17 +0200)]
Remove all not directly custom Logger check related modules declarations
All of these are now in odlparent.checkstyle odl_checks.xml; see
https://git.opendaylight.org/gerrit/#/c/39416/
Change-Id: I47e11df8bacd2685f1b7d52bb4cef2e03f54460d
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Peter Kajsa [Thu, 26 May 2016 12:50:13 +0000 (14:50 +0200)]
Bug 5946: Unique statement is not exposed by the YANG parser
The YANG parser did not expose the unique constraint of list schema node.
This patch adds API definition for unique constraints exposing and provides
also its implementation in yang statement parser.
Change-Id: If844248c81651a96c13487ea5b5eacdcd80107a5
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 30 May 2016 09:06:08 +0000 (11:06 +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>
Michael Vorburger [Wed, 25 May 2016 09:51:31 +0000 (11:51 +0200)]
Fix @Deprecated checkstyle.api.Check to new AbstractCheck
Change-Id: I8f1ae86a3463f18ba422d5d889c86688a3cff042
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Fri, 27 May 2016 09:53:55 +0000 (11:53 +0200)]
.gitignore .factorypath created by m2e-apt
https://github.com/vorburger/opendaylight-eclipse-setup now bundles
https://github.com/jbosstools/m2e-apt, which creates .factorypath files
all over the place.
Change-Id: Ia6b50206547dda2ad95703e584c9cd40b250aab8
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Wed, 25 May 2016 09:46:40 +0000 (11:46 +0200)]
Minor inline code comment to clarify TestClass has intentional CS issues
Change-Id: I96133746447dd909cb55b45cbe4dfdca278b1bde
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Wed, 25 May 2016 09:48:58 +0000 (11:48 +0200)]
Conform to our own Checkstyle rules in checkstyle-logging utility
This seems like a sensible start, to make even our own Checkstyle custom
rules code conform to our other Checkstyle rules? ;-)
Change-Id: I746aba394590e3bf6df873be10ac6e4e87e6ea87
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
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>
Igor Foltin [Tue, 24 May 2016 11:51:22 +0000 (13:51 +0200)]
BUG-5917: validate TransformerFactory
Karaf-3.0.6 ships with Xalan as the default javax.xml.transform implementation.
Unfortunately it does not support StAXResult as the target of transformation,
rendering the writer useless.
Add a fallback to JVM-internal implementation if we detect that the default
factory cannot support StAXResult
Change-Id: I7151b0df8068c85ca53a85edd4894ac1ba70eece
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Tomas Cere [Fri, 13 May 2016 15:43:22 +0000 (17:43 +0200)]
Add application of RootedDataTreeCandidates
Allows applications of DataTreeCandidates that are rooted in one
DataTree to another DataTree(comes in handy with sharded datastore
when building notifications)
Change-Id: I78ad88aed4453924c1594c7e8e47ffddd71c6282
Signed-off-by: Tomas Cere <tcere@cisco.com>
Igor Foltin [Fri, 13 May 2016 09:42:06 +0000 (11:42 +0200)]
Bug 4506: Honor if-feature during SchemaContext assembly
If-feature statements in yang modules are now resolved
during SchemaContext assembly based on
a java.util.function.Predicate<QName> provided by user.
This functionality is also introduced into SchemaContextFactory
Change-Id: I2a74e36c9433a0b89c97c19407c988b538c236bc
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Fri, 20 May 2016 10:11:14 +0000 (12:11 +0200)]
Bug 5917: master fails mounting controller-config
Set TransformerFactory in XmlStreamNormalizedNodeStreamWriter
to use the implementation from this package:
com.sun.org.apache.xalan.internal.xsltc.trax
Change-Id: Ie98c50c34ad6e8e7605188d67bd8e1942b0a7c85
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>