yangtools.git
7 years agoBUG-6965: introduce BuiltinDeclaredStatements 23/47323/2
Robert Varga [Thu, 20 Oct 2016 16:31:11 +0000 (18:31 +0200)]
BUG-6965: introduce BuiltinDeclaredStatements

This patch adds squashing of YANG builtin types into
singletons when such types are not otherwise modified.

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

7 years agoBUG-6964: define a namespace to hold model-defined statements 22/47322/1
Robert Varga [Thu, 20 Oct 2016 12:22:50 +0000 (14:22 +0200)]
BUG-6964: define a namespace to hold model-defined statements

This patch adds a new namespace, StatementDefinitionNamespace,
which holds StatementDefinitions for all extensions defined in
the models being processed.

This namespace is then used to acquire a shared definition instead
of instantiating a definition everytime it is referenced.

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

7 years agoBug 6491: Some imports are not exposed in Module.getImports 17/47317/2
Filip Gregor [Wed, 19 Oct 2016 13:57:33 +0000 (15:57 +0200)]
Bug 6491: Some imports are not exposed in Module.getImports

in case of no revision in module and imported module, method
getImports returns empty Set.
added tests, fixed Set with imports in AbstractEffectiveModule

Change-Id: Ie23196d9cbcca98266580d11a85d66c06ac8561c
Signed-off-by: Filip Gregor <fgregor@cisco.com>
(cherry picked from commit a9aa900b8c5d1dbe16011a0c6c0f00cbb2ec105e)

7 years agoBug 6961: SchemaContext.getAllModuleIdentifiers() doesnt work for submodules 14/47314/1
Filip Gregor [Wed, 19 Oct 2016 11:41:28 +0000 (13:41 +0200)]
Bug 6961: SchemaContext.getAllModuleIdentifiers() doesnt work for submodules

added submodules to return value from method getAllModuleIdentifiers

Change-Id: I9f328d0050457b7094cbb420f0e0205b8034cf6f
Signed-off-by: Filip Gregor <fgregor@cisco.com>
(cherry picked from commit 097a1cc73aa3ffbf1898b38cba4f6c66956a4c3b)

7 years agoReuse cardinality constants 93/47193/1
Robert Varga [Tue, 18 Oct 2016 00:20:16 +0000 (02:20 +0200)]
Reuse cardinality constants

0..1, 0..MAX and 1..1 are common cardinalities. Instead of leaking the MAX constant
create additional builder methods which reuse Cardinality objects.

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

7 years agoFix inefficient ConstraintEffectiveStatements 71/47171/2
Robert Varga [Tue, 18 Oct 2016 14:28:35 +0000 (16:28 +0200)]
Fix inefficient ConstraintEffectiveStatements

Leaking a mutable ArrayList is incorrect, as the result
should be immutable. Furthermore not providing a hint
results in wasted space. Fix this by copying the temporary
ArrayList into an ImmutableList.

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

7 years agoFix GroupingEffectiveStatementImpl's unknown nodes 70/47170/1
Robert Varga [Tue, 18 Oct 2016 14:30:07 +0000 (16:30 +0200)]
Fix GroupingEffectiveStatementImpl's unknown nodes

Heap analysis has pointed out a linked list, which is both
a correctness problem (it should be immutable) and efficiency
issue, as most of the time this list should be empty.

Use ImmutableList.Builder to build an immutable list of
unknown statements.

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

7 years agoBUG-4456: add RecursiveExtensionResolver 84/47084/1
Robert Varga [Mon, 17 Oct 2016 21:58:54 +0000 (23:58 +0200)]
BUG-4456: add RecursiveExtensionResolver

This patch adds a hack which allows us to instantiate
recursive extensions. The solution is rather ugly, but
should be workable.

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

7 years agoBUG-6757: revert fix for BUG-4456 41/47041/2
Robert Varga [Mon, 17 Oct 2016 20:19:54 +0000 (22:19 +0200)]
BUG-6757: revert fix for BUG-4456

The fix has introduced a massive memory leak, which causes
all of temporary build objects to be retained in the final
SchemaContext.

Instead of the leak, add an explicit guard to detect
extensions (transitively) referencing themselves.

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

7 years agoFix failing unit test in QueuedNotificationManagerTest 70/47070/1
Igor Foltin [Tue, 18 Oct 2016 10:02:48 +0000 (12:02 +0200)]
Fix failing unit test in QueuedNotificationManagerTest

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

