yangtools.git
7 years agoBUG-7057: introduce UntrustedXML class 27/47727/5
Robert Varga [Fri, 28 Oct 2016 10:21:46 +0000 (12:21 +0200)]
BUG-7057: introduce UntrustedXML class

This adds the basic newDocumentBuilder() and newSAXParser()
methods. The class is expected to grow more methods in future.

Change-Id: I019891af5f9e8be15eda158bb6e40243dcec0614
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7052: move ModuleIdentifierImpl 35/47735/4
Robert Varga [Fri, 28 Oct 2016 12:08:29 +0000 (14:08 +0200)]
BUG-7052: move ModuleIdentifierImpl

This is the last remnant of the old parser. Since this
implements a model.api concept, move it to model.util
so it can be widely reused.

Change-Id: Ife75438560b3981cf3bf4608c8a2e28faecc4ed7
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6522: fix missed optimization 43/47743/1
Robert Varga [Fri, 28 Oct 2016 19:08:59 +0000 (21:08 +0200)]
BUG-6522: fix missed optimization

Previous patch has started to check the namespace node
and allocate a map when needed, but we forgot to initialize
it to ImmutableList. This patch fixes that.

Change-Id: I2d99f8d0e63e594e2b73a547e15a879fbc3c40bd
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7038: cleanup parser listener 08/47708/2
Robert Varga [Thu, 27 Oct 2016 21:17:28 +0000 (23:17 +0200)]
BUG-7038: cleanup parser listener

Rework the logic so we throw a SourceException as soon
as possible.

Change-Id: Ie704b87d408f2b5d4f310b6ff2c933607809288a
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6522: do not cache import in SourceSpecificContext 07/47707/1
Robert Varga [Thu, 27 Oct 2016 18:39:15 +0000 (20:39 +0200)]
BUG-6522: do not cache import in SourceSpecificContext

Change-Id: Ia40da378f598f69208c5aa4afa55d5d12d86752a
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7051: move nasmespace declarations 06/47706/1
Robert Varga [Thu, 27 Oct 2016 18:35:31 +0000 (20:35 +0200)]
BUG-7051: move nasmespace declarations

ImportedModuleContext and IncludedModuleContext are based
on the same concepts as BelongsToModuleContext, hence they
should live in the same package.

Alternative would be to move them to rfc6020, but that really
is not appropriate, as it would increase coupling
of stmt.reactor with stmt.rfc6020.

Change-Id: Id60f4788d84404b861b5fba17b68eba7a43cc3cc
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoCleanup StatementContextWriter 93/47693/2
Robert Varga [Thu, 27 Oct 2016 16:58:05 +0000 (18:58 +0200)]
Cleanup StatementContextWriter

- do not declare SourceException as thrown
- make class final
- make phase final
- hide deferredCreate()

Change-Id: I72cdf60859fc70f1bdf8cf9b9f2845990535abf6
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoDocument RootStatementContext's relationship to other nodes 92/47692/2
Robert Varga [Thu, 27 Oct 2016 13:16:53 +0000 (15:16 +0200)]
Document RootStatementContext's relationship to other nodes

This adds a wee bit of information of how RootStatementContext
relates to other contexts.

Also adds lazy population of included lists, as these are typically
empty or sparsely populated. These are also enforced to be
RootSchemaContexts to make navigation through the maze of
implementations of storage methods more obvious.

Change-Id: I2a3f91c454a0213e6678ef97a91690acda32a2ca
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6979 - yang.model.util.EffectiveAugmentationSchema is mutable 31/47631/3
Filip Gregor [Tue, 25 Oct 2016 11:10:34 +0000 (13:10 +0200)]
Bug 6979 - yang.model.util.EffectiveAugmentationSchema is mutable

fixed leak of mutable set

Change-Id: Iaa0dac93e3521a9a091feb7ea0c78e9c6b0e20e5
Signed-off-by: Filip Gregor <fgregor@cisco.com>
7 years agoRevert "BUG-6522: create a dedicated extensions map" 28/47628/1
Robert Varga [Wed, 26 Oct 2016 16:14:44 +0000 (18:14 +0200)]
Revert "BUG-6522: create a dedicated extensions map"

This reverts commit 7eafc450f8a7c09f9d98c0d4d7608b16588244cb,
as it breaks extension resolution in GBP's ned.yang.

