yangtools.git
7 years agoFix IT test instantiation 35/48635/2
Robert Varga [Wed, 23 Nov 2016 16:54:39 +0000 (17:54 +0100)]
Fix IT test instantiation

We should be passing maven options for all tests, fix
the two omissions.

Change-Id: I43b5a001997547dc9935f390f046a5d8d839cd9f
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoJava 8: migrate to java.util.function.Function 37/47837/6
Stephen Kitt [Wed, 2 Nov 2016 13:15:20 +0000 (14:15 +0100)]
Java 8: migrate to java.util.function.Function

... where possible without breaking non-@Beta APIs.

Change-Id: I2d1a4708cdc08c83810267757e9eb0b98a6bf1eb
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoAddress trivial eclipse warnings 01/48501/3
Robert Varga [Sat, 19 Nov 2016 14:51:40 +0000 (15:51 +0100)]
Address trivial eclipse warnings

- missing javadoc
- superfluous else branches
- checkstyle violations

Change-Id: Ibf74b95d6ae7d1c9889852f541cce3e9d6b28bb4
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoRevert "Bug 5968: Mandatory leaf enforcement does not work in some cases" 23/48523/1
Luis Gomez [Sun, 20 Nov 2016 17:55:22 +0000 (17:55 +0000)]
Revert "Bug 5968: Mandatory leaf enforcement does not work in some cases"

This reverts commit 655c13c48277155b02706b75c88554c4a05ce673
and commit 3e4972b4e8edd7387666808014cd33daddef2cb5.

Change-Id: I9b12e58767ad70cb98a44b0a81560725b1a2afa5
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoBug 6868 - [Yang 1.1] Argument of "If-feature" statement may be a boolean expression... 34/48234/6
Rashmi Pujar [Thu, 10 Nov 2016 21:10:27 +0000 (16:10 -0500)]
Bug 6868 - [Yang 1.1] Argument of "If-feature" statement may be a boolean expression over feature names

Change-Id: I04d30b1d2341bd1b30e4c56b11b6da3116787947
Signed-off-by: Rashmi Pujar <rpujar@inocybe.com>
7 years agoBug 6896: [YANG 1.1] Add support for new statement "action" 35/48035/8
Igor Foltin [Sun, 6 Nov 2016 14:37:38 +0000 (15:37 +0100)]
Bug 6896: [YANG 1.1] Add support for new statement "action"

API changes in yang-model-api.

Change-Id: I154400f86f838aef9f93edb948af19ec1fe4110a
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBug 6874: [YANG 1.1] Allow "description" and "reference" in "import" and "include" 46/48246/3
Igor Foltin [Wed, 9 Nov 2016 14:31:08 +0000 (15:31 +0100)]
Bug 6874: [YANG 1.1] Allow "description" and "reference" in "import" and "include"

API changes in yang-model-api.

Change-Id: Id8e2c294374b61e254fd0d023cda4e8071cc86d1
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBug 6871: [YANG 1.1] Allow "must" in "input", "output" and "notification statements" 74/47974/5
Igor Foltin [Wed, 2 Nov 2016 11:26:10 +0000 (12:26 +0100)]
Bug 6871: [YANG 1.1] Allow "must" in "input", "output" and "notification statements"

API changes in yang-model-api.

Change-Id: I79a2ff10dc79bc18094209426676e60849905580
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBug 6877: [YANG 1.1] Allow identities to be derived from multiple base identities 48/48048/6
Igor Foltin [Mon, 7 Nov 2016 12:04:34 +0000 (13:04 +0100)]
Bug 6877: [YANG 1.1] Allow identities to be derived from multiple base identities

API changes in yang-model-api

Change-Id: I95745785901f29d421c77a35325cf7565f9d5f51
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBUG-5717: add unique child identifier 41/48241/11
Robert Varga [Fri, 11 Nov 2016 02:46:54 +0000 (03:46 +0100)]
BUG-5717: add unique child identifier

We need to synchronize the parse tree walker with
the StatementWriter, so they can pair statements
across multiple phases. Adjust StatementWriter
to take an int childId to achieve this.

Change-Id: Ie3e210a9084cbe5a86212046083c359393a912f8
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7161: Do not tolerate source-level exceptions 73/48273/4
Robert Varga [Fri, 11 Nov 2016 17:58:33 +0000 (18:58 +0100)]
BUG-7161: Do not tolerate source-level exceptions

We should not be suppressing malformed exceptions,
as that can result in us not providing correct
interpretation of models.