7 years agoUse lambdas instead of anonymous classes 40/47040/1
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>
(cherry picked from commit f6eae2a11c570c1097eb9202debc7e36ce72ef6d)

7 years agoUse lambdas instead of StmtContextUtils.build{Declared,Effecive} 39/47039/1
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>
(cherry picked from commit 7e9cdeeef2d18011f43bd848267e13855655f8ad)

7 years agoBUG-5561: use canonical Bits order 16/47016/1
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>
(cherry picked from commit b3315a133684c91930b8e2f4004a327e50d48954)

7 years agoFix a bunch of warnings 15/47015/1
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>
(cherry picked from commit 7ee0100fadc14a764b1d971013d28f057457f20e)

7 years agoIntro. new yangtools.testutils artifacts (incl. Mikito) 80/45880/2
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>
(cherry picked from commit f07653736cdf6665a0ab8e39fe5427a095c1730b)

7 years agoAdd YangInstanceIdentifier fast paths 53/46353/2
Robert Varga [Tue, 20 Sep 2016 14:24:18 +0000 (16:24 +0200)]
Add YangInstanceIdentifier fast paths

Each YangInstanceIdentifier contains() itself and its
.toRelative() is always empty.

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

7 years agoUse YangInstanceIdentifier.EMPTY 52/46352/2
Robert Varga [Fri, 23 Sep 2016 13:44:25 +0000 (15:44 +0200)]
Use YangInstanceIdentifier.EMPTY

Eliminate an internal constant by referring to the well-known
public constant.

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

7 years agoBug 6771: Problem with typedefs nested in augment 51/46351/1
Peter Kajsa [Tue, 27 Sep 2016 12:05:22 +0000 (14:05 +0200)]
Bug 6771: Problem with typedefs nested in augment

When a typedef is nested in a container that is in an augment,
the YANG parser produces an error. This is due to fact, that typedef
statements nested in augments are ignored in statement definition phase,
because AugmentStatement is supported only in full definition phase. The
same issue occurs also for Choice and Case statements. This patch
provides fix of these bugs.

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

7 years agoAllow QueuedNotificationManager to batch notifications 43/46143/1
Robert Varga [Wed, 21 Sep 2016 15:29:57 +0000 (17:29 +0200)]
Allow QueuedNotificationManager to batch notifications

This patch reworks the queueing logic so that notifications
get completely read from the queue and then propagated to the
listener invoker in one go.

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

7 years agoAdd batching to QueuedNotificationManager 36/46136/1
Robert Varga [Tue, 20 Sep 2016 22:57:00 +0000 (00:57 +0200)]
Add batching to QueuedNotificationManager

Introduce BatchedInvoker, which allows multiple events to be
delivered in one go.

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

7 years agoCleanup QueuedNotificationManager 27/46127/1
Robert Varga [Tue, 20 Sep 2016 21:59:32 +0000 (23:59 +0200)]
Cleanup QueuedNotificationManager

Audit code for coding style and unnecessary checks.

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

7 years agoBug 6551: Support for third-party Yang extensions implementation 49/46049/1
Peter Kajsa [Tue, 6 Sep 2016 12:35:02 +0000 (14:35 +0200)]
Bug 6551: Support for third-party Yang extensions implementation

Minor changes in yang statement parser in order to allow implementation
of custom inference pipeline.
- implementation of CustomStatementParserBuilder, which provides
construction of custom statement parser in user-friendly way.
- example and unit test of third-party extension plugin.

Change-Id: I0cdf0e28bd69af4cb41328be6e6a647df58f4fd9
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoFix ConstraintDefinition inconsistency 21/45821/2
Robert Varga [Mon, 19 Sep 2016 12:49:42 +0000 (14:49 +0200)]
Fix ConstraintDefinition inconsistency

The API contract around min/max elements is unclear, but the intent
is to provide a simple 'no effective constraint' result. This is
represented by a null return, which is in fact what the users expect.

Clarify the API contract and fix the two implementations to follow
it instead of using 0/MAX_INT for constraints.

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

7 years agoBumping versions by 0.0.1 for next dev cycle 53/45653/1
Anil Belur [Thu, 15 Sep 2016 22:38:04 +0000 (08:38 +1000)]
Bumping versions by 0.0.1 for next dev cycle

