yangtools.git
6 years agoBUG-9218: package yang-model-export 38/64438/2
Robert Varga [Fri, 29 Sep 2017 10:03:45 +0000 (12:03 +0200)]
BUG-9218: package yang-model-export

Downstreams are using this artifact and are actively packaging it
themselves. Fix this by including it with the parser.

Change-Id: If1c6752ac7dd64c933ea7a74ef0ba9ea10e87f1d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit da7d07bbbc98f8dd2893e3d2eaf43af818ff0b40)

6 years agoDo not wrap SourceException 27/64427/2
Robert Varga [Mon, 16 Oct 2017 17:04:04 +0000 (19:04 +0200)]
Do not wrap SourceException

SourceException and InferenceException are based on RuntimeException,
there is no need to wrap them in ISE. Remove the wrapper.

Change-Id: Ie599ba317671cfe2d91d54be6864d83e7e2b7c25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix checkArgument() format string 26/64426/2
Robert Varga [Mon, 16 Oct 2017 16:27:16 +0000 (18:27 +0200)]
Fix checkArgument() format string

{} is the wrong placeholder, fix it to %s.

Change-Id: Ibbec204bd3752d05ab381d4834d847141cc28a4a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-865: Remove TreeNodeFactory.createTreeNodeRecursively() 62/32862/15
Robert Varga [Sat, 16 Jan 2016 01:12:16 +0000 (02:12 +0100)]
BUG-865: Remove TreeNodeFactory.createTreeNodeRecursively()

Lazy equivalents offer lower memory footprint, remove the recursive
one.

Change-Id: Ic1646d54826c36e30e59bacd9bc67afbe056cdc6
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
6 years agoEliminate use of DataTreeFactory.create(TreeType) 00/64300/2
Robert Varga [Mon, 16 Oct 2017 11:28:31 +0000 (13:28 +0200)]
Eliminate use of DataTreeFactory.create(TreeType)

Use DataTreeConfiguration instead and consolidate tests to eliminate
unneded dependency in implementation.

Change-Id: I6d4c1978b6ac3a11727f7bd5a2a9da537a0bc757
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix raw type warning 99/64299/2
Robert Varga [Mon, 16 Oct 2017 11:17:11 +0000 (13:17 +0200)]
Fix raw type warning

We can specify leaf type to be string, fixing eclipse warnings.

Change-Id: I46390c88fab2188197e4b7a4c66e6be5eb484e8a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix ModificationApplyOperation javadoc 40/64240/2
Robert Varga [Fri, 13 Oct 2017 10:41:31 +0000 (12:41 +0200)]
Fix ModificationApplyOperation javadoc

Optional has moved, so update javadoc to fix reference to Optional.empty().

Change-Id: I3db8263e4ccd3eb949de79a26811d633ce662387
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBug 9241: Action definition should implicitly define input/output 39/64239/1
Igor Foltin [Fri, 13 Oct 2017 10:02:58 +0000 (12:02 +0200)]
Bug 9241: Action definition should implicitly define input/output

Empty input and output statements are now automatically added to
every action statement that does not declare them explicitly.

Change-Id: I41c037657e83b8e53d314d9b9c6c691ef99e993f
Signed-off-by: Igor Foltin <igor.foltin@pantheon.tech>
6 years agoAdd another parseYangResources() alternative 87/64187/1
Robert Varga [Thu, 12 Oct 2017 09:08:28 +0000 (11:08 +0200)]
Add another parseYangResources() alternative

Add a collection-based alternative to arrays.

Change-Id: I51ebcf5605b165f523cce2909ee3b14bb31729e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoUpdate IdentitySchemaNode metamodel 30/63230/10
Robert Varga [Mon, 18 Sep 2017 13:01:19 +0000 (15:01 +0200)]
Update IdentitySchemaNode metamodel

Remove the RFC6020 idea that an identity can have only a single
base and switch to RFC7950's idea of allowing multiple base identities.

Change-Id: Iae23357379d199a60b71682ad84119422676bfd1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-5211: remove SourceStreamAware 95/41995/37
Robert Varga [Mon, 18 Jul 2016 16:47:51 +0000 (18:47 +0200)]
BUG-5211: remove SourceStreamAware

This interface is a direct violation of the model.api contract.
It is used only by the YangToSourceProcessor, which can implement
the suggested fix.

Change-Id: I90928a273503ee21e9663c115b7135cf5e1f0608
Signed-off-by: Robert Varga <rovarga@cisco.com>
6 years agoBUG-7568: cleanup BasicCodeGenerator 77/62977/19
Robert Varga [Mon, 11 Sep 2017 14:51:11 +0000 (16:51 +0200)]
BUG-7568: cleanup BasicCodeGenerator

This is an API-incompatible change to ensure that only the correct method
is implemented.

Change-Id: I59469fddda3b71972639f5c28a3530796de6de28
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-9043: Remove use of CheckedFuture from YANG components 62/62262/17
Robert Varga [Thu, 24 Aug 2017 10:56:06 +0000 (12:56 +0200)]
BUG-9043: Remove use of CheckedFuture from YANG components

This patch removes all references to CheckedFuture, future-proofing
our codebase for Guava upgrades.

Change-Id: I2e6f4e97a6f06b01573287e7904c1681ede3d729
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoEnforce statement format validity 51/49451/19
Robert Varga [Thu, 31 Aug 2017 21:05:06 +0000 (23:05 +0200)]
Enforce statement format validity

