Robert Varga [Mon, 5 Sep 2016 06:52:34 +0000 (08:52 +0200)]
BUG-5410: fixup javadocs
With the package being moved, full path of exceptions has
changed. Use imported name instead.
Change-Id: I09fb4f0a9f5a31426b65b489da999b5f3d7c4cde
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 20 May 2016 13:32:07 +0000 (15:32 +0200)]
BUG-5410: add minimal IntStack implementation
Using Stack<Integer> forces integer boxing, which costing us performance.
This patch adds a specialized primitive-based stack, which provides the
minimal needed implementation.
Change-Id: Iee0e977ab87ce32871ddb468dbda47c4afa4e086
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Sat, 10 Sep 2016 16:03:16 +0000 (18:03 +0200)]
Bug 3899: Milestone: Increase test coverage for Yangtools
Added test for DataTreeCandidateNodes.
Added test for EnumPairImpl.
Added test for ImmutableNormalizedNodeStreamWriter.
Change-Id: I784be5c9a657fefe53a1f37595b582f09d51f8a4
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Mon, 5 Sep 2016 13:18:54 +0000 (15:18 +0200)]
BUG-5561: use canonical Bits order
This patch makes BitsTypeBuilder order the bit definitions
according to their position. It also adjusts BitsStringCodec
to normalize user input strings to the canonical ordering.
Change-Id: Ia4123a6275130619f9ef91d24b7340520707a67c
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Tue, 6 Sep 2016 07:12:15 +0000 (09:12 +0200)]
Yangtools documentation
Added more documentation to the semantic versioning section
Change-Id: I71554017ee11732ef6f6176ca70711c96ee22480
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Fri, 2 Sep 2016 13:14:34 +0000 (15:14 +0200)]
Use lambdas instead of anonymous classes
This makes the code more concise.
Change-Id: I0ce9711d0cafcf4660b78d937e5e0c9fa072da5a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 6 Sep 2016 08:18:20 +0000 (10:18 +0200)]
Fix a few warnings
Wrong javadoc and unused import.
Change-Id: I9c8a022d1289215cd50f0225bfa46b082984e668
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 5 Sep 2016 10:11:34 +0000 (12:11 +0200)]
Fix a bunch of warnings
- javadoc order
- unneeded casts
- static methods
Change-Id: I98344b7052eee1a58c709665e92d0cb1a0d72b46
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 30 Aug 2016 14:31:24 +0000 (16:31 +0200)]
Eliminate unneeded import
YangStatementParser is not used directly, only its inner class
is needed. Since it is already imported, shorten references
and clean up code.
Change-Id: Ia2298bdf20860bc936ba29234f6568adbe7462c0
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 30 Aug 2016 16:41:48 +0000 (18:41 +0200)]
BUG-6497: Do not lose augmentation statement order
This is a follow-up patch to keep augmentation order
in uses statement.
Change-Id: Iaef4aa949d225d914af3a04c111d0ec41aab6451
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Wed, 31 Aug 2016 14:53:01 +0000 (16:53 +0200)]
Yangtools documentation
Added documentation for new features introduced in boron:
- if-feature statement resolution
- semantic version processing
Change-Id: Ie31df99d428ab3eecdd40972a5977cd654c05a6b
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Tue, 30 Aug 2016 16:41:48 +0000 (18:41 +0200)]
BUG-6497: Do not lose augmentation statement order
Using an interim HashSet can cause unpredictable order
of augmentations, which means the binding spec will not
assign consistent mapping at runtime.
Fix this by using a LinkedHashSet, which retains insertion
order.
Change-Id: I503102d8b61453cc9c8d35b07158cd97138cda42
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Tue, 16 Aug 2016 13:06:58 +0000 (15:06 +0200)]
BUG-6316: Fix Bit and EnumPair's position/value types
yang.model.api.type defines the effective model of the world,
where these attributes cannot ever be null, which is in contrast
to yang.model.api.stmt, which is the declared model -- where they
can in fact be null.
Fix this discrepancy by forcing the methods to return simple types
Change-Id: I27b9d6d283cd14b2044890d9ccd19bf92647f27e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Mon, 15 Aug 2016 11:16:54 +0000 (13:16 +0200)]
Bug 6420: Fixed SemVer's valueOf method
SemVer's valueOf method now works correctly when called
with a string that contains only major and minor version.
Change-Id: Ia9656fe121d1d73bbe2dc1de87cb7bd7b445961d
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Tue, 16 Aug 2016 08:10:32 +0000 (10:10 +0200)]
Bug 6410: Fixed initialization of typedefs in rpc
In the constructor of RpcEffectiveStatementImpl we initialize substatements
of an rpc statment. However, in the for loop we are incorrectly trying to
find type substatements instead of typedef substatements.
Typedef substatements in RpcEffectiveStatementImpl are now initialized correctly.
Change-Id: Ic9a02727ffb4b6e6c798360e2266dc99d77c79e7
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Mon, 15 Aug 2016 13:14:56 +0000 (15:14 +0200)]
Bug 6419: Fixed SchemaContextEmitter's emitContainer method
Method emitContainer now emits must statements only once
through the method emitConstraints.
Change-Id: Ib818d7dc25b07df3f35559166a0ef933d19808d0
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Fri, 12 Aug 2016 13:43:06 +0000 (15:43 +0200)]
Bug 3899: Milestone: Increase test coverage for Yangtools
Added tests to DataNodeIteratorTest and SchemaContextProxyTest.
Change-Id: If446a0cc0ff415c61b53cf53f96bc49dfaccef08
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Mon, 15 Aug 2016 12:41:52 +0000 (14:41 +0200)]
Bug 6416: Fixed SchemaContextEmitter's emitIdentityrefSpecification method
Method emitIdentityrefSpecification now passes proper argument to emitBase method.
Change-Id: I16eda69b03d7da1dbefd222c11514a66568d170b
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Mon, 15 Aug 2016 12:21:44 +0000 (14:21 +0200)]
Bug 6414: Fixed DataNodeIterator's traverseModule method
Method traverseModule now gets rpc output properly.
Change-Id: Ifdf6d2685ff63bc4548ac2e6b062412e1812ae40
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Mon, 15 Aug 2016 12:12:18 +0000 (12:12 +0000)]
Revert "Bug 5968: Mandatory leaf enforcement does not work in some cases"
This reverts commit
1b987ae3e2484bbef1c9bdd7553bf0733ca06372, as it breaks lispflowmapping.
Change-Id: Ic1806c3f42dd73ecfe6357d9b7beea48c305520c
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 1 Aug 2016 10:09:24 +0000 (12:09 +0200)]
BUG-865: remove String-based getDataChildByName()
This method has been long-deprecated and should be used
only in tests. Remove it.
Change-Id: I4095154ebe83cb8df32b320db91784d509d86c11
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Thu, 28 Jul 2016 13:05:16 +0000 (15:05 +0200)]
Bug 5968: Mandatory leaf enforcement does not work in some cases
When MapEntry nodes are directly written into datatree, mandatory leaf
enforcement works correctly. However, when a List, Container or any other
parent node containing MapEntry nodes as its children is written into datatree,
datatree does not check presence of mandatory nodes of in this way written
map entry nodes.
Change-Id: I366084f87011cc7519d4c2ef46dd61a2b2df7ceb
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Michael Vorburger [Tue, 26 Jul 2016 03:46:08 +0000 (05:46 +0200)]
Intro. new yangtools.testutils artifacts (incl. Mikito)
Seeding new project with proposed Mikito (new), and a
MockitoUnstubbedMethodExceptionAnswer (alternative to
yangtools.mockito-configuration; see the package-info.java in
mockito-configuration about why this is not being proposed in that
project).
Change-Id: I78237936924e0befc0ff17e7604e0fb33262d7cd
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Igor Foltin [Tue, 9 Aug 2016 13:20:11 +0000 (15:20 +0200)]
Bug 3899: Milestone: Increase test coverage for Yangtools
Added test for SchemaContextEmitter
Change-Id: If60531f0a84579519487075a340f73e68c2526eb
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Mon, 8 Aug 2016 16:31:24 +0000 (18:31 +0200)]
Eliminate QNAME_FUNCTION
Use a method reference instead of a constant function.
Change-Id: Iaecd7a79cf86265cbb00fb60f612d2fe12577d63
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 31 Jul 2016 19:18:06 +0000 (21:18 +0200)]
Use lambdas instead of StmtContextUtils.build{Declared,Effecive}
Using lambdas at actual call sites reduces verbosity and eliminates
the need for unchecked casts and temporary variables. It also makes
call sites for the two target methods a lot more visible.
Change-Id: I4016c9ba447e22a61aeff5ca98d3adb1b80ef81b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Tue, 9 Aug 2016 10:32:58 +0000 (12:32 +0200)]
Improve yang-maven-plugin error reporting for errors in dependencies
Instead of e.g. this: [ERROR] yang-to-sources: Unable to parse yang
files from
/home/vorburger/dev/ODL/git/netvirt/vpnservice/aclservice/impl/src/main/yang
java.util.zip.ZipException: invalid LOC header (bad signature) at
java.util.zip.ZipFile.read(Native Method)
it will now report the much more useful variation like this:
java.io.IOException: Exception when reading from:
/home/vorburger/.m2/repository/org/opendaylight/netvirt/neutronvpn-api/0.3.0-SNAPSHOT/neutronvpn-api-0.3.0-SNAPSHOT.jar::META-INF/yang/neutronvpn.yang
at (...)
Caused by: java.util.zip.ZipException: invalid LOC header (bad
signature)
similar to earlier https://git.opendaylight.org/gerrit/#/c/42193/
Change-Id: Ic5bcdc8597825cdc0506516618ec13ede6433bc7
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Thanh Ha [Tue, 9 Aug 2016 13:59:36 +0000 (09:59 -0400)]
Bump ietf versions to ...10-SNAPSHOT
Bump versions according to:
https://lists.opendaylight.org/pipermail/release/2016-August/007731.html
Change-Id: I30b795af5841d2f9043ffef6395423bf41ab6e09
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Mon, 8 Aug 2016 21:50:23 +0000 (17:50 -0400)]
Bump versions by 0.1.0 for next dev cycle
Change-Id: If7bd200bcf1b559e3fdb734af65e3547ee768d51
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Tomas Cere [Mon, 8 Aug 2016 12:26:57 +0000 (14:26 +0200)]
Fix list modification with DataTree rooted at MapEntryNode
Follow up to
d8f0f2b146500275441ab8ba0cd2e1907f4b4ce4
We also need to handle the building of the list when rooted
at a MapEntry and return the correct node.
Change-Id: I60390e3fee4e34a44ee9f8836c8b9c147047691b
Signed-off-by: Tomas Cere <tcere@cisco.com>
Igor Foltin [Thu, 4 Aug 2016 12:30:34 +0000 (14:30 +0200)]
Bug 6244: Add context to exceptions thrown by yang statement parser
Yang statement parser exceptions now contain information
about the failed module and its revision. This information is
represented by SourceIdentifier.
Change-Id: I4a48b5a1e38e0b91a76ac660b131511aefce14a5
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Tomas Cere [Fri, 5 Aug 2016 11:02:58 +0000 (13:02 +0200)]
Fix list modification with DataTree rooted at MapEntryNode
If we had a data tree that was rooted at a MapEntryNode the
node modification was incorrectly enforcing a MapEntryNode when
trying to write into the dataTree.
Change-Id: I9dc02a1917f38e8a0d62279843974b9869c48693
Signed-off-by: Tomas Cere <tcere@cisco.com>
Igor Foltin [Thu, 4 Aug 2016 14:03:37 +0000 (16:03 +0200)]
Bug 3899: Milestone: Increase test coverage for Yangtools
Added several unit tests.
Change-Id: I67d1b4fa4f879d4af186e6c42c724d66de9ca5d2
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Sun, 31 Jul 2016 18:44:00 +0000 (20:44 +0200)]
Do not use revision in AbstractEffectiveDocumentedNode
Extracting reference from RevisionStatement inside any
DocumentedNode is invalid. RevisionStatements hold their
own reference and they are valid only for modules and
submodules -- which have a reference of their own.
Change-Id: I4522ebbc0449462f80609c1eb06f6a486f4af7af
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 1 Aug 2016 09:51:24 +0000 (11:51 +0200)]
BUG-865: hide SchemaPath constructor
SchemaPath should not be subclassed outside of this package,
hide its constructor.
Change-Id: I7d5a73dcc537572220a831a0804deccf0d9f6e9d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 1 Aug 2016 09:51:02 +0000 (11:51 +0200)]
Fix wrong javadoc
This is a copy&paste error, correct it.
Change-Id: Ia48b02c6bf28c5e8ca9338ebbfef50e3c6a7f2bc
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 1 Aug 2016 09:45:04 +0000 (11:45 +0200)]
BUG-865: Remove deprecated XmlStreamUtils constructor
This constructor is no longer used and the class should not be subclassed.
Remove it.
Change-Id: If7b8d470ea66b2a99ec2fe9c4b978571c2413ff1
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 1 Aug 2016 09:39:01 +0000 (11:39 +0200)]
BUG-865: remove CloneableChildrenMap
This class has been deprecated and is not used anywhere. Remove
it.
Change-Id: I7d554de0b50e273a4468f247fdc73a10fdcb6e49
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 31 Jul 2016 13:48:23 +0000 (15:48 +0200)]
BUG-865: remove JSONCodec.needQuotes()
This method is not anywhere and is part of internal contract,
remove it.
Change-Id: I9196b1257422598c97c12cabac97f87773d0993f
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 31 Jul 2016 18:29:58 +0000 (20:29 +0200)]
Make Bit/EnumEffectiveStatementImpl inherit AbstractEffectiveDocumentedNode
This removes a bit of code duplication and also fixed EnumEffectiveStatement
not reporting UnknownSchemaNodes.
Change-Id: I7fd1c99d364c9f3d11dd49be77e3a6e650be4c16
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 31 Jul 2016 14:45:47 +0000 (16:45 +0200)]
BUG-865: add proper nullness annotations
This fixes the mistake of making DocumentedNode.getStatus()
nullable and adds explicit annotations to DocumentedNode,
SchemaNode and UsesNode.
Change-Id: Ibc773feeca2a3f61d8a74c5b6cbc3028a2f4d260
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 31 Jul 2016 14:25:01 +0000 (16:25 +0200)]
BUG-865: remove MustDefinitionImpl
This implementation is not used anywhere, remove it.
Change-Id: I10de6d971d6e2f7f66fbc073ba9272648ba2ddd8
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 31 Jul 2016 14:20:43 +0000 (16:20 +0200)]
BUG-865: Move ModuleImportImpl and hide it
This implementation is used only in the parser,
move it to parser and hide it.
Change-Id: I9a469c01de5a5c077e6fd5aaf52ac6625fcce496
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 29 Jul 2016 12:30:40 +0000 (14:30 +0200)]
BUG-865: remove BitImpl
Introduce a BitBuilder and remove public BitImpl class.
Change-Id: Icf6297192cba21773a89b87bae817ebb0eebad9e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 29 Jul 2016 12:11:08 +0000 (14:11 +0200)]
Propagate @Deprecated annotation
getDataChildByName(String) is deprecated, do not shadow
the annotation.
Change-Id: Ib1dbf3e7ea81bde65f79612854588315027398d8
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 28 Jul 2016 02:35:03 +0000 (04:35 +0200)]
BUG-865: remove deprecated EnumPairImpl
With all users migrated, this class can safely be removed.
Change-Id: I939ed0b1d127dabadd45134a83d50a7d3073ac74
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Tue, 19 Jul 2016 13:17:36 +0000 (15:17 +0200)]
Bug 5518: Beryllium yangtools gives error parsing files with Tail-F deref statement
Added unit test which creates SchemaContext from yang model which contains call
of DEREF function in xpath expression of MUST statement. Both SchemaContext and
RevisionAwareXpath are created successfully.
Change-Id: I528da17dcd758d8c40904a6692603a833651d5e1
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Isaku Yamahata [Fri, 8 Jul 2016 00:23:04 +0000 (17:23 -0700)]
Bug 6112 - yang data impl: teach codec union+identityref
Identityref requires special handling on serialization/deserialization.
This patch teaches it to yang data codec.
Change-Id: Ib229e8cd5d65baff562945ecdac32982549a7cc6
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 24 Jul 2016 22:21:42 +0000 (00:21 +0200)]
Refactor ModifyAction
Change-Id: I22356a00d1249f87c9c69af0945d51d8d80e9325
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Thu, 14 Jul 2016 10:46:14 +0000 (12:46 +0200)]
Bug 6180 - Parser: Backslash double-quote in double-quoted string not recognized
Statement parser removes all double or single quotes from strings,
what is incorrect. This fix removes only first and last quotes if they are
present. All other quotes in the string should be escaped already, since the
ANTLR parser recognizes only correctly enclosed strings.
Further, substitution of backslash-escaped characters in
double-quoted strings is done.
Change-Id: I2f596c73be05178dc5cbebaed12e25e428454219
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Ajay [Mon, 25 Jul 2016 07:48:01 +0000 (07:48 +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.
Change-Id: I911eef98898f2269b31378b383617373c1b47903
Signed-off-by: Ajay <ajayl.bro@gmail.com>
Robert Varga [Thu, 28 Jul 2016 02:33:33 +0000 (04:33 +0200)]
BUG-865: Deprecate EnumPairImpl
Leaking implementation classes leads to badness when users
use them instead of interfaces. Deprecate EnumPairImpl and provide
an alternative available via EnumPairBuilder.
Change-Id: I9a11a6fa54da1ef9594fdb8318fea9482b0703c3
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 27 Jul 2016 22:15:54 +0000 (00:15 +0200)]
Use TypedSchemaNode
Now that we have introduced the concept, use it for common
codepaths.
Change-Id: I8dd9436fc270ee19661971b2990c4a82abda6097
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 26 Jul 2016 21:38:12 +0000 (23:38 +0200)]
Introduce common interface for getValue() method
LeafNode and LeafSetEntryNode both share this method. Codec-type users
benefit from being able to call on a common interface bridging the two
otherwise unrelated classes.
Change-Id: I5ef86c6859cf6cb7620aa3e4477941f248640c4f
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 26 Jul 2016 21:14:25 +0000 (23:14 +0200)]
Move Leaf(List)SchemaNode.getType() to a common interface
This helps users such as the Java Binding implementation.
Change-Id: Iec2b47f6b6e5974e506edc25905c3a77ee167565
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 26 Jul 2016 11:29:23 +0000 (13:29 +0200)]
BUG-865: move getUnknownSchemaNodes to DocumentedNode
We already duplicate this method in SchemaNode and UsesNode.
Furthermore EnumPair is actually a DocumentedNode with unknown
nodes.
Move the method definition to DocumentedNode with a default
implementation which returns an empty list. This allows a more
substantial change, which is making EnumPair not a SchemaNode,
but a DocumentedNode.
Change-Id: I0524d9905aea55f150bff88ca022c4467881c367
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 18 Jul 2016 16:32:41 +0000 (18:32 +0200)]
BUG-865: make EnumPair getQName/getSchemaPath unimplemented
EnumPairs by definition do not have SchemaPath, which makes
them non-SchemaNodes. As a first step make the methods
unimplemented so we can catch offenders.
Change-Id: I19cb47368ea5b575fa2ce89bb0c4b6a934bdaae3
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Mon, 25 Jul 2016 22:30:35 +0000 (00:30 +0200)]
Package JavaDoc to clarify what this artifact is & does
Full disclosure: I LIKE the concept of what one could call
MockitoNotImplementedExceptionAnswer, and have separately implemented
the same (one can find this idea publicly on the web in several places).
I don't think having this configured by default automagically is good;
that is just too sneaky and surprising IMHO. One should be able to use
a popular utility and expect it to behave as it's documented?
No offense meant to anyone. None taken I hope.
Change-Id: Idf30e82c2cb1777065de781a5eecc220416161ca
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Mon, 25 Jul 2016 23:12:40 +0000 (01:12 +0200)]
Checkstyle clean up about 200 trivial violation
I've intentionally started with the very simple formatting type changes
here. This does not take care of everything yet, but it's a start.
Hopefully sending a few batches also makes it easier (AssertionError e)
{to review.
Change-Id: Ibf328746c6880138a56eb36837bc8e789647b9bd
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Mon, 25 Jul 2016 22:46:08 +0000 (00:46 +0200)]
Organize Imports to be Checkstyle compliant in utils
Change-Id: I7bf2721ea5cbe310d73fd1f5f7784395bd44d871
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Robert Varga [Wed, 20 Jul 2016 13:44:27 +0000 (15:44 +0200)]
Fix a few warnings
Use of raw type and use of deprecated junit methods.
Change-Id: Iafd1c515eb2b1598e56a0d4e4f19b459fce47aab
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Thu, 21 Jul 2016 10:46:22 +0000 (12:46 +0200)]
Bug 6240: Entities of imported module's submodule are not visible
Yang statement parser didn't lookup yang elements in submodules of imported module.
Therefore each submodule element was always invisible to other modules even if they
imported parent module of the submodule.
This patch adds IncludeContext to the each RootStatementContext in order to allow
lookup of yang elements also in included submodules.
Change-Id: I9993b9fe110a5e80e9a61258a40841af13c18320
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Robert Varga [Sun, 24 Jul 2016 17:16:41 +0000 (19:16 +0200)]
Fix checkstyle errors and activate enforcement for concepts
In an effort to clean our code up, this activates enforcement
of checkstyle rules in concepts and makes sure the build passes.
Change-Id: Ide488a7e4664ff146c23f5f84a2a284055dcb0b3
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 24 Jul 2016 15:54:24 +0000 (17:54 +0200)]
Kill trailing whitespace
Addresses checkstyle warnings about trailing whitespace.
Change-Id: Iaa05edcdb22138ec805ab782d94be7f2c8de6458
Signed-off-by: Robert Varga <rovarga@cisco.com>
Thanh Ha [Sat, 23 Jul 2016 01:27:29 +0000 (21:27 -0400)]
Add missing license headers
Change-Id: I5a284260b0700e605ca6781131191955339df3eb
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Robert Varga [Wed, 13 Jul 2016 08:45:10 +0000 (10:45 +0200)]
BUG-865: remove SourceIdentifier.cachedReference()
This has been superseded by SourceIdentifier.intern().
Change-Id: Idf5deb6653180e9b9185cb34182ff4cf07da7685
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Thu, 21 Jul 2016 01:58:22 +0000 (03:58 +0200)]
Improve yang-maven-plugin error reporting
Instead of e.g. this: org.apache.maven.plugin.MojoFailureException:
Failed to scan for YANG files in depedencies (...) Caused by:
java.util.zip.ZipException: invalid CEN header (bad signature) at
java.util.zip.ZipFile.open(Native Method)
it will now report the much more useful variation like this:
org.apache.maven.plugin.MojoFailureException: Failed to scan for YANG
files in dependency:
/home/vorburger/.m2/repository/org/opendaylight/openflowplugin/model/model-flow-base/0.3.0-SNAPSHOT/model-flow-base-0.3.0-SNAPSHOT.jar
Change-Id: I1062d10d9157f9ac6b44cd86a29af8cc8e87b25f
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Thu, 21 Jul 2016 02:06:59 +0000 (04:06 +0200)]
Fix minor bug in (new) LogMessageExtractorCheck
Normally the target/ directory already exists of course, but if you e.g.
run just "mvn process-sources" then, on some project, the target/
directory may not exist (yet) - and thus this code must ensure it
creates it.
Change-Id: I764e3673433a4abb6819b883f24d7622ac2f352b
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Thu, 21 Jul 2016 01:05:00 +0000 (03:05 +0200)]
Checkstyle clean-up src/test/java
Required to be able to run (enforce) CS on src/test as well.
Change-Id: Ifa974a62fc5d912fc6e8a710851da7618254e256
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Robert Varga [Fri, 15 Jan 2016 20:48:21 +0000 (21:48 +0100)]
BUG-865: Remove DataTreeFactory#create()
This method has been deprecated in favor of more specific create
methods. Remove it.
Change-Id: I5631f8e6354ea8abd5002241d5ecbc6e51b5c584
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Mon, 18 Jul 2016 16:38:46 +0000 (18:38 +0200)]
BUG-865: remove CrossSourceStatementReactor.buildEffectiveMappedToSource()
This method has been deprecated and is used by a test. Remove the test
and the method.
Change-Id: Icf44b4361626dd6cf470d8e7547adfbcd1784ac8
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 18 Jul 2016 16:42:24 +0000 (18:42 +0200)]
Make YangToSourcesProcessor methods static
Utility methods can be made static.
Change-Id: I1ad42b3f83fb661c6ec0022d213d4946dbf1157a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 18 Jul 2016 16:21:24 +0000 (18:21 +0200)]
BUG-865: remove SchemaContextUtil.findParentModuleByType()
This method has been deprecated and is no longer used
anywhere: remove it.
Change-Id: Idd5d1398f9743e301ed4a8a71de053128b354bf7
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 18 Jul 2016 16:19:44 +0000 (18:19 +0200)]
BUG-865: remove deprecated BaseTypes constants
These constants have been deprecated and are no longer
used anywhere.
Change-Id: Ied9ae9303eeb76a8f7de99e74ff3a7f44cc8aa3b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 18 Jul 2016 16:15:51 +0000 (18:15 +0200)]
BUG-865: remove InstanceIdentifierTypeDefinition#.getPathStatement()
Remove this deprecated method.
Change-Id: Id54fdfecc8601fa1c85870ee1334e650813ac07d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 18 Jul 2016 16:12:59 +0000 (18:12 +0200)]
BUG-865: remove DataSchemaNodeAware
This interface has been integrated into NormalizedNodeStreamWriter
and has no other users: remove it.
Change-Id: If7d6923c52f15fdc79784edcbb8b665368961082
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 18 Jul 2016 16:08:17 +0000 (18:08 +0200)]
BUG-865: remove SchemaContextHolder
This interface has been deprecated and is not used by any
live code, remove it.
Change-Id: Ibb556ada5bedba765cac5d375ec52024c5f3ef06
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 6 Jul 2016 09:51:12 +0000 (11:51 +0200)]
BUG-865: eliminate getYangText()
Change-Id: Id8a952cb7b299e1eccd49279f91bf6bf41b8986e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Tue, 19 Jul 2016 17:05:46 +0000 (19:05 +0200)]
Fix bug FileNotFoundException: target/logger-messages.txt polluting logs
Change-Id: I1f9bfd493d1554b4d081738c7bb6e4a30fa19290
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Robert Varga [Mon, 18 Jul 2016 14:19:35 +0000 (16:19 +0200)]
Remove use of Guava Charsets
We have StandardCharsets, use those.
Change-Id: I92677e8a72cf16fc03df25226c967221959f14c5
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Thu, 23 Jun 2016 07:11:36 +0000 (09:11 +0200)]
Bug 6022: Deviation statement is not fully available in the YANG parser output
- deviation statement can now contain one or more deviate statements
as it is defined in rfc6020
- deviate statement now provides more information about deviated statements
Change-Id: I38ebb5932626df9a0c2de00220474a88ca7f2bc9
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Michael Vorburger [Wed, 25 May 2016 12:58:03 +0000 (14:58 +0200)]
New LogMessageExtractorCheck which writes out TXT report of all loggers
Change-Id: I853c742901131293c58c78bea821fe0d12957f07
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Tomas Cere [Tue, 24 May 2016 09:01:14 +0000 (11:01 +0200)]
Add toString() to InMemoryDataTreeCandidate
Change-Id: I9ece88ef6e2c5db17f46d732316f52984269d7d3
Signed-off-by: Tomas Cere <tcere@cisco.com>
Michael Vorburger [Thu, 7 Jul 2016 16:27:45 +0000 (18:27 +0200)]
Fix YangToSourcesPluginTestIT failure
Inspired by
http://blog2.vorburger.ch/2016/05/how-to-make-maven-archetype-plugin.html
The YangToSourcesPluginTestIT obviously does pass on Jenkins, but that
relies on magical environment variables. I'm sure it also works locally
for those who use the custom ODL settings.xml globally - but I don't; I
just use "mvn -s odl.xml" kind of thing. This fix makes the
YangToSourcesPluginTestIT pass even then, because it will now re-use the
real "effective" settings XML under which Maven was started.
Change-Id: I1edbed691ac1a01c8bfc1c8178d4836781aba0a1
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
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>
Peter Kajsa [Thu, 14 Jul 2016 08:45:41 +0000 (10:45 +0200)]
Bug 6131 - NPE on malformed yang model
Handling of NPE when source model does not contain any
valid root element.
Change-Id: I76d4aeb257cd2e20e75447fa2fc53e455063a8ae
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Michael Vorburger [Tue, 5 Jul 2016 18:01:27 +0000 (20:01 +0200)]
Performance related changes
Gets the related code out of the Hot Methods in JMC, but overall still
seems to have very little bottom line impact, as far as I can tell.
Still not a bad idea to apply though, I think.
Bug 6158
Change-Id: I8e76b63d4b5e5a3d6ddebb8aec3434e40189031d
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
David [Thu, 7 Jul 2016 12:59:29 +0000 (14:59 +0200)]
Fix yang.skip feature to include all files needed
The generation process, as a side-effect, is also including
some META-INF folders to the project final files. When
skipping the generation process, this inclusion must
be done separately
Change-Id: I1e2d2f48a2fc5b33c06ba83258a477b5a046ee08
Signed-off-by: David <david.lopez.munoz@ericsson.com>
Robert Varga [Thu, 7 Jul 2016 10:36:43 +0000 (12:36 +0200)]
BUG-865: eliminate ExtendedType and DerivedType
ExtendedType is no longer used anywhere, hence DerivedType
is not needed, too. Eliminate both of them.
Change-Id: I2062056b93a00c5b8305a841359ae0fa8356d086
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Thu, 30 Jun 2016 11:55:10 +0000 (13:55 +0200)]
Bug 6134: Introducing of DataTreeConfiguration concept
Introducing of DataTreeConfiguration concept which allows to set up appropriate
configuration of data tree (e.g. enable/disable some validations etc.)
This can be useful when some type of strict validation is not required or useful for some
reasons.
Change-Id: I913dec079e8e2617ef4d0f4954f2b1c332fa7e3b
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Peter Kajsa [Thu, 7 Jul 2016 08:31:49 +0000 (10:31 +0200)]
Bug 6158: Optimization of if-feaures resolution during SchemaContext assembly
It is unnecessary to check both declared and effective substatements everytime,
because effective substatements are empty at the beginning and they are filled
subsequently by copying of declared. Therefore this patch check whether
a feature is supported only for declarted statements during their build and
also creation of their copy.
In addition this patch introduces ALL_FEATURES predicate constant. The constant
is passed as argument into default SchemaContext build, and so we can simply
return true and skip rest of areFeaturesSupported method.
Moreover the result of areFeaturesSupported method is cached and so it is
not computed more times for any statement.
Change-Id: If8c87975712b65f9f28b640ac0b634576e08c191
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Stephen Kitt [Tue, 14 Jun 2016 14:12:12 +0000 (16:12 +0200)]
Drop yangtools-parent
This emerged from trying to use odlparent's bundle-parent for bundles,
and thus be able to remove the yangtools overrides for
maven-jar-plugin and maven-javadoc-plugin in particular.
This probably removes features from yangtools-parent which should be
replicated elsewhere; in particular, the Sonar/JaCoCo integration
should be available for everyone.
Change-Id: Id41e61eb3da2f30be29981a11387bde467acae3d
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Thu, 7 Jul 2016 10:16:56 +0000 (12:16 +0200)]
BUG-865: remove deprecated types
This removes deprecated types in yang.model.util.
Change-Id: I8c24e54a172ad67dc6620415f0abaf98e6e323a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Thu, 7 Jul 2016 16:22:49 +0000 (18:22 +0200)]
Minor refactoring in YangToSourcesPluginTestIT
Just to reduce a few lines of copy/paste. I actually did this because I
wanted to call the factored out method for a real fix, but then ended up
not using it; so I'm putting in this proposed minor refactoring as a
first small low prio change, and the more important real fix as a
separate change coming up next.
Change-Id: Ic888310f1ae74e58eaa96e41c0cb53ab2215023e
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Filip Gregor [Fri, 10 Jun 2016 11:26:00 +0000 (13:26 +0200)]
Bug 5884: Augmenting a choice without a case results in no getter
binding generator can not generate correctly getters for
augmented case shortHand.
added new namespace, added short hand case for augments
shortHand is created when augmenting choice with
case shortHand
Change-Id: I8543834bf3e3cf5e222d60617f116aca3639bc82
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Peter Kajsa [Thu, 2 Jun 2016 14:31:06 +0000 (16:31 +0200)]
Bug 5942: When condition of uses node is not exposed by the YANG parser
Interface UsesNode does not provide any method to obtain When condition,
Description, Status, Reference and UnknownNodes defined in yang source.
This patch provides API definition and its implementation necessary to get
these substatements of UsesNode.
Change-Id: I51e182de247a9375e4e28d76d7fecb421721cfc4
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 22 Jun 2016 14:37:16 +0000 (16:37 +0200)]
BUG-865: Remove SchemaAwareNormalizedNodeStreamWriter
This functionality has been integrated into NormalizedNodeStreamWriter
and there are no outside users: remove the interface.
Change-Id: Ib66c3731682441dfe32b7f411400766b0825a48b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Tue, 28 Jun 2016 23:45:26 +0000 (01:45 +0200)]
Avoid catch (NullPointerException e), take II
Sorry for redoing this, but the first version last night wasn't my
finest code; multi return is bad style (and rejected by Checkstyle
checks in sevntu.checkstyle core).
Change-Id: Icdd72c99b54e23f8434577e61a6852aeca92d331
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Robert Varga [Wed, 22 Jun 2016 13:01:10 +0000 (15:01 +0200)]
BUG-865: remove UnknownBoundaryNumber
This is superseded by UnresolvedNumbder and not used anywhere.
Change-Id: I54c6cb315e311412015b3c5d082da03f9fe83455
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 22 Jun 2016 12:51:55 +0000 (14:51 +0200)]
BUG-865: Remove URLSchemaContextResolver
URLSchemaContextResolver is replaced by YangTextSchemaContextResolver.
Change-Id: Ia39e00eff649f0c515fa8257cd8061e6e501e39f
Signed-off-by: Robert Varga <rovarga@cisco.com>