Change-Id: I10c423dd908a899ece7f186bf821a070a26770d6
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
7 years agoYangtools documentation 19/45319/1
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>
(cherry picked from commit dbfc518701f0ed1f74b2b5d55cc8c27064174925)

7 years agoYangtools documentation 79/44979/2
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>
(cherry picked from commit 5cba929ce67b946502776b9b436dccd32e6c37e2)

7 years agoBUG-6497: Do not lose augmentation statement order 76/44976/1
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>
7 years agoBUG-6497: Do not lose augmentation statement order 65/44965/1
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>
(cherry picked from commit 3c4bdfac3a8b04ecd1d6eab2cdadbb365b54664e)

7 years agoBUG-6316: Fix Bit and EnumPair's position/value types 14/44614/2
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>
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoBug 6420: Fixed SemVer's valueOf method 52/44752/1
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>
(cherry picked from commit 9fb2e2367686d5fa1ae56dba0f5209ba2b822e8c)

7 years agoBug 6410: Fixed initialization of typedefs in rpc 67/44067/2
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>
(cherry picked from commit 8b7928e1337c94936434af5b4d9844804d2720de)

7 years agoBug 6419: Fixed SchemaContextEmitter's emitContainer method 54/44054/1
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>
(cherry picked from commit a664580e83425f01943698e7ff52e48bd3411cfb)

7 years agoBug 3899: Milestone: Increase test coverage for Yangtools 41/44041/2
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>
(cherry picked from commit 387ea1eaaf1ac2482cf3bd761a6caea0f8b92be9)

7 years agoBug 6416: Fixed SchemaContextEmitter's emitIdentityrefSpecification method 40/44040/2
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>
(cherry picked from commit b52c31309ed0221d2e7b17e8361d22ee10e52abb)

7 years agoBug 6414: Fixed DataNodeIterator's traverseModule method 38/44038/1
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>
(cherry picked from commit 211be58dd12278fe8f8be6936229cfb979478a4a)

7 years agoBug 3899: Milestone: Increase test coverage for Yangtools 88/43688/2
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>
(cherry picked from commit f77f673e129e7a866bd21f6072c600f75471a068)

7 years agoImprove yang-maven-plugin error reporting for errors in dependencies 17/43517/1
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>
(cherry picked from commit 1d98955b96490bfda3cba04e004c29e00a3e80e6)

7 years agoUpdate .gitreview for stable/boron 01/43401/1
Thanh Ha [Mon, 8 Aug 2016 21:40:37 +0000 (17:40 -0400)]
Update .gitreview for stable/boron