Statements with multiple colons and with the colon being the last
character are invalid. Report these as soon as we encounter them.

Change-Id: I9138e513d1bd271fbdb33bb5991e59f4498410ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
6 years agoBug 2444 - Add missing API to Action and Notification definition 55/59655/16
Peter Kajsa [Thu, 29 Jun 2017 08:34:12 +0000 (10:34 +0200)]
Bug 2444 - Add missing API to Action and Notification definition

Since Yang 1.1, it is allowed to use notification and action
statements also in grouping and augment statements. However,
yang-model-api does not reflect this changes. This patch
adds missing methods to check the origin of notifications and
actions. Required fix of yang-model-export is included as well.

Change-Id: Iba7282e3be4361bba8e6328a57fbbe0cb115a1f5
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
6 years agoCleanup use of Guava library 85/61985/23
Robert Varga [Fri, 18 Aug 2017 09:38:16 +0000 (11:38 +0200)]
Cleanup use of Guava library

Turn Preconditions.checkNotNull into Objects.requireNonNull, use it
as static import. Eliminate the use of Optional/Function/Supplier
concepts, which are now native to Java 8.

Change-Id: Ie470283e1b4f706b0601a191626bd1e036d4d723
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix AugmentationIdentifier.compareTo() 38/64038/6
Robert Varga [Sat, 7 Oct 2017 12:16:36 +0000 (14:16 +0200)]
Fix AugmentationIdentifier.compareTo()

The implementation assumed stable Set iteration order, which was
not internally guaranteed, hence two AugmentationIdentifiers could
report as being equal via equals(), but still compare as having
different total ordering -- which could lead to strange results.

Fix this by doing some more work and compare them based on QName's
total ordering. The test suite is fixed up to use explicit iteration
order retained by ImmutableSet rather than relying on HashSet's
hashCode()-based iteration order non-determinism.

Also remove implicit boolean boxing by using assertTrue/assertFalse
in tests.

Change-Id: Iafd4ac8d7d54f0918b0579c6e6f8e76b35b56dd8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd option to validate yang by module name 59/63459/16
Jakub Toth [Fri, 22 Sep 2017 13:47:19 +0000 (15:47 +0200)]
Add option to validate yang by module name

Change-Id: If1aa92440cee4510758d78f5c2dc4d619474b7db
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoRemove explicit default super-constructor calls 01/63601/3
David Suarez [Wed, 27 Sep 2017 08:40:55 +0000 (10:40 +0200)]
Remove explicit default super-constructor calls

The default constructor is called by default (hence its name), no need
to call it explicitly. Based on this commit [1].

[1] https://git.opendaylight.org/gerrit/#/c/63526/

Change-Id: I0feaf3747fcad25082d74cdb9cc4032180cfba18
Signed-off-by: David Suarez <david.suarez.fuentes@gmail.com>
6 years agoAdd EntrySet/KeySet spliterators 44/63144/4
Robert Varga [Thu, 14 Sep 2017 15:20:19 +0000 (17:20 +0200)]
Add EntrySet/KeySet spliterators

Spliterators do not allow modification of underlying map, hence
we can always instantiate an immutable iterator and flag appropriate
characteristics.

This is an initial cut, which is not perfect: we still should create
dedicated spliterators, which do not instantie entries nor perform
lookahead and have optimized trySplit().

Change-Id: Iad1a8f4b30d5a996484b21c9be589bf80ee7d584
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRevert "Revert "BUG-7262: Operational data tree should enforce mandatory nodes"" 37/62037/10
Robert Varga [Sun, 20 Aug 2017 09:17:01 +0000 (11:17 +0200)]
Revert "Revert "BUG-7262: Operational data tree should enforce mandatory nodes""

This reverts commit 7e8657de5bbcbcb098eca56df3445d155f20bb50.

Change-Id: Ie976e7b5c64e53c812b0913ef9fb38cb3049a5ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoCleanup checkstyle warnings and turn enforcement on in yang-data-impl 51/62551/6
Robert Varga [Fri, 1 Sep 2017 13:28:30 +0000 (15:28 +0200)]
Cleanup checkstyle warnings and turn enforcement on in yang-data-impl

This patch cleans up bunch of old code to comply with checkstyle rules
and flips the switch so we do not regress.

Change-Id: I2b314d2a672e9b0b7fb225004fd1f3ce770f098a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAllow shared JSONNNSWriter use 35/63335/4
Stephen Kitt [Wed, 20 Sep 2017 14:33:05 +0000 (16:33 +0200)]
Allow shared JSONNNSWriter use

JSONNormalizedNodeStreamWriter.createNestedWriter() gives the
impression that it can be used with an externally-controlled
JsonWriter, e.g. to build a JSON document containing several
serialised NormalizedNode instances. However, since it closes the
JsonWriter when closed itself, it limits the possible uses: currently,
a writer ends up having the same lifetime as a JsonWriter, even though
it doesn’t really have the same scope (because of the SchemaPath in
particular).

This patch changes the behaviour so that the provided JsonWriter has
an independent lifecycle (and needs to be closed by callers). I will
follow up with patches to the few users in ODL.

Change-Id: I9c597fe96937867cffdcbeeddd4b1507de20f2ee
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBug 2444 - Yin export of all YANG statements 06/59006/25
Peter Kajsa [Mon, 26 Jun 2017 09:34:49 +0000 (11:34 +0200)]
Bug 2444 - Yin export of all YANG statements