Change-Id: I535f066b329f02489f492e9a2b60f86bd5e21019
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6870: [YANG 1.1] Support for new substatement "modifier" in "pattern" statement 99/47899/5
Igor Foltin [Wed, 2 Nov 2016 09:43:32 +0000 (10:43 +0100)]
Bug 6870: [YANG 1.1] Support for new substatement "modifier" in "pattern" statement

API changes in yang-model-api.

Change-Id: I3ef2dc64b68d17d85e2a6c3ea0da0aece34d2fe7
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBug 6897: [YANG 1.1] Allow notifications to be tied to data nodes 45/48245/2
Igor Foltin [Wed, 9 Nov 2016 15:29:11 +0000 (16:29 +0100)]
Bug 6897: [YANG 1.1] Allow notifications to be tied to data nodes

API changes in yang-model-api.

Change-Id: Id50b2712842ed7d58a14e731c9bcebe0b10a9d9b
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBug 6869: [YANG 1.1] Allow if-feature in bit, enum, identity and refine statements 73/47773/5
Igor Foltin [Mon, 31 Oct 2016 09:52:53 +0000 (10:52 +0100)]
Bug 6869: [YANG 1.1] Allow if-feature in bit, enum, identity and refine statements

API changes in yang-model-api

Change-Id: I5aa4de28e0014e16d1349469024f016f25442635
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBug 6883: [YANG 1.1] Add support for anydata statement 05/48105/4
Igor Foltin [Tue, 8 Nov 2016 09:12:15 +0000 (10:12 +0100)]
Bug 6883: [YANG 1.1] Add support for anydata statement

API changes in yang-model-api.

Change-Id: Ic5afed07a487b7311b83c9bd01a077592f1359ae
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBug 6880: [YANG 1.1] Allow leaf-lists to have default values 85/47985/3
Igor Foltin [Wed, 2 Nov 2016 15:20:34 +0000 (16:20 +0100)]
Bug 6880: [YANG 1.1] Allow leaf-lists to have default values

API changes in yang-model-api

Change-Id: I12dc3b9606a06a751bd7788092dc2de76441f598
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBug 6873: [YANG 1.1] Support for "require-instance" in leafref 83/47983/3
Igor Foltin [Wed, 2 Nov 2016 12:35:38 +0000 (13:35 +0100)]
Bug 6873: [YANG 1.1] Support for "require-instance" in leafref

API changes in yang-model-api.

Change-Id: I1144726d2039137335a955555890dbff5e0c6b45
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBUG-5717: eliminate StmtContext.substatements() 05/48205/8
Robert Varga [Thu, 10 Nov 2016 12:49:36 +0000 (13:49 +0100)]
BUG-5717: eliminate StmtContext.substatements()

There is a single caller, which really wants to get
the declared belongs-to statement.

Convert the caller and eliminate the method, making
StatementContextBase.substatements a purely-local
collection lending itself to refactoring.

Change-Id: I980c255eb426558a6a535683ccc8179082919c37
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6150: add an import statement special-case 00/48200/11
Vratko Polak [Thu, 10 Nov 2016 13:41:15 +0000 (14:41 +0100)]
BUG-6150: add an import statement special-case

This is just a hack to get the bug unblocked, a follow-up
patch is needed to really fix the underlying assumptions
about when a statement should be populated into the map.

Unit tests added.

Change-Id: I80273f1971981d62214e3cabfe687d5fcb61abd3
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
7 years agoAdd an empty Deque implementation 40/48240/3
Robert Varga [Fri, 11 Nov 2016 01:53:47 +0000 (02:53 +0100)]
Add an empty Deque implementation

A utility simpleton java.util.Deque which is always empty.
This can be used as a java.uil.Queue, too.

Change-Id: I6435e36bf36b9baf0983cf2fcc13d261c6fa9248
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoFix CursorAwareDataTreeSnapshot.newModification() 79/48179/2
Robert Varga [Wed, 9 Nov 2016 17:45:36 +0000 (18:45 +0100)]
Fix CursorAwareDataTreeSnapshot.newModification()

Cursor-awareness is a transitive property, i.e. cursor-aware
snapshots create cursor-aware modifications.

This change is needed to make downstream users which deal with
modifications and cursors work without dirty casts.

Change-Id: I96a9942e0f37a2ba2ce760185212699da321c5e4
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoFix an eclipse warning 06/48206/1
Robert Varga [Thu, 10 Nov 2016 12:56:02 +0000 (13:56 +0100)]
Fix an eclipse warning