The problem boils down to an extension declared in a submodule
to of tailf-comon to fail to resolve.

Change-Id: Idaa4be44dc0ef18b0e5cca5153b37a3ec7042cf2
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6522: create a dedicated extensions map 68/47568/8
Robert Varga [Tue, 25 Oct 2016 23:24:15 +0000 (01:24 +0200)]
BUG-6522: create a dedicated extensions map

SourceSpecificContext already calls out to BuildGlobalContext
to lookup up support statements, hence the potential extension
lookup will be slower.

This lookup occurs before we check for type arguments, hence
we want to keep it fast. Therefore we take a snapshot of all
extensions defined in the global context.

Also make StatementDefinitionNamespace a source-local, so the
definitions do not leak outside of the module where they are
defined.

Change-Id: I0c50de89cee5d4297e8ccd0cb61203c3cfe9a2f3
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6522: streamline QNameToStatementDefinitionMap API 67/47567/5
Robert Varga [Tue, 25 Oct 2016 22:44:19 +0000 (00:44 +0200)]
BUG-6522: streamline QNameToStatementDefinitionMap API

This really is a Map, but let's not as far as declaring
it as such.

Add putAll() and putIfAbsent(), which make life way easier
for SourceSpecificContext -- which is the sole user. The end
result is better performance at least in the bulk case,
as we end up populating one of the maps via addAll().

Also take time to formulate the class in terms of lambas,
as that takes a lot of verbosity out.

Change-Id: Ie4f70cbc01011eb49b330ea4411d8308c401f76d
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoCleanup SupportedExtensionsMapping 13/47613/2
Robert Varga [Wed, 26 Oct 2016 13:28:54 +0000 (15:28 +0200)]
Cleanup SupportedExtensionsMapping

Align members to make them more readable.

Change-Id: I694c87d46e1d7a8fd5b5a28e87d0fe8a9f5a7807
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6964: reuse StatementDefinitionNamespace 64/47464/10
Robert Varga [Mon, 24 Oct 2016 19:04:29 +0000 (21:04 +0200)]
BUG-6964: reuse StatementDefinitionNamespace

Instead of performing two lookups, cache the extension's
statement in the source's maps, so it behaves just like
any other statement.

Change-Id: Ie71bedeefb57f5fc1575515cccf56f03ad373117
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6522: intern cached QNames 51/47551/5
Robert Varga [Tue, 25 Oct 2016 17:37:57 +0000 (19:37 +0200)]
BUG-6522: intern cached QNames

Heap analysis has shown a huge number duplicate QNameModules
being retained through QNames in this map, wasting about 4MB
of memory. Make sure we run QName.intern() before we store
them. The lookup path is still okay.

Change-Id: I389c16d4c097935dd6ff63da5623b96289a5fe0c
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoRemove an unneeded branch 57/47557/3
Robert Varga [Tue, 25 Oct 2016 18:06:45 +0000 (20:06 +0200)]
Remove an unneeded branch

Instead of maintaining a boolean in an else branch,
examine the resulting collection to see if there is
anything left. Simplifies and speeds up the code.

Change-Id: Ie87c5f845b866e6637a6af0e43cb2153d8e05363
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7025: make the parser tree immutable 44/47544/4
Robert Varga [Tue, 25 Oct 2016 16:04:37 +0000 (18:04 +0200)]
BUG-7025: make the parser tree immutable

This adds a post-processing phase, which walks the entire tree
and makes sure children are initialized to an ImmutableList.

This is essentially the same operation as running the tree
through org.antlr.v4.runtime.Parser.TrimToSizeListener, except
it also initializes empty lists to immutable collection and
uses a more efficient implementation for singletons.

Change-Id: I2cf484654158ce01bb9f7c2ac51a9866f88ae320
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoOptimize toString() methods 25/47525/2
Robert Varga [Tue, 25 Oct 2016 14:19:48 +0000 (16:19 +0200)]
Optimize toString() methods

There is no need to use String.format(), just use a simple
string concatenation.

Change-Id: I97383a662a4c7a634ad0dd17da5cc626a891ebc8
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6522: do not re-read models 28/47528/2
Robert Varga [Tue, 25 Oct 2016 14:22:29 +0000 (16:22 +0200)]
BUG-6522: do not re-read models