Currently yang-export exports effective world of yang into yin,
what is not correct, because lot of information is not accesible
in effective world anymore.
So the correct solution is to export declared world of yang,
where all information is accessible and in raw form and that is
exactly what we need.
Export of effective world is still retained for cases when
we don't have access to declared form of supplied module or
we want to emit also instantiated statements (e.g. statements added
by uses or augment)

Change-Id: Ic2bc559623d9e72c59e2ed7f6a797cd67933ada6
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
6 years agoBug 2444 - add missing API of some declared statements 07/59507/13
Peter Kajsa [Mon, 26 Jun 2017 09:09:27 +0000 (11:09 +0200)]
Bug 2444 - add missing API of some declared statements

Fix of missing API of some declared statements according to
RFC7950. This API is necessary to proper export of declared statements
to Yin.

Change-Id: Icc0209656751b00c5cc7401f7b95d8979af0fa0d
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
6 years agoFix deleteWriteFooBar2ndLevelEmptyContainerTest 35/63435/4
Jie Han [Fri, 22 Sep 2017 01:17:18 +0000 (09:17 +0800)]
Fix deleteWriteFooBar2ndLevelEmptyContainerTest

- this unit is to test delete-write while the next one is delete-merge,
here its body is duplicated with deleteMergeFooBar2ndLevelEmptyContainerTest

Change-Id: I7bafd002859e23de2d89748fc71c876cb4ab674c
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoAdd option to setup output file for logs in validator 27/63327/12
Jakub Toth [Wed, 20 Sep 2017 11:58:33 +0000 (13:58 +0200)]
Add option to setup output file for logs in validator

  * added option -o (--output) to setup path of output file
    for logs

Change-Id: I42ba358932c4cf20fa11400490c1d11e2a0f6046
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoRename yang-system-test module to yang-model-validator 82/63282/11
Jakub Toth [Tue, 19 Sep 2017 13:26:22 +0000 (15:26 +0200)]
Rename yang-system-test module to yang-model-validator

  * yang-model-validator better describes purpose of the module

Change-Id: I7353c23afcfa7f53b37e428564f783565b41f4c6
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoMinor JavaDoc fixes in CountingRejectedExecutionHandler 02/63802/3
Michael Vorburger [Thu, 28 Sep 2017 20:21:48 +0000 (22:21 +0200)]
Minor JavaDoc fixes in CountingRejectedExecutionHandler

Change-Id: I4bfab54a6c80e751a46fff840f763d1e7fe6aeb0
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agoBUG-2389: Remove obsolete XML parser classes 59/60559/15
Robert Varga [Wed, 19 Jul 2017 11:18:58 +0000 (13:18 +0200)]
BUG-2389: Remove obsolete XML parser classes

yang-data-codec-xml supersedes this parser classes, which have been
deprecated. This patch removes them.

Change-Id: I73778eb0505e402224f0adb46e0fd6477d667522
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBump odlparent 2.0.4 to 2.0.5 46/63646/2
Stephen Kitt [Wed, 27 Sep 2017 13:35:45 +0000 (15:35 +0200)]
Bump odlparent 2.0.4 to 2.0.5

Change-Id: I11d5ca5ff224338a5543f13edbe398e545bc8038
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoDo not use String.replace() 88/63188/3
Robert Varga [Sat, 16 Sep 2017 08:28:49 +0000 (10:28 +0200)]
Do not use String.replace()

This forces a Pattern compilation, which we do not really want.
Pre-compile the patterns instead.

Change-Id: Ibcb9f911f4a4089f375264b75ce2f5d9c5f46447
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFurther yang-parser-impl checkstyle fixes 99/63199/5
Robert Varga [Sun, 17 Sep 2017 08:50:42 +0000 (10:50 +0200)]
Further yang-parser-impl checkstyle fixes

Brings the violation count to below 500.

Change-Id: I22ee943c06bf04f3692a511f703573a0a57ec0ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRemove Named{File,Byte,}InputStream 45/62745/11
Robert Varga [Wed, 6 Sep 2017 08:37:59 +0000 (10:37 +0200)]
Remove Named{File,Byte,}InputStream

These utility classes are no longer useful, remove them.

Change-Id: If9e96e978cff5c6a69ac8bfb1c63717c1762d3de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRemove deprecated Yin/YangStatementSourceImpl 37/62537/22
Robert Varga [Fri, 1 Sep 2017 09:46:18 +0000 (11:46 +0200)]
Remove deprecated Yin/YangStatementSourceImpl

These classes have been superseded by Yin/YangStatementStreamSource,
which have better semantics. Remove them and fixup former call sites.

Change-Id: I9f16e62da8cf38ce35703de6a93b1d5d9dcdf2e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRename MainNode methods 39/63339/2
Robert Varga [Wed, 20 Sep 2017 15:14:24 +0000 (17:14 +0200)]
Rename MainNode methods

CAS_PREV -> casPrev
READ_PREV -> readPrev
WRITE_PREV -> writePrev

Change-Id: Ia918db3c68931d585a5f2922b0923e939814d015
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRename recursive INode methods 38/63338/2
Robert Varga [Wed, 20 Sep 2017 15:10:03 +0000 (17:10 +0200)]
Rename recursive INode methods

Change names to conform to Java standards:
- rec_insert -> recInsert
- rec_insertif -> recInsertIf
- rec_lookup -> recLookup
- rec_remove -> recRemove