Change-Id: I605765d148fd26786395d750b83ef40a2e057299
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
7 years agoFix list modification with DataTree rooted at MapEntryNode 09/43309/2
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>
7 years agoBug 6244: Add context to exceptions thrown by yang statement parser 13/43113/2
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>
7 years agoFix list modification with DataTree rooted at MapEntryNode 25/43225/3
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>
7 years agoBug 3899: Milestone: Increase test coverage for Yangtools 20/43120/2
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>
7 years agoDo not use revision in AbstractEffectiveDocumentedNode 61/42861/4
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>
7 years agoBUG-865: hide SchemaPath constructor 97/42897/2
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>
7 years agoFix wrong javadoc 96/42896/2
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>
7 years agoBUG-865: Remove deprecated XmlStreamUtils constructor 95/42895/2
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>
7 years agoBUG-865: remove CloneableChildrenMap 93/42893/1
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>
7 years agoBUG-865: remove JSONCodec.needQuotes() 50/42850/2
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>
7 years agoMake Bit/EnumEffectiveStatementImpl inherit AbstractEffectiveDocumentedNode 60/42860/2
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>
7 years agoBUG-865: add proper nullness annotations 54/42854/2
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>
7 years agoBUG-865: remove MustDefinitionImpl 53/42853/3
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>
7 years agoBUG-865: Move ModuleImportImpl and hide it 52/42852/3
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>
7 years agoBUG-865: remove BitImpl 80/42780/6
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>
7 years agoPropagate @Deprecated annotation 79/42779/3
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>
7 years agoBUG-865: remove deprecated EnumPairImpl 70/42670/6
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>
7 years agoBug 5518: Beryllium yangtools gives error parsing files with Tail-F deref statement 47/42047/2
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>
7 years agoBug 6112 - yang data impl: teach codec union+identityref 45/41545/5
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>
7 years agoRefactor ModifyAction 14/42414/3
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>
7 years agoBug 6180 - Parser: Backslash double-quote in double-quoted string not recognized 28/41828/13
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>
7 years agoBug-6195: Fix issue with leafSetEntryNode in SchemaTracker 45/42445/3
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>
7 years agoBUG-865: Deprecate EnumPairImpl 69/42669/1
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>
7 years agoUse TypedSchemaNode 63/42663/1
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>
7 years agoIntroduce common interface for getValue() method 95/42595/3
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>
7 years agoMove Leaf(List)SchemaNode.getType() to a common interface 93/42593/3
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>
7 years agoBUG-865: move getUnknownSchemaNodes to DocumentedNode 61/42561/1
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>
7 years agoBUG-865: make EnumPair getQName/getSchemaPath unimplemented 94/41994/7
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>
7 years agoPackage JavaDoc to clarify what this artifact is & does 08/42508/3
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>
7 years agoCheckstyle clean up about 200 trivial violation 11/42511/1
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>
7 years agoOrganize Imports to be Checkstyle compliant in utils 09/42509/1
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>
7 years agoFix a few warnings 49/42149/3
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>
7 years agoBug 6240: Entities of imported module's submodule are not visible 12/42312/2
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>
7 years agoFix checkstyle errors and activate enforcement for concepts 08/42408/1
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>
7 years agoKill trailing whitespace 07/42407/2
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>
7 years agoAdd missing license headers 68/42368/1
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>
7 years agoBUG-865: remove SourceIdentifier.cachedReference() 50/41750/3
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>
7 years agoImprove yang-maven-plugin error reporting 93/42193/2
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>
7 years agoFix minor bug in (new) LogMessageExtractorCheck 94/42194/2
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>
7 years agoCheckstyle clean-up src/test/java 88/42188/1
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>
7 years agoBUG-865: Remove DataTreeFactory#create() 50/32850/10
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>
7 years agoBUG-865: remove CrossSourceStatementReactor.buildEffectiveMappedToSource() 93/41993/3
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>
7 years agoMake YangToSourcesProcessor methods static 92/41992/3
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>
7 years agoBUG-865: remove SchemaContextUtil.findParentModuleByType() 91/41991/2
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>
7 years agoBUG-865: remove deprecated BaseTypes constants 89/41989/2
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>
7 years agoBUG-865: remove InstanceIdentifierTypeDefinition#.getPathStatement() 88/41988/2
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>
7 years agoBUG-865: remove DataSchemaNodeAware 87/41987/2
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>
7 years agoBUG-865: remove SchemaContextHolder 86/41986/2
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>
7 years agoBUG-865: eliminate getYangText() 85/41385/4
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>
7 years agoFix bug FileNotFoundException: target/logger-messages.txt polluting logs 71/42071/2
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>
7 years agoRemove use of Guava Charsets 74/41974/4
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>
7 years agoBug 6022: Deviation statement is not fully available in the YANG parser output 52/40752/9
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>
7 years agoNew LogMessageExtractorCheck which writes out TXT report of all loggers 10/39410/10
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>
7 years agoAdd toString() to InMemoryDataTreeCandidate 10/39310/4
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>
7 years agoFix YangToSourcesPluginTestIT failure 05/41505/3
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>
7 years agoBug 6173: Allow refine statement to have no substatements 52/41552/4
Vratko Polak [Tue, 12 Jul 2016 10:44:40 +0000 (12:44 +0200)]
Bug 6173: Allow refine statement to have no substatements

Change-Id: I2c281b8feb10fe25f67ec81de49bd0fbc69c7f45
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
7 years agoBug 6131 - NPE on malformed yang model 09/41809/2
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>
7 years agoPerformance related changes 39/41339/4
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>
7 years agoFix yang.skip feature to include all files needed 80/41480/2
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>
7 years agoBUG-865: eliminate ExtendedType and DerivedType 68/41468/4
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>
7 years agoBug 6134: Introducing of DataTreeConfiguration concept 38/41138/4
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>
7 years agoBug 6158: Optimization of if-feaures resolution during SchemaContext assembly 71/41471/7
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>