The source text is ignored, so there is no point in reading it.

Deprecate the current method which makes it look like the text
is needed. And eliminate the read.

Change-Id: Ib5550e6e40ecad1c0883a21e39fada8136c5b820
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7025: Use ParseTreeWalker.DEFAULT 26/47526/4
Robert Varga [Tue, 25 Oct 2016 14:20:57 +0000 (16:20 +0200)]
BUG-7025: Use ParseTreeWalker.DEFAULT

We do not need to instantiate new walkers, as there
is a utility instance available for reuse.

Change-Id: I3fb20fd333f1f133bc2427f9d21ddddd8721b972
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6522: grow namespaces lazily 50/47550/2
Robert Varga [Tue, 25 Oct 2016 17:22:39 +0000 (19:22 +0200)]
BUG-6522: grow namespaces lazily

NamespaceStorageSupport is the superclass of StatementContextBase,
hence allocating a default-sized HashMap results in ~75MiB wasted
space. Add lazy expansion to limit the overhead associated with
tracking these.

Change-Id: I0825aee92487c94421ef9e505152bbc5fc7383cb
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6522: lower map sizing 53/47553/2
Robert Varga [Tue, 25 Oct 2016 17:43:37 +0000 (19:43 +0200)]
BUG-6522: lower map sizing

Useing default-sized HashSet is wasteful, as we typically
have only a single requires/mutates action. This will lower
wastage which was observed to be around 600kB.

Change-Id: I642403858f2cab71c8896b2aa8a8cb0131306236
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6522: do not accidentally grow lists 49/47549/5
Robert Varga [Tue, 25 Oct 2016 17:11:40 +0000 (19:11 +0200)]
BUG-6522: do not accidentally grow lists

If we end up with an empty collection being passed in,
do not do any processing so we do not inflate lists
unnecessarily. In profiling this showed to waste as
much as 23MiB of memory.

Change-Id: Ibb47953894162e6658f473ca763f17b8a98d2cb2
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBump antlr to 4.5.3 46/47546/2
Robert Varga [Tue, 25 Oct 2016 16:29:51 +0000 (18:29 +0200)]
Bump antlr to 4.5.3

https://github.com/antlr/antlr4/issues?utf8=%E2%9C%93&q=milestone%3A4.5.2+is%3Aclosed+is%3Aissue
https://github.com/antlr/antlr4/issues?utf8=%E2%9C%93&q=milestone%3A4.5.3+is%3Aclosed+is%3Aissue

Change-Id: I73420bae05fdecbb5dc1042f3cf590eb27c47eb4
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6522: Optimize RFC6020 utils 89/47489/4
Robert Varga [Tue, 25 Oct 2016 10:46:41 +0000 (12:46 +0200)]
BUG-6522: Optimize RFC6020 utils

getValidStatementDefinition() should not look up
the definition twice. Rework it to make it more linear.

Also use java.util.Optional.

Change-Id: Ic82665482ed884f5ee21dfd18a3c9a4a062868e7
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoCleanup SchemaNodeIdentifierBuildNamespace 19/47419/3
Robert Varga [Mon, 24 Oct 2016 13:50:09 +0000 (15:50 +0200)]
Cleanup SchemaNodeIdentifierBuildNamespace

Remove unnecessary branches.

Change-Id: I151c304ed2a2790181f0152fa95c811ab031bfd8
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoPrevent a boxing operation 38/47438/2
Robert Varga [Mon, 24 Oct 2016 15:14:12 +0000 (17:14 +0200)]
Prevent a boxing operation

Eclipse warns about boxing to a Boolean, so use a constant
Boolean.TRUE instead of a boolean.

Change-Id: Ida3bccbec591189390fc34983bd6107e3dea44d2
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-4456: rework leaker integration 51/47451/3
Robert Varga [Mon, 24 Oct 2016 16:27:14 +0000 (18:27 +0200)]
BUG-4456: rework leaker integration

Rather than spreading the use of leaker across three
classes, centralize its use in ExtensionEffectiveStatementImpl
by exposing a protected method which can be overridden.

This is a bit cleaner solution and should end up being more
performant, as other statements do not end up touching
the thread-local variable.