Change-Id: Ic11da9ac2ae96d8029d0bb08464033bfe027ee0b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRemove BasicNode.string() 37/63337/2
Robert Varga [Wed, 20 Sep 2017 15:03:30 +0000 (17:03 +0200)]
Remove BasicNode.string()

This method is not used anywhere, remove it and take all commented-out
support code with it.

Change-Id: I24720c16f562fd391894484566903f1a526ad202
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRemove trailing spaces in resource files 03/63403/1
David Suarez [Thu, 21 Sep 2017 12:35:49 +0000 (14:35 +0200)]
Remove trailing spaces in resource files

Remove trailing spaces to pass the checkstyle rules included in [1].

[1] https://git.opendaylight.org/gerrit/#/c/48710/

Change-Id: I2a6ec71294ee9b8e8720393c1867d36df4e29b01
Signed-off-by: David Suarez <david.suarez.fuentes@gmail.com>
6 years agoRemove yang.parser.util.ModuleDependencySort 23/63223/4
Robert Varga [Mon, 18 Sep 2017 11:06:36 +0000 (13:06 +0200)]
Remove yang.parser.util.ModuleDependencySort

This class has been moved to yang.model.util, remove it from its old
place. Also removes YangValidationException.

Change-Id: Ic30985769d486720f971a9a70422b62e9ceb00bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRemove NodeWrappedType and TopologicalSort 98/63198/2
Robert Varga [Sun, 17 Sep 2017 08:08:43 +0000 (10:08 +0200)]
Remove NodeWrappedType and TopologicalSort

These have been migrated to utilities, remove them from parser proper.

Change-Id: I543c06ee36fe92b1f0570b781b3581b253802c4f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoThrow SourceException instead of invalid fraction-digits 90/63190/3
Robert Varga [Sat, 16 Sep 2017 11:08:47 +0000 (13:08 +0200)]
Throw SourceException instead of invalid fraction-digits

We have a source reference, hence use SourceException.throwIf() instead
of Preconditions.checkArgument().

Change-Id: I0e41ad3b6069dfd4801ca645c54682cbd442f58b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoThrow InferenceException on invalid identity reference 91/63191/3
Robert Varga [Sat, 16 Sep 2017 11:14:59 +0000 (13:14 +0200)]
Throw InferenceException on invalid identity reference

We have source context available, hence use InferenceException.throwIfNull()
instead of Preconditions.checkArgument().

Change-Id: I12034275f9a6a4e4bb6e53f58ef111d5129edf1b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAnother round of checkstyle fixes 97/63197/1
Robert Varga [Sun, 17 Sep 2017 08:03:45 +0000 (10:03 +0200)]
Another round of checkstyle fixes

Brings down the number of violations to under 700.

Change-Id: I8da94e59b13fa109832b6d903045c352ad47786c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoNext round of checkstyle fixes in yang-parser-impl 92/63192/2
Robert Varga [Sat, 16 Sep 2017 11:09:41 +0000 (13:09 +0200)]
Next round of checkstyle fixes in yang-parser-impl

Another batch, bringing the number of violation to under 800.

Change-Id: I2d39b73747c952f07f633822d46f79326f9355e0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoNext round of yang-parser-impl checkstyle fixes 87/63187/3
Robert Varga [Sat, 16 Sep 2017 02:21:54 +0000 (04:21 +0200)]
Next round of yang-parser-impl checkstyle fixes

This patch fixes up more violations.

Change-Id: I4aed5811d3118229a8275f053dc3e4aa5538f2a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoCleanup some checkstyle warnings 82/63182/1
Robert Varga [Fri, 15 Sep 2017 20:39:51 +0000 (22:39 +0200)]
Cleanup some checkstyle warnings

This is incremental improvement so we start converging on being able
to enforce checkstyle.

Change-Id: I0870f80407fe54000be34bbfc8e41c15e7ce087a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBug 7437: Fix yang-system-test logging without the --verbose option 30/63130/2
Igor Foltin [Thu, 14 Sep 2017 09:41:40 +0000 (11:41 +0200)]
Bug 7437: Fix yang-system-test logging without the --verbose option

yang-system-test artifact has the --verbose option which provides
more detailed logging output of the parsing process. However,
the logging ouput is full of DEBUG level messages coming from
the YANG statement parser even without the --verbose option.

This happens because the yang-system-test uses java.util.logging for
logging events and sets the level of logging only for that Logger.
However, the YANG statement parser uses ch.qos.logback backend for
logging, so we need to set the log level for that instead.

Therefore, replace the java.util.logging in yang-system-test with
ch.qos.logback backend.

Change-Id: I14ac775228506e4ed22cd1b55e7efec1898fa27f
Signed-off-by: Igor Foltin <igor.foltin@pantheon.tech>
6 years agoCleanup YangToSourceProcessor 33/62733/5
Robert Varga [Tue, 5 Sep 2017 22:15:50 +0000 (00:15 +0200)]
Cleanup YangToSourceProcessor

Use java.util.Objects.requireNonNull() instead of
Preconditions.checkNotNull().

Simplify and speed up delta change detection.

Change-Id: I3c41d3245554ac41127042c8285c03c5a5666865
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix checkstyle in yang-parser-spi 64/63064/3
Robert Varga [Tue, 12 Sep 2017 18:38:11 +0000 (20:38 +0200)]
Fix checkstyle in yang-parser-spi

This is public contract, clean up checkstyle issues and expand documentation a bit.