Eclipse @Nonnull inference does not work with fields,
hence it produces a warning even when the field has
been checked via instanceof. Fix this by copying
the field into a local variable.

Change-Id: I9d7948c94b7bb292823ce6e5d4b36a276652f8fd
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 5968: Mandatory leaf enforcement does not work in some cases 62/48162/1
Peter Kajsa [Wed, 9 Nov 2016 14:06:59 +0000 (15:06 +0100)]
Bug 5968: Mandatory leaf enforcement does not work in some cases

Fix of possible IllegalStateException.

Change-Id: Ide4d1bf060dc7ff8fc6286d5a1de03f8a6bedbfc
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agotarget-ide/ on .gitignore 11/48111/2
Michael Vorburger [Tue, 8 Nov 2016 10:51:37 +0000 (11:51 +0100)]
target-ide/ on .gitignore

Change-Id: I0a3fbb507df6a65c531fa82f18e0cdb892d32e13
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoIntern SchemaContext.NAME 13/48113/1
Robert Varga [Tue, 8 Nov 2016 10:59:56 +0000 (11:59 +0100)]
Intern SchemaContext.NAME

This is a constant, we should be interning it.

Change-Id: I403057c9615f5d2ec66173188aa61db664447cc6
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7038: update StatementWriter.startElement() 54/47754/7
Robert Varga [Sun, 30 Oct 2016 00:04:43 +0000 (02:04 +0200)]
BUG-7038: update StatementWriter.startElement()

As noted in YangStatementParserListenerImpl, type
statement handling requires some hacks to work
with current structure.

Move the hack up to StatementContextWriter
by requiring StatementStreamSources to provide
the argument name when then they call startElement().

Change-Id: Ice763854c7dfb80adf27e45fdd8c14c90f3771f5
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7062: add revision awareness to Yin/YangTextSchemaSource 52/47752/7
Robert Varga [Sat, 29 Oct 2016 21:30:04 +0000 (23:30 +0200)]
BUG-7062: add revision awareness to Yin/YangTextSchemaSource

This adds support for parsing file names according
to https://tools.ietf.org/html/rfc6020#section-5.2.

Change-Id: I497aeba2cd801f618fa6a1075558325332623e31
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7054: Check YinDomSchemaSource validity 53/47753/7
Robert Varga [Sat, 29 Oct 2016 22:52:21 +0000 (00:52 +0200)]
BUG-7054: Check YinDomSchemaSource validity

This adds defensive checks on DOMSource, so that basic
YIN structure (namespace, root element, revision, module name)
are discovered.

These are used to construct an accurate SourceIdentifier, which
is then used as the identifier.

Change-Id: I2d2245a903ce687e860d04905f0eb0a966617ceb
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 5968: Mandatory leaf enforcement does not work in some cases 33/44233/10
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. This patch provides fix which ensures mandatory node validation
in all cases above.

In addition, full validation on unsealed modification was performed after each MERGE
operation performed on this modification, which may lead to undesirable results,
because unsealed modification does not have to contain all elements, which can be
added during next operations on this modification. This patch fixes this behavior of
MERGE operation and performs full validation during seal() method.

Change-Id: If653eeda5378cf1ed1418123eb33713ee80976d9
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoBug 6814: Fix (de)serialization of anyxml in JSON 91/47491/4
Igor Foltin [Tue, 25 Oct 2016 11:10:23 +0000 (13:10 +0200)]
Bug 6814: Fix (de)serialization of anyxml in JSON

JSON parser can now deserialize anyxml nodes.
JSON serializer can now serialize anyxml nodes

Change-Id: I815afb5aac82618f27cd26d747d6637eb4e962f0
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoBug 6986: Yang parser system test options 44/47844/4
Peter Kajsa [Wed, 2 Nov 2016 15:30:48 +0000 (16:30 +0100)]
Bug 6986: Yang parser system test options

Added following options to yang parser system test:
usage: yang-system-test [-f features] [-h help] [-p path] [-v verbose] yangFiles...
 -f,--features <arg>   features is a string in the form
                       [feature(,feature)*] and feature is a string in the
                       form [($namespace?revision=$revision)$local_name].
                       This option is used to prune the data model by
                       removing all nodes that are defined with a
                       "if-feature".
 -h,--help             print help message and exit.
 -p,--path <arg>       path is a colon (:) separated list of directories
                       to search for yang modules.
 -v,--verbose          shows details about the results of test running.