Change-Id: I6f26dca90c0e5a907e98c65aa953f52ef87364e0
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6972: optimize SourceSpecificContext 57/47457/3
Robert Varga [Mon, 24 Oct 2016 17:59:48 +0000 (19:59 +0200)]
BUG-6972: optimize SourceSpecificContext

Statement supports are singletons, do not instantiate
them more than once.

Also make sure we grow importedNamespaces lazily, as there
typically are only a few imports.

Change-Id: Iadfc078fbd4d5e1d6b8b6bfe9e8721ae852ddc07
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoImprove parser reactor logging 91/47391/8
Robert Varga [Sun, 23 Oct 2016 14:36:23 +0000 (16:36 +0200)]
Improve parser reactor logging

Add a few logging calls and implement toString() methods
so that the reactor progress can be observed.

Change-Id: Id475ba3aaba75040fe523b1d43c23e893ad25464
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6972: enforce statement state when copying 17/47417/6
Robert Varga [Mon, 24 Oct 2016 10:40:32 +0000 (12:40 +0200)]
BUG-6972: enforce statement state when copying

It does not make sense to copy statements which have
not been resolved to effective ones. Add a state check
to enforce that.

Also improve documentation.

Change-Id: I5fef0ce57061135244399a969fc932ac014baadc
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6522: grow StatementContext collections lazily 25/47325/14
Robert Varga [Fri, 21 Oct 2016 09:56:10 +0000 (11:56 +0200)]
BUG-6522: grow StatementContext collections lazily

A lot of statements do not have any substatements at all,
so grow collections as needed. For listeners also remove
sub-collections when then are no longer needed.

Change-Id: Ia429bd3761675fb00f742472042b31aa15862e7b
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6972: eliminate AugmentUtils 37/47437/3
Robert Varga [Mon, 24 Oct 2016 15:00:31 +0000 (17:00 +0200)]
BUG-6972: eliminate AugmentUtils

The only callsite is AugmentStatementImpl, so move the code there
so it can be optimized, resolving a long-standing FIXME.

Change-Id: I1052e9c0956a13444252992fa0693d493a07a709
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6972: refactor copy checking 55/47355/13
Robert Varga [Fri, 21 Oct 2016 15:30:05 +0000 (17:30 +0200)]
BUG-6972: refactor copy checking

Original checking code was hard to read, this refactors
it to be more readable and understandable. It also
splits the two sets of copy operation invokers so they
do not share the same set of rules, as they need to be
different.

Change-Id: I9b4f831484c18228b3308709a8a8752bcc8e1b65
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6669: Mandatory nodes cannot be added to node from another module via augment 82/45382/15
Peter Kajsa [Thu, 8 Sep 2016 14:25:48 +0000 (16:25 +0200)]
Bug 6669: Mandatory nodes cannot be added to node from another module via augment