Change-Id: Iead665f037bb0396bd0ff294d54c427a0e82168c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix yang-common/pom.xml whitespace 63/63063/2
Robert Varga [Tue, 12 Sep 2017 18:16:18 +0000 (20:16 +0200)]
Fix yang-common/pom.xml whitespace

This corrects whitespace to 4 spaces as needed.

Change-Id: I9f8764385ee953cf17b48a1a6edc64815df78ab4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-7052: split out yang-parser-spi 43/63043/6
Robert Varga [Tue, 12 Sep 2017 14:29:58 +0000 (16:29 +0200)]
BUG-7052: split out yang-parser-spi

Parser SPI classes have no further dependencies on other parser
components. Split them out into a separate artifact so we do not
accidentaly re-introduce an inappropriate dependency.

Change-Id: I56ea4ed1962d898c807203a2b82d048c0200548c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMake SimpleDateFormatUtil non-lenient 31/62731/4
Robert Varga [Tue, 5 Sep 2017 21:33:30 +0000 (23:33 +0200)]
Make SimpleDateFormatUtil non-lenient

Converting an illegal revision, like 2017-16-05, results in incorrect
results in that the resulting Date will reflect 2018-04-05, which is
no a reversible transformation -- leading to hard to fix issues when
a String and Date representation meet.

Make sure we do not allow such invalid revisions through and fixup
bad test models.

Change-Id: I138cb5357cd6898bd64b745fbfed5d05b593e1e1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoGet rid of commons-io 07/62707/4
Robert Varga [Tue, 5 Sep 2017 14:31:15 +0000 (16:31 +0200)]
Get rid of commons-io

Java 8 gives us everything we need to search for files, hence there
is no need to use commons-io, remove it.

Change-Id: I034ba44936c97929c7c72d8e2725acacc0fa131f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-7568: Use YangTextSchemaSource to emit schema files 06/62706/4
Robert Varga [Tue, 5 Sep 2017 14:31:14 +0000 (16:31 +0200)]
BUG-7568: Use YangTextSchemaSource to emit schema files

To properly address the issue of META-INF/yang files not having their
revisions we need to encapsulate minimal project initialization state,
which gives us properly-resolved revisions.

We then refactor the execution flow to first inspect files to
determine whan needs to happen and then execute.

Change-Id: Icdf8069c72b24ad4cb196ebd79de194023eba9e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAvoid module namespace/submodule name conflict when using lib sources 34/63034/2
Igor Foltin [Tue, 12 Sep 2017 12:34:12 +0000 (14:34 +0200)]
Avoid module namespace/submodule name conflict when using lib sources

The issue comes up when using yang-system-test artifact as a single
YANG file validator:

A parent module or a submodule is specified as its argument
and the same directory is specified as one of the library dirs
using the -p option.

The parent module/submodule ends up being added twice to the parsed
sources which causes a module namespace/submodule name collision later
in the parsing process.

Therefore remove the conflicting lib sources from the collection of
required lib sources before they cause any trouble.

Change-Id: Id41d9f57006adec7ff658904792f9bc319b8c11e
Signed-off-by: Igor Foltin <igor.foltin@pantheon.tech>
6 years agoOverride toString() in Yang/YinStatementStreamSource 61/62961/3
Igor Foltin [Mon, 11 Sep 2017 11:04:07 +0000 (13:04 +0200)]
Override toString() in Yang/YinStatementStreamSource

Yang/YinStatementStreamSource objects are used in log messages
within the YANG statement parser. In order to provide useful
information they need to have the toString() method overridden.

Change-Id: I2bfdda8a6a58256e6f4e1e113b4a5a8174c73ef7
Signed-off-by: Igor Foltin <igor.foltin@pantheon.tech>
6 years agoBUG-7568: refactor yang-maven-plugin 05/62705/3
Robert Varga [Tue, 5 Sep 2017 14:31:12 +0000 (16:31 +0200)]
BUG-7568: refactor yang-maven-plugin

Refactor the plugin to not use named input streams, but rather
instantiate YangTextSchemaSources. Along with the use of
YangTextSchemaContextResolver this eliminates the need for weird
path-based tricks to get local modules.

Change-Id: Ifa1139e867b773662be64ee51bf85a46be7ea619
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBug 7051 - Refactoring of UnknownStatements handling 32/63032/2
Peter Kajsa [Tue, 12 Sep 2017 12:39:19 +0000 (14:39 +0200)]
Bug 7051 - Refactoring of UnknownStatements handling

Refactoring of UknownStatements handling due to undesired
dependecies of StatementSupport on stmt.reactor package.

Change-Id: Ic58dbe4cdda5f7252e4e17a11173a57ad5ad1db6
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBug 7051 - Refactoring of implicit case statements creation 20/63020/2
Peter Kajsa [Tue, 12 Sep 2017 08:18:28 +0000 (10:18 +0200)]
Bug 7051 - Refactoring of implicit case statements creation

Refactoring of implicit case statements creation due to
undesired dependencies of StatementSupport on stmt.reactor
package.

Change-Id: I306c33ad284dd2aeeb551b72ba0fd795a0761d9e
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
6 years agoAdd the parent module of a submodule to the set of required lib sources 33/62833/2
Igor Foltin [Thu, 7 Sep 2017 11:41:55 +0000 (13:41 +0200)]
Add the parent module of a submodule to the set of required lib sources