Plus yang-system-test was added as a submodule to yang-aggregator.

Change-Id: I5e45edd78d222590aa1a2b3601fcb2f663a4a1d3
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoJava 8: use lambdas and function references 36/47836/2
Stephen Kitt [Wed, 2 Nov 2016 12:33:43 +0000 (13:33 +0100)]
Java 8: use lambdas and function references

This simply switches functional declarations to lambdas where
possible, and lambdas to function references where possible.

Change-Id: I3c0c97349b05aa8e8ecdda85906cbe41ed5c9c1a
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoCleanup: remove redundant type parameters 35/47835/2
Stephen Kitt [Wed, 2 Nov 2016 12:06:12 +0000 (13:06 +0100)]
Cleanup: remove redundant type parameters

Change-Id: Ifcbaf9b3656af33de3fcdda76a671a1eb7cafaba
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoCleanup: remove redundant casts 34/47834/2
Stephen Kitt [Wed, 2 Nov 2016 12:02:36 +0000 (13:02 +0100)]
Cleanup: remove redundant casts

Change-Id: Ibeca74821b2f03c97a31d7bb1b1691c14df33e15
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoBUG-6958: remove yang-data-{api,util} from odl-yangtools-yang-data 58/47658/3
Stephen Kitt [Thu, 27 Oct 2016 09:08:05 +0000 (11:08 +0200)]
BUG-6958: remove yang-data-{api,util} from odl-yangtools-yang-data

Now that yang-data-api and yang-data-util are provided by
odl-yangtools-yang-parser, and since odl-yangtools-yang-data depends
on odl-yangtools-yang-parser, there's no need to keep them in
odl-yangtools-yang-data.

Change-Id: If568088907c16e32d63f6475b7120bca09df1be2
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoGuard Pattern constants with @RegEx 38/40338/8
Robert Varga [Tue, 14 Jun 2016 23:50:14 +0000 (01:50 +0200)]
Guard Pattern constants with @RegEx

We use some hard-coded patterns, extract them to string constants
and annotate those with @RegEx, so they are compile-time validated.

Change-Id: I651d18d665c42abb9402e4ae4669ae058f07b159
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6986: Yang parser system test 38/47538/7
Peter Kajsa [Mon, 24 Oct 2016 11:35:44 +0000 (13:35 +0200)]
Bug 6986: Yang parser system test

In order to measure performance of Yangtools code, a specific
system test is needed.

Change-Id: I1e8952f9bd26ef9e94c747dd1760c13462711930
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoBUG-7054: add YinStatementStreamSource 36/47736/9
Robert Varga [Fri, 28 Oct 2016 12:42:04 +0000 (14:42 +0200)]
BUG-7054: add YinStatementStreamSource

This is a basic stream source, which traverses a DOM node
and its children, emitting stream events.

Change-Id: I536bd97c4b94a818cdf366b0028251f1100d9667
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7054: add a YinTextToDomTransformer 18/47718/10
Robert Varga [Fri, 28 Oct 2016 09:08:18 +0000 (11:08 +0200)]
BUG-7054: add a YinTextToDomTransformer

This is needed to turn a YIN text document into an in-memory
DOM document. That will be then processed by the parser.

Change-Id: I5d3ced18c99f1298b8385247cbfc8fef32e927bb
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7054: support .xml for YIN files 50/47750/2
Robert Varga [Sat, 29 Oct 2016 10:37:52 +0000 (12:37 +0200)]
BUG-7054: support .xml for YIN files

Requiring .yin only is a bit restrictive, allow files
to end with .xml, too.

Change-Id: I0408326c9b4a1bdaa7ed9203651b2b0bf346668a
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7052: move YangErrorListener 49/47749/2
Robert Varga [Sat, 29 Oct 2016 09:27:01 +0000 (11:27 +0200)]
BUG-7052: move YangErrorListener

This class is used by the YANG-specific parser, move it
out of generic 'impl' package to rfc6020.repo.

Change-Id: I402851a4e6aa85090d6f736014ea440c8c79dc5e
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-865: remove old parser remnants 48/47748/2
Robert Varga [Sat, 29 Oct 2016 00:55:40 +0000 (02:55 +0200)]
BUG-865: remove old parser remnants

These classes were used by the old parser, but are
no longer used. Somehow they were not removed, so
do that now.

Change-Id: I366c10bdd8401875e15b68e73a3eaf1a46662eb4
Signed-off-by: Robert Varga <rovarga@cisco.com>
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>