Yang parser allowed to add mandatory nodes to target node from another module
via augmentations in some cases. This patch fixes this according to the rules defined
in RFC6020 (https://tools.ietf.org/html/rfc6020#section-3.1,
https://tools.ietf.org/html/rfc6020#section-7.15).

Change-Id: I699fc3c1014583b85ea47504f9a102d06e0b9011
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoBUG-6972: Consolidate copy operations 54/47354/11
Robert Varga [Fri, 21 Oct 2016 15:10:54 +0000 (17:10 +0200)]
BUG-6972: Consolidate copy operations

This patch moves common code into a 'copy statement' utility
method, making sure we have do not leak it.

Change-Id: Iba205a6019977c3e6c30762dfb1407b13ec7cf37
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoHide BuildGlobalContext methods 90/47390/4
Robert Varga [Sun, 23 Oct 2016 14:35:30 +0000 (16:35 +0200)]
Hide BuildGlobalContext methods

Non-public class, there is no point in having its methods
declared as public.

Change-Id: Iba52f5c7fb9da4fa5b79ca37308f5af126aaf7d0
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6972: Remove GroupingUtils.needToCreateNewQName() 53/47353/9
Robert Varga [Fri, 21 Oct 2016 14:45:06 +0000 (16:45 +0200)]
BUG-6972: Remove GroupingUtils.needToCreateNewQName()

This is hard-wired to true and has a single caller,
remove the method and simplify caller.

Change-Id: I955c37b7a9e6b6a4418e1be23b89659a637a1ea0
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6522: create a specialized CopyHistory object 48/47348/9
Robert Varga [Fri, 21 Oct 2016 13:45:43 +0000 (15:45 +0200)]
BUG-6522: create a specialized CopyHistory object

Copy histories have a limited number of operations, hence
mutating implementation can express the set of required operations
more efficiently. Also adds some tests to make sure the class
works correctly.

Change-Id: I0b2fd9fffa8a4bc754a9eff3808648f8f5726243
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6329: Parser fails when target node of uses-augment is an unknown node 18/46118/7
Peter Kajsa [Thu, 22 Sep 2016 11:57:39 +0000 (13:57 +0200)]
Bug 6329: Parser fails when target node of uses-augment is an unknown node

Yang parser fails when target node of uses-augment is an unknown node. It is not
quite clear whether such yang model is valid according to RFC6020 or not, but
yang parser failure causes lots of trouble, because such augment is used widely
in some yang models. So this patch prevents failure of yang parser and rather
introduces a warning and augmentation is not performed, when target node is
an unknown node.

Change-Id: I7f1c5d7b3ef0898ca098466702d7cb1ad7a0f30f
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoBug 6958 - add class NotificationAsContainer for transforming xml format notification... 52/47052/10
Geng Xingyuan [Tue, 18 Oct 2016 07:51:56 +0000 (15:51 +0800)]
Bug 6958 - add class NotificationAsContainer for transforming xml format notification to java Notification interface.

move utility class ConstraintDefinitions and EmptyConstraintDefinition to yang-data-util.
new utility class ContainerSchemaNodes for transforming yang rpc or notification to xml

Change-Id: Ib8f3ca23e8a3e67446ed5f4aa9e4c7b16ffb2d85
Signed-off-by: Geng Xingyuan <geng.xingyuan@zte.com.cn>
7 years agoBUG-6522: share instances of Config(Effective)Statement 18/47318/5
Robert Varga [Fri, 21 Oct 2016 09:00:15 +0000 (11:00 +0200)]
BUG-6522: share instances of Config(Effective)Statement

Config statement has low cardinality, use specialized classes
for its representation.

Change-Id: I7b5dc7e7069e5e7cfa4808d44a95f147f6b7073d
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6522: allocate copyHistory lazily 24/47324/2
Robert Varga [Fri, 21 Oct 2016 09:39:14 +0000 (11:39 +0200)]
BUG-6522: allocate copyHistory lazily

Most of the statements start off with being just originals,
so we can use a shared constant for their copy history
and replace it when it is modified.

Change-Id: Ia4fcd63d2bfb42d8ba5dc29daf74aa330e5b3689
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6972: Preliminary unit test 12/47312/3
Igor Foltin [Fri, 21 Oct 2016 07:19:26 +0000 (09:19 +0200)]
Bug 6972: Preliminary unit test

For now, this patch contains just a unit test which will
test the actual fix once it is implemented.
Therefore, the test is currently silenced with @Ignore.

Change-Id: I7b7ce9e2384f942cd13d46c59f868e125ae327c7
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBUG-6522: Adjust collection sizes 16/47316/3
Robert Varga [Fri, 21 Oct 2016 08:38:21 +0000 (10:38 +0200)]
BUG-6522: Adjust collection sizes

StatementContexts are typically leaves or have a low number
of children, leading to wasted space during parsing.

Force collections to be allocated with minimum size and have
them grow as needed, so we limit the run-time overhead.

Change-Id: I30b87e7164f081251bdd44092858be1254d42cba
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6965: introduce BuiltinDeclaredStatements 17/47217/4
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>
7 years agoBUG-6964: define a namespace to hold model-defined statements 03/47203/6
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>
7 years agoImprove ContextBuilder error reporting 13/47213/4
Robert Varga [Thu, 20 Oct 2016 15:14:21 +0000 (17:14 +0200)]
Improve ContextBuilder error reporting

Instead of throwing an IllegalArgumentException throw
a proper SourceException, which will explain what statement
does not take an argument, pointing to the offending source.

Change-Id: Iee9a984c557f218195f0654bbb54d9e27a9cb9f6
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoPrevent boxing 15/47315/2
Robert Varga [Fri, 21 Oct 2016 08:35:36 +0000 (10:35 +0200)]
Prevent boxing

Objects.equals() will force a boxing operation
followed by a null check. Instead of that use
Boolean.TRUE.equals().

Change-Id: Ied4c50fb700650965f695a6ec121fb2b64510b9a
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-3876: Add ExprListener and friends 99/47199/2
Robert Varga [Thu, 20 Oct 2016 11:47:31 +0000 (13:47 +0200)]
BUG-3876: Add ExprListener and friends

This adds interfaces for walking the expression tree.

Change-Id: I1b3f9930c7a1ef70b6f2d87762683a86493bd698
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoFix a few checkstyle warnings 14/47214/2
Robert Varga [Thu, 20 Oct 2016 15:28:20 +0000 (17:28 +0200)]
Fix a few checkstyle warnings

Whitespace around =
Overload method distance

Change-Id: I96160154de4a2ea201305aec2a7d800b95a143b3
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6491: Some imports are not exposed in Module.getImports 29/47129/5
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>
7 years agoBug 6961: SchemaContext.getAllModuleIdentifiers() doesnt work for submodules 21/47121/4
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>
7 years agoReuse cardinality constants 45/47045/6
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>
7 years agoFix GroupingEffectiveStatementImpl's unknown nodes 74/47074/2
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>
7 years agoFix inefficient ConstraintEffectiveStatements 73/47073/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>
7 years agoBUG-4456: add RecursiveExtensionResolver 42/47042/8
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>
7 years agoBUG-6757: revert fix for BUG-4456 38/47038/3
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>
7 years agoFix failing unit test in QueuedNotificationManagerTest 59/47059/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>
7 years agoBUG-5410: introduce RegularExpression.toPatternString() 44/45144/5
Robert Varga [Mon, 5 Sep 2016 07:48:10 +0000 (09:48 +0200)]
BUG-5410: introduce RegularExpression.toPatternString()

This patch adds a method useful for converting a RegularExpression
into a Pattern-compatible string.

Change-Id: I6ab002dc6e9324967d41072ea46af4d65363bff0
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoSupport testing null against null in equalsHelper() 99/46599/4
Stephen Kitt [Thu, 6 Oct 2016 08:13:58 +0000 (10:13 +0200)]
Support testing null against null in equalsHelper()

In its intended context, equalsHelper() should never be called with
two null parameters, but it's easy to support the general case — and
because this isn't SQL, null equals itself.

Change-Id: I826435e81a4dd59aaac72ad9ab07a80069f7a17f
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoBUG-5410: optimize CaseInsensitiveMap 46/45146/3
Robert Varga [Mon, 5 Sep 2016 09:43:47 +0000 (11:43 +0200)]
BUG-5410: optimize CaseInsensitiveMap

This propagates would-be constants to real constatants,
allowing them to be better optimized.

Change-Id: I500e8060db0f3e22ca19be4188169f74e9a03271
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5410: import message catalogue 43/45143/3
Robert Varga [Mon, 5 Sep 2016 07:15:43 +0000 (09:15 +0200)]
BUG-5410: import message catalogue

xsd-regex being an Apache source, it uses ResourceBundle
to load translations. Add them to ensure the project works.

Change-Id: If2615cec2edb99eca86e2a06dfc6b3c27b7ca7c5
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoequalsHelper (MoreObjects2) 13/42513/12
Michael Vorburger [Mon, 25 Jul 2016 23:26:14 +0000 (01:26 +0200)]
equalsHelper (MoreObjects2)

Moving this class "downwards" from mdsalutil, because this really is a
generic utility helper class, which probably best fits into
yangtools.utils.

Change-Id: I0d8c6dd44790a85f7efccd6f83d42e6bd7e084bb
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoIncrease unit test coverage for Yangtools 34/46334/2
Igor Foltin [Sun, 2 Oct 2016 10:19:10 +0000 (12:19 +0200)]
Increase unit test coverage for Yangtools

Added test for YangTextSchemaContextResolver.
Extended test for declared statements.

Change-Id: Ibdf7e416287240cae8f673c3ecf817faaf275d5f
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBug 6771: Problem with typedefs nested in augment 23/46223/3
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>
7 years agoIncrease unit test coverage for Yangtools 30/46130/2
Igor Foltin [Fri, 23 Sep 2016 13:18:12 +0000 (15:18 +0200)]
Increase unit test coverage for Yangtools

Added several unit tests.

Change-Id: I57b4b6c84fd489f2546189bb66bc03490ccf194f
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoNaming convetion fix of some unit tests in yang-parser-impl 45/46245/2
Peter Kajsa [Wed, 28 Sep 2016 09:43:30 +0000 (11:43 +0200)]
Naming convetion fix of some unit tests in yang-parser-impl

Change-Id: I2a609752a3f56a2129d4c54355ea347190a40fe1
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoUse YangInstanceIdentifier.EMPTY 32/46132/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>
7 years agoAllow QueuedNotificationManager to batch notifications 94/46094/7
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>
7 years agoAdd batching to QueuedNotificationManager 93/46093/2
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>
7 years agoBug 6551: Support for third-party Yang extensions implementation 26/45226/7
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 agoBUG-5410: use Deque instead of a Stack 40/45140/3
Robert Varga [Mon, 5 Sep 2016 06:54:47 +0000 (08:54 +0200)]
BUG-5410: use Deque instead of a Stack

java.util.Stack is superseded by Deque and its implementations,
which are not synchronized. Use an ArrayDeque instead of a Stack.

Change-Id: I4e7fca6bb77c7122c56d3a85c5de3d264699765a
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoCleanup QueuedNotificationManager 38/45938/2
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>
7 years agoUse LongAdder instead of an atomic long 98/45898/1
Robert Varga [Tue, 20 Sep 2016 14:40:37 +0000 (16:40 +0200)]
Use LongAdder instead of an atomic long

LongAdder has better performance under contention,
use it for tracking counter.

Change-Id: If32e17a8e16b2a1418c744a54aaa84e8479f3852
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoAdd YangInstanceIdentifier fast paths 97/45897/1
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>
7 years agoFix ConstraintDefinition inconsistency 06/45806/5
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>
7 years agoIncrease unit test coverage for Yangtools 45/45745/2
Igor Foltin [Fri, 16 Sep 2016 17:30:10 +0000 (19:30 +0200)]
Increase unit test coverage for Yangtools

Added test for NormalizedNodes.
Added test for DataTreeCandidates
Added test for DataTreeConfiguration.
Added test for NormalizedNodeDataTreeCandidateNode.

Change-Id: I71773e12f5a4d12f38c034740e3622ba94089bbc
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBUG-5410: fixup javadocs 39/45139/2
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>
7 years agoBUG-5410: add minimal IntStack implementation 81/39181/3
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>
7 years agoBug 3899: Milestone: Increase test coverage for Yangtools 59/45459/1
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>
7 years agoBUG-5561: use canonical Bits order 58/45158/4
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>
7 years agoYangtools documentation 97/45197/3
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>
7 years agoUse lambdas instead of anonymous classes 68/45068/6
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>
7 years agoFix a few warnings 07/45207/1
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>
7 years agoFix a bunch of warnings 48/45148/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>
7 years agoEliminate unneeded import 63/44863/2
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>
7 years agoBUG-6497: Do not lose augmentation statement order 75/44975/2
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 agoYangtools documentation 37/44937/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>
7 years agoBUG-6497: Do not lose augmentation statement order 75/44875/3
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>
7 years agoBUG-6316: Fix Bit and EnumPair's position/value types 55/42855/12
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>
7 years agoBug 6420: Fixed SemVer's valueOf method 59/43959/2
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>
7 years agoBug 6410: Fixed initialization of typedefs in rpc 36/44036/3
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>
7 years agoBug 6419: Fixed SchemaContextEmitter's emitContainer method 75/43975/3
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>
7 years agoBug 3899: Milestone: Increase test coverage for Yangtools 57/43857/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>
7 years agoBug 6416: Fixed SchemaContextEmitter's emitIdentityrefSpecification method 71/43971/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>
7 years agoBug 6414: Fixed DataNodeIterator's traverseModule method 70/43970/3
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>
7 years agoRevert "Bug 5968: Mandatory leaf enforcement does not work in some cases" 68/43968/2
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>
7 years agoBUG-865: remove String-based getDataChildByName() 98/42898/7
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>
7 years agoBug 5968: Mandatory leaf enforcement does not work in some cases 09/42709/4
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>