This issue is related to the following use case of YANG statement parser:
If we add a YANG submodule as a main source and its parent module
as a library source, YANG statement parser does not add the parent module
to the set of requires lib sources. This causes an Exception as the parser
cannot resolve belongs-to statement in the submodule.

This patch fixes the issue.

Change-Id: Icbfddbbbecec310f0f7de17456e6a12dab8167d6
Signed-off-by: Igor Foltin <igor.foltin@pantheon.tech>
6 years agoBug 8713 - BGP models not compatible with leafref context 32/62832/2
Peter Kajsa [Thu, 7 Sep 2017 11:18:22 +0000 (13:18 +0200)]
Bug 8713 - BGP models not compatible with leafref context

Lookup of parent module should be performed based on the first path
argument from root not the last one.

Change-Id: Ic8e0dc901056caf93e4fc5266334434bd067d9ab
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
6 years agoRevert "Cleanup old concepts" 48/62748/1
Robert Varga [Wed, 6 Sep 2017 10:10:00 +0000 (10:10 +0000)]
Revert "Cleanup old concepts"

This reverts commit a54529b3f105d0a51343f746d3a03ede31958f40.

Change-Id: I4cb084c7f2081b78a96e9a134222f468f750c8f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoCleanup old concepts 06/40006/9
Robert Varga [Mon, 2 Feb 2015 19:26:52 +0000 (20:26 +0100)]
Cleanup old concepts

RpcResult is in a rather bad place, as it should be part of mdsal.
Deprecate it and mark SimpleDataFormatUtil for migration.

Change-Id: Id7b8752cbe54c4bd332b146df6e278c6f8cee545
Signed-off-by: Robert Varga <rovarga@cisco.com>
6 years agoRevert "BUG-7568: refactor yang-maven-plugin" 02/62702/1
Robert Varga [Tue, 5 Sep 2017 14:14:31 +0000 (16:14 +0200)]
Revert "BUG-7568: refactor yang-maven-plugin"

This reverts commit ab09dfe2691b4ab5d5937b124ae3afc199a561b7.

Change-Id: Idb128323149613fae8d06298b39cdcf40b0ca690
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRevert "BUG-7568: Use YangTextSchemaSource to emit schema files" 01/62701/1
Robert Varga [Tue, 5 Sep 2017 14:10:19 +0000 (16:10 +0200)]
Revert "BUG-7568: Use YangTextSchemaSource to emit schema files"

This reverts commit bc1c0861e1c229cfee7465b84b5fd15eb462a3bf.

Change-Id: I7b35dd553f181382ac587ee335dafddeb5807ebd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRevert "Get rid of commons-io" 00/62700/1
Robert Varga [Tue, 5 Sep 2017 14:10:17 +0000 (16:10 +0200)]
Revert "Get rid of commons-io"

This reverts commit e8ac56902440704082470574abf0cd159f66293b.

Change-Id: Iffb89d4c9f0572ead4c64e5249844eb875a93824
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoGet rid of commons-io 86/52086/16
Robert Varga [Mon, 20 Feb 2017 21:07:22 +0000 (22:07 +0100)]
Get rid of commons-io

Java 8 gives us everything we need to search for files, hence there
is no need to use commons-io, remove it.

Change-Id: Ieab83e52189992f68616e8246320ca7685a87cd5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-7568: Use YangTextSchemaSource to emit schema files 85/52085/31
Robert Varga [Mon, 20 Feb 2017 20:46:34 +0000 (21:46 +0100)]
BUG-7568: Use YangTextSchemaSource to emit schema files

To properly address the issue of META-INF/yang files not having their
revisions we need to encapsulate minimal project initialization state,
which gives us properly-resolved revisions.

We then refactor the execution flow to first inspect files to
determine whan needs to happen and then execute.

Change-Id: I3257475f0b267adf0e4d5cd469829a267cfc68aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-7568: refactor yang-maven-plugin 56/52056/34
Robert Varga [Sun, 19 Feb 2017 23:49:40 +0000 (00:49 +0100)]
BUG-7568: refactor yang-maven-plugin

Refactor the plugin to not use named input streams, but rather
instantiate YangTextSchemaSources. Along with the use of
YangTextSchemaContextResolver this eliminates the need for weird
path-based tricks to get local modules.

Change-Id: I27403270cbacf567ad2182b60f265cc6bb3f83e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-8043: eliminate ConstraintFactory 43/62443/3
Robert Varga [Tue, 29 Aug 2017 08:28:56 +0000 (10:28 +0200)]
BUG-8043: eliminate ConstraintFactory

This factory is getting in the way and it really is a useless abstraction,
as we can achieve the same with simple subclass contract.

Change-Id: I3fb50c4bcce08ec79ac710d2ca0bb9e4292ffc53
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-8043: eliminate LenghtStatement.getValue() 42/62442/3
Robert Varga [Mon, 28 Aug 2017 14:46:41 +0000 (16:46 +0200)]
BUG-8043: eliminate LenghtStatement.getValue()

DeclaredStatement.argument() is an alias, no need have another method
for the same thing.

Change-Id: I9d6da9d640165a286f5c7ffdd30b20b019d0635a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix benchmark compilation and runtime 00/62600/3
Robert Varga [Mon, 4 Sep 2017 07:51:29 +0000 (09:51 +0200)]
Fix benchmark compilation and runtime

Benchmark has been broken for some time, fix it up.

Change-Id: If2e1f3292a110947a1428a096de20e90591b0f6d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-8043: introduce RangeRestrictedTypeDefinition 79/62279/9
Robert Varga [Thu, 24 Aug 2017 14:41:54 +0000 (16:41 +0200)]
BUG-8043: introduce RangeRestrictedTypeDefinition

{Decimal,Integer,UnsignedInteger}TypeDefinition share the same method
and semantics, capture them in RangeRestrictedTypeDefinition.

Change-Id: I5fa6dbf5efdcc3797abc628a98e034602b8285ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-8043: introduce LengthRestrictedTypeDefinition 78/62278/6
Robert Varga [Thu, 24 Aug 2017 14:32:05 +0000 (16:32 +0200)]
BUG-8043: introduce LengthRestrictedTypeDefinition

{Binary,String}TypeDefinition share the same method and semantics,
capture them in LengthRestrictedTypeDefinition.

Change-Id: Id913e79e2d2c9a2090721c1ed6e5bee8f309051c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoKill websocket-client 79/62579/2
Robert Varga [Sat, 2 Sep 2017 13:06:30 +0000 (15:06 +0200)]
Kill websocket-client

This artifact is a useless experiment, which we do not package
for a long time. Kill it finally.

Change-Id: I9c0fe90065a75809b715606ce857856bd568af42
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoEnable checkstyle on yang-data-codec-gson 76/62576/2
Robert Varga [Sat, 2 Sep 2017 12:25:23 +0000 (14:25 +0200)]
Enable checkstyle on yang-data-codec-gson

Gneeral cleanup and enable checkstyle.

Change-Id: Ib63901ef099b1b457504e2b8e11341ab357a394a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRemove antlr version override 45/62545/2
Robert Varga [Fri, 1 Sep 2017 13:29:10 +0000 (15:29 +0200)]
Remove antlr version override

antlr is pre-configured from odlparent, no need to override its
version.

Change-Id: I86a83c22bea34f95688c63141a30454dd82b4a96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoActivate checkstyle in yang-system-test 78/62578/1
Robert Varga [Sat, 2 Sep 2017 12:57:53 +0000 (14:57 +0200)]
Activate checkstyle in yang-system-test

Fix a few offences and flip the switch.

Change-Id: I0c0601d3db712b3d9ae8dd6ca53195885d7d81ab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoEnforce checkstyle on yang-test-util 77/62577/1
Robert Varga [Sat, 2 Sep 2017 12:53:54 +0000 (14:53 +0200)]
Enforce checkstyle on yang-test-util

Fixup a few warnings and flip the switch.

Change-Id: If82a193f6c3287edb24ef6e19ed78c823d48f736
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBug 7246 - Fix of SchemaTracker initialization and lookup of schema nodes 12/61712/11
Peter Kajsa [Mon, 14 Aug 2017 17:35:33 +0000 (19:35 +0200)]
Bug 7246 - Fix of SchemaTracker initialization and lookup of schema nodes

SchemaUtils methods perform lookup in both the namespace of groupings and
the namespace of all leafs, leaf-lists, lists, containers, choices, rpcs,
actions, notifications, anydatas, and anyxmls. In consequence, performed
lookups are ambiguous due to possible name conflicts between these namespaces.

Change-Id: Icd3e141b21d0adaf0126b539454e640c0ea0b5a6
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
6 years agoCleanup SystemTestUtils 89/61289/4
Robert Varga [Mon, 7 Aug 2017 17:56:13 +0000 (19:56 +0200)]
Cleanup SystemTestUtils

Remove use of deprecated class. Also convert to using collections.

Change-Id: I15eeee89628dfedb2ca0baf9a9b4f318801daddb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoThrow SourceException instead of IllegalArgumentException 41/62341/2
Robert Varga [Sat, 26 Aug 2017 16:50:55 +0000 (18:50 +0200)]
Throw SourceException instead of IllegalArgumentException

TypeUtils already considers StatementSourceReference, so instead
of home-grown format use SourceException.throwIf().

Change-Id: Ifc81db735d72bb7c98b94c66ac013f8dcc47413c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMark getIdentity() as deprecated 83/62283/2
Robert Varga [Thu, 24 Aug 2017 15:19:09 +0000 (17:19 +0200)]
Mark getIdentity() as deprecated

Super interface marks this as deprecated, implementations should do
the same.

Change-Id: Ic48fe6064e2f0a96b4f35e8cfcd499764451e995
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-8043: AbstractConstraintEffectiveStatement update 77/62277/2
Robert Varga [Thu, 24 Aug 2017 14:12:03 +0000 (16:12 +0200)]
BUG-8043: AbstractConstraintEffectiveStatement update

This forms the baseline for implementing sub-interfaces of
ConstraintMetaDefinition, so it should itself implement that
interface.

Change-Id: Idcd9819c7262c236c39c96b8294b128de9f0410e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoUse Guava's Interner instead of ObjectCache 69/62269/2
Robert Varga [Thu, 24 Aug 2017 12:04:04 +0000 (14:04 +0200)]
Use Guava's Interner instead of ObjectCache

Guava's Interner does pretty much the same thing, no need to use
ObjectCache.

Change-Id: I4ee79155aeac465bfd59392656f555c3509459fd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoDo not instantiate needless objects in augment 03/61303/8
Robert Varga [Tue, 8 Aug 2017 02:15:43 +0000 (04:15 +0200)]
Do not instantiate needless objects in augment

Non-mutable versions of accessors are cheaper and should be used
wherever we do not modify state.

Change-Id: I200d843b830af59d407da346d0b09aa4909a4467
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-7052: move copy operation to StatementContextBase 02/61302/7
Robert Varga [Tue, 8 Aug 2017 01:39:21 +0000 (03:39 +0200)]
BUG-7052: move copy operation to StatementContextBase

The copy operation works on top of StatementContextBase concepts
aside from argument adaptation. Move the copy operation around,
cleaning up some of the access patterns along the way.

Change-Id: I34413c7d2c4d314503e9c9adffc7e2f0d2ea2531
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBug 9005 - scope of model import prefix should be module/submodule 42/62142/1
Peter Kajsa [Fri, 18 Aug 2017 10:24:32 +0000 (12:24 +0200)]
Bug 9005 - scope of model import prefix should be module/submodule

Yang parser includes all substatements of a submodule into a parent
module including all import statements of the submodule, what causes
mismatch of parent module imports.

Change-Id: I5c0b45348ca5e9f3ae54351c93e940135fe2b99d
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
6 years agoRemove yangtools.util.Identifiables 84/61984/4
Robert Varga [Fri, 18 Aug 2017 10:11:27 +0000 (12:11 +0200)]
Remove yangtools.util.Identifiables

This class does not hold anything useful in Java 8 world and was
deprecated. Remove it.

Change-Id: Id5c870a64f203adda12f9ca697531223c2d5b379
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix AnyXml node handling 86/61986/2
Robert Varga [Fri, 18 Aug 2017 12:56:51 +0000 (14:56 +0200)]
Fix AnyXml node handling

Fixup the mixup of calling instanceof on an Optional.

Change-Id: I184e2ad7535129cf19c41dfd5c235285e82e9f28
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRevert "BUG-7262: Operational data tree should enforce mandatory nodes" 36/62036/1
Robert Varga [Sun, 20 Aug 2017 08:28:04 +0000 (10:28 +0200)]
Revert "BUG-7262: Operational data tree should enforce mandatory nodes"

This reverts commit 8befab93f3eb3683ddf68665542bf64c3f36f9f7.

Downstreams are not disconnected from master yet and this exposes
issues with mis-alignment of models and implementation.

Change-Id: Ifc0a9113b7985011be0eff1853d7668e85ece403
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoCleanup testutils 33/61033/5
Robert Varga [Wed, 2 Aug 2017 10:52:11 +0000 (12:52 +0200)]
Cleanup testutils

Cleans up sonar warnings and re-organizes code a bit.

Change-Id: I99761f484cd992d994f1bca7c681190a055793cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoSimplify DeviateStatementImpl.addStatement() 37/61237/9
Robert Varga [Sun, 6 Aug 2017 23:10:25 +0000 (01:10 +0200)]
Simplify DeviateStatementImpl.addStatement()

There is a copy&paste line here which can be eliminated with some
application of structured programming.

Change-Id: If3fffc7f07648de1456a8fbe02feba44ed40b0e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRefactor argument adaptation 40/61240/10
Robert Varga [Mon, 7 Aug 2017 01:04:18 +0000 (03:04 +0200)]
Refactor argument adaptation

Adapting arguments is really a StatementSupport-level operation, and
should not be part of a specific reactor implementation.

This patch creates the appropriate interfaces required to have
StatementSupport classes a say when arguments are adapted.

Change-Id: Ifa3e25b96d9f451a53a99a30be2573abe7ee744c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-7052: remove StmtContext.createCopy() 38/61238/11
Robert Varga [Sun, 6 Aug 2017 23:03:08 +0000 (01:03 +0200)]
BUG-7052: remove StmtContext.createCopy()

The two StmtContext.createCopy() methods are the final bits of
spi.meta dependending on stmt.reactor.

This patch eliminates them by introducing Mutable.childCopyOf()
methods, which perform the same function, except the are hosted
in the new parent object, which internally knows it is
a StatementContextBase.

Change-Id: I16978eb62851295a5c922224a051d200c5e32abc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-7262: Operational data tree should enforce mandatory nodes 72/48672/14
Robert Varga [Thu, 24 Nov 2016 16:00:57 +0000 (17:00 +0100)]
BUG-7262: Operational data tree should enforce mandatory nodes

This flips the switch on enforcement of mandatory nodes in operational
data trees by default.

Change-Id: Id9c44d119a324ea711c36cea9a87728d0cbcc3ae
Signed-off-by: Robert Varga <rovarga@cisco.com>
6 years agoRemove unused property declaration yang.codegen... 24/61624/2
Thanh Ha [Mon, 14 Aug 2017 15:36:07 +0000 (11:36 -0400)]
Remove unused property declaration yang.codegen...

yang-codegen-version does not appear to be used anywhere so remove it.

Change-Id: Ib775144a7f38e3fd44256033467fb09456bd1eae
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoEliminate LeafRefPathParseException 35/61235/2
Robert Varga [Sat, 5 Aug 2017 16:57:11 +0000 (18:57 +0200)]
Eliminate LeafRefPathParseException

LeafRefPathParseException is never caught and used only internally.
Refactor internals to return an Optional() and propagate an IAE instead.

Change-Id: Ibd35390b1481e16a73980d0b5aaf10b929ae282c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoUse ValueNode in LeafRefValidation 34/61234/2
Robert Varga [Sat, 5 Aug 2017 16:56:19 +0000 (18:56 +0200)]
Use ValueNode in LeafRefValidation

ValueNode is the common ancestor of LeafNode and LeafsetEntryNode,
so we can do a single instanceof check.

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