yangtools.git
3 years agoDeprecate StmtContext.getSchemaPath() 36/92236/4
Robert Varga [Sat, 22 Aug 2020 17:49:36 +0000 (19:49 +0200)]
Deprecate StmtContext.getSchemaPath()

We want to be identifying everyone who is touching this state,
as it ends up logically referencing the parent node and is going
away.

JIRA: YANGTOOLS-1131
Change-Id: I33a93bec07e6a3a12afc920eb6fe685fa4339f9b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoReparent BaseQNameStatementSupport 34/92234/3
Robert Varga [Sat, 22 Aug 2020 17:11:03 +0000 (19:11 +0200)]
Reparent BaseQNameStatementSupport

BaseQNameStatementSupport is a specialization of BaseStatementSupport,
reparent it as appropriate. This allows us to finally encapsulate
statement creation completely within BaseStatementSupport.

Since we are ending up with no users for the argument-specialized
subclasses of AbstractStatementSupport, remove these as well.

JIRA: YANGTOOLS-1121
Change-Id: Ief35ca52ff120fef15565a1b44423b95a2defce1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor AbstractEffectiveDocumentedNodeWithStatus 13/92013/11
Robert Varga [Mon, 10 Aug 2020 15:33:42 +0000 (17:33 +0200)]
Refactor AbstractEffectiveDocumentedNodeWithStatus

This is the final vestige of custom-built statements, make sure
to switch it over to require pre-built substatements. This forces
extensions to adopt BaseStatementSupport et al., which is actually
a good thing.

JIRA: YANGTOOLS-1123
Change-Id: Ib1debecae8d2dbb474cb1c8aa34f05d0e1a3ecad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove ValueWithQName.getQname() 32/92232/7
Robert Varga [Fri, 21 Aug 2020 08:33:25 +0000 (10:33 +0200)]
Remove ValueWithQName.getQname()

This is mispelled method, remove it as we have a direct replacement.

Change-Id: I987b7bc056819d199a6963e131bd5f527d416345
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove DataSchemaContextTree.getChild() 30/92230/6
Robert Varga [Fri, 21 Aug 2020 08:29:01 +0000 (10:29 +0200)]
Remove DataSchemaContextTree.getChild()

This method has been superseded by findChild(), remove it now.

Change-Id: Ic478bce28e6c99d830ae2a42fca88c5bd3c970a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove QName.withModule() 31/92231/4
Robert Varga [Fri, 21 Aug 2020 08:29:50 +0000 (10:29 +0200)]
Remove QName.withModule()

AbstractQName.bindTo() provides a more general facility across
all of its subclasses. Remove the old withModule() method.

Change-Id: Iac2c258bbdc880187c7ba4e82ae948e25e9f8c88
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove EffectiveStatement.findAll() 29/92229/2
Robert Varga [Fri, 21 Aug 2020 08:27:59 +0000 (10:27 +0200)]
Remove EffectiveStatement.findAll()

This method has been replaced by getAll(), which has the same
semantics. Remove it now.

Change-Id: I3e5bdc3ec903a9e57d5beb7d996bea9ea4c62691
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd an explicit intermediate YANG representation 53/92153/21
Robert Varga [Fri, 14 Aug 2020 10:55:12 +0000 (12:55 +0200)]
Add an explicit intermediate YANG representation

ANTLR classes are geared towards parsing and raw speed, without much
regards to memory usage. Most notably using ParseTree as our AST ends
up retaining separators and various metadata which we do not really
need.

Add a simplistic intermediate representation for our AST, which where
we pre-process ANTLR trees and de-duplicate strings. This leads to
elimination of 90% of objects, with corresponding reduction of memory
footprint.

JIRA: YANGTOOLS-1130
Change-Id: Idf057bbb1e29280a8e378529401023fb87d18923
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove QNameModule.getRevisionNamespace() 12/92212/1
Robert Varga [Fri, 21 Aug 2020 06:59:03 +0000 (08:59 +0200)]
Remove QNameModule.getRevisionNamespace()

This method is not used anywhere and is actually buggy, remove it.

Change-Id: I575b0a6814c80315c5eed26800d61e36bff0798a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoClean up AbstractQName.checkLocalName() 11/92211/2
Robert Varga [Thu, 20 Aug 2020 18:40:12 +0000 (20:40 +0200)]
Clean up AbstractQName.checkLocalName()

Do not throw IAE on null, use NPE as usual.

Change-Id: I7cb34ffe5b6cb12408ca87088498295d4f5b4c1a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoSpecial-case identifier lexer token 06/92206/2
Robert Varga [Thu, 20 Aug 2020 14:48:41 +0000 (16:48 +0200)]
Special-case identifier lexer token

An unquoted string can be an IDENTIFIER, which is the most common
case anyway. This token does not have to be further validated and
thus it makes sense to special-case it. This has the neat effect
of reducing the depth of our parse tree, too -- bringing memory
usage down by 6.6% versus the original fix.

JIRA: YANGTOOLS-1089
Change-Id: I63701719e90334558048201d70d8264ab9299efb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCorrect (Un)qualifiedQName javadoc 04/92204/2
Robert Varga [Thu, 20 Aug 2020 09:35:23 +0000 (11:35 +0200)]
Correct (Un)qualifiedQName javadoc

This adds a bit of documentation and correcting a mitsaken @return.

Change-Id: I56ed5aa57969fad5230c8b3a30503f162888ee22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd a specialized token factory 07/92007/16
Robert Varga [Mon, 10 Aug 2020 12:07:00 +0000 (14:07 +0200)]
Add a specialized token factory

Our baseline parsing footprint is rather large. We can improve it
by looking at token component sizes and using distinct token classes.

Aside from CommonToken, which are using as fallbacks for text
handling, we introduce 4 specialized classes, three of them seeing
typical use.

Since these classes use smaller fields to hold lazy state, as well
as eliminate typical invariants, we end up saving around 39MiB (12%)
of AST size in a typical case from the field.

JIRA: YANGTOOLS-1128
Change-Id: I600ae6cbe755212e2d1a15ae3e6b369ed0b3b962
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd timing information about local file discovery 98/92198/1
Robert Varga [Thu, 20 Aug 2020 07:41:39 +0000 (09:41 +0200)]
Add timing information about local file discovery

Locating local files actually requires also pasing them to establish
their SourceIdentifier. Add output to establish timing of this step.

Change-Id: I7dec307a4ee8b5b394a929f6ce8cb63229f94485
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFixup nullness in DataTreeCandidates 91/88491/7
Robert Varga [Wed, 18 Mar 2020 13:53:44 +0000 (14:53 +0100)]
Fixup nullness in DataTreeCandidates

getParent() non-nullness is implied by the depth check, which
unfortunately is not caught by automated tools. Reformulate it so
that we have an explicit guard.

Change-Id: I42415387529d5adab04a15cb07baf2eb4568231d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove TypeBuilder @Nullable annotation 96/88496/7
Robert Varga [Wed, 18 Mar 2020 14:23:17 +0000 (15:23 +0100)]
Remove TypeBuilder @Nullable annotation

SpotBugs is getting a bit confused and Eclipse also reports errors
around our use of base type here -- we cannot reasonably express
nullness without sacrificing method finality. Remove annotations
for now, we'll figure out this detail later.

Change-Id: If2f9d4925a2e3815be0e64d912dd14ebd886b6fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove AbstractRootStatement 12/92012/5
Robert Varga [Mon, 10 Aug 2020 15:24:59 +0000 (17:24 +0200)]
Remove AbstractRootStatement

This class is not used anywhere, remove it to reduce clutter.

Change-Id: Ide36ada46bd1ddcde119c7e90d42317db3cfce61
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUpdate AbstractEffectiveDocumentedNodeWithStatus design 53/91953/7
Robert Varga [Fri, 7 Aug 2020 12:06:41 +0000 (14:06 +0200)]
Update AbstractEffectiveDocumentedNodeWithStatus design

We have a number of improvements in mixins, reduce the amount of
memory we need for this abstract class.

Change-Id: I74d636d25bb3a959d7bb6e2c2c720f419c7c13fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove unused abstract classes 52/91952/7
Robert Varga [Fri, 7 Aug 2020 11:52:20 +0000 (13:52 +0200)]
Remove unused abstract classes

We do not need AbstractConstraintEffectiveStatement and
AbstractListConstraintEffectiveStatement anymore. Remove them.

Change-Id: Iaea7c91d4f738fc84384e66531cff2bee4faf513
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove EffectiveStatementBase 51/91951/7
Robert Varga [Fri, 7 Aug 2020 11:45:59 +0000 (13:45 +0200)]
Remove EffectiveStatementBase

This is a badly-designed class, integrate it into its only subclass.

Change-Id: I4ddf2ec785e295c1f854eacb906060b3d76ab94c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove YangStatementStreamSource.getYangAST() 35/92035/4
Robert Varga [Tue, 11 Aug 2020 12:41:37 +0000 (14:41 +0200)]
Remove YangStatementStreamSource.getYangAST()

This method has been deprecated, remove it now.

Change-Id: I6e8c90388887224e2112c48136dd4e8e00428426
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove an unneeded continue 63/92163/1
Robert Varga [Fri, 14 Aug 2020 16:29:28 +0000 (18:29 +0200)]
Remove an unneeded continue

We have an if/else branch, no need for another continue.

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

3 years agoBump versions to 6.0.0-SNAPSHOT 61/92161/1
Robert Varga [Fri, 14 Aug 2020 16:13:47 +0000 (18:13 +0200)]
Bump versions to 6.0.0-SNAPSHOT

This starts the next major development iteration.

Change-Id: I36d948fbb5ab9cacc1ddf2d513887191300e9e70
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoTake advantage of keyword tokenization 52/92152/3
Robert Varga [Fri, 14 Aug 2020 09:09:05 +0000 (11:09 +0200)]
Take advantage of keyword tokenization

Now that the tokenization has been fixed, we can rely on keyword
context to provide us with neatly split prefix and local name --
hence we do not need to perform concat/split.

Change-Id: I5d8e37d2267fefa3c5eafc542e00df33142a0bae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRework YANG lexer/parser 39/92139/8
Robert Varga [Thu, 13 Aug 2020 18:15:06 +0000 (20:15 +0200)]
Rework YANG lexer/parser

The definitions in the parser and lexer are quite arcane and are
actually wrong, not allowing for a number of edge cases, which are
completely valid.

Furthermore the definition of IDENTIFIER is wrong, as it allows /
and : to appear in it -- effectively ruining the tokenization in
parser.

Refactor the lexer to perform correct tokenization in every situation.
This makes it more complicated, but also much more obvious as to
what is going on -- especially with regard as to what decisions
end up being parser's responsibility.

Refactor the parser so it recognizes YANG tokenization constructs,
notably quoted and unquoted strings, and assemble them from lexer
tokens.

JIRA: YANGTOOLS-1089
Change-Id: I34472bf0a7e262d4f633ce271952bbcd7639ef2f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoReplace block comment with a non-greedy rule 37/92137/1
Robert Varga [Thu, 13 Aug 2020 18:09:10 +0000 (20:09 +0200)]
Replace block comment with a non-greedy rule

We do not need an explicit mode here, we can just use a non-greedy
match and move on. This simplifies things a bit.

Change-Id: Ieab6d9cec1b17c8d86cda49cfc46a258a569e5e0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRework keyword parser rule 32/92032/5
Robert Varga [Tue, 11 Aug 2020 09:38:52 +0000 (11:38 +0200)]
Rework keyword parser rule

A keyword is either a plain identifier, or two identifiers concatenated
through a colon. Make this a bit clearer, aiding debugging of issues.

Also push KeywordContext down to
StatementContextVisitor.getValidStatementDefinition(), so that we can
improve efficiency once IDENTIFIER token has been fixed up.

Change-Id: Ic64285255564ae33f8ad208b9a3598ba20cd26fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor YANG statement parser structure 27/92027/3
Robert Varga [Tue, 11 Aug 2020 08:47:25 +0000 (10:47 +0200)]
Refactor YANG statement parser structure

Current definition leads to leading whitespace being considered
a part of the statement. This leads to misleading line/character
being reported as the start of the statement.

Fix this by introducing a top-level 'file', which encapsulates
at least one statement with its leading/trailing whitespace. The
other parts then come together naturally.

JIRA: YANGTOOLS-1129
Change-Id: I9f725b09eae6f8acf4397c97c60f99caaade798b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix AnyxmlSchemaLocationStatementSupport declaration 15/92015/2
Robert Varga [Mon, 10 Aug 2020 16:17:25 +0000 (18:17 +0200)]
Fix AnyxmlSchemaLocationStatementSupport declaration

We should not be operating on parameterized EffectiveStatement,
but rather of AnyxmlSchemaLocationEffectiveStatement itself.

Change-Id: I9130f57ced47d416d3d7f300e03eacd876bf0a27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix YangDataStatementSupport declaration 14/92014/2
Robert Varga [Mon, 10 Aug 2020 16:11:57 +0000 (18:11 +0200)]
Fix YangDataStatementSupport declaration

We should not be operating on parameterized EffectiveStatement,
but rather of YangDataEffectiveStatement itself.

Change-Id: I02797816e712b9a484dca694c77f4074ceb2b0da
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix declaration of extension-related supports 11/92011/2
Robert Varga [Mon, 10 Aug 2020 15:13:10 +0000 (17:13 +0200)]
Fix declaration of extension-related supports

We should properly specialize these to UnrecognizedEffectiveStatement,
not just any old statement.

Change-Id: I4a09dd9d25040bf62142444566ca39c61b6c57fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix yangtools-docs references 34/91634/1
Robert Varga [Fri, 24 Jul 2020 15:12:03 +0000 (17:12 +0200)]
Fix yangtools-docs references

We are pointing at the wrong versions again, fix that up.

Change-Id: I14280df808a8d7d3cc9037dc3d51860f89018d18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix some util javadoc warnings 15/91615/1
Robert Varga [Fri, 24 Jul 2020 09:17:34 +0000 (11:17 +0200)]
Fix some util javadoc warnings

Clean up some warnings, progressing towards a warning-free build.

Change-Id: Ia199d771f409f25ffa1f8aadfd1814f13ee3806e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFixup yang-model-api javadoc warnings 12/91612/1
Robert Varga [Fri, 24 Jul 2020 09:05:36 +0000 (11:05 +0200)]
Fixup yang-model-api javadoc warnings

There are a number of issues javadoc is complaining about, fix them
up.

Change-Id: I82e108faca800b80a85e00aab96cb8ec8fdc91e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump versions to 5.0.6-SNAPSHOT 38/91538/2
Robert Varga [Wed, 22 Jul 2020 13:18:32 +0000 (15:18 +0200)]
Bump versions to 5.0.6-SNAPSHOT

This starts the next development iteration.

Change-Id: I8cc0583d3cf9f32a4ebc7cb971fe29d226196ac6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump odlparent to 7.0.5 34/91534/1
Robert Varga [Wed, 22 Jul 2020 12:15:25 +0000 (14:15 +0200)]
Bump odlparent to 7.0.5

Pick up odlparent with netty fix.

Change-Id: I1b469bcb1f34fab8dc82ed39b4d3ffe418d24099
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRevert "Update YANG lexer/parser to accept free-standing '+'" 32/91532/1
Robert Varga [Wed, 22 Jul 2020 11:15:56 +0000 (13:15 +0200)]
Revert "Update YANG lexer/parser to accept free-standing '+'"

This reverts commit 04ed60d275521fd6e6ee57d5b1ce4e6a519d2e35, as it
causes a regression around "foo" +"foo" construct.

JIRA: YANGTOOLS-1089
Change-Id: Ib5af7a994c19bf99fb5cb2a875063d623cc6c3f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUpdate SchemaNodeIdentifier design a bit 11/91511/3
Robert Varga [Tue, 21 Jul 2020 19:01:20 +0000 (21:01 +0200)]
Update SchemaNodeIdentifier design a bit

Using explicit instanceof checks is not very code friendly, as we
usually end up using either Absolute or Descendant identifier and
forcing an instanceof check is hiding things from the compiler.

Furthermore {first,last}NodeIdentifier are really only useful in
the Absolute case.

Update the design by moving utility methods to Absolute and
add four specialized classes. While this adds a bit of code
duplication and verbosity, the result is a bit better in that we
do not have explicit casts and checks.

Furthermore, in the case of a particular use, for example Absolute,
the code ends up dealing with two concrete implementations, leading
to bimorphic dispatch which is fully visible to JIT.

Change-Id: I2f3b7dc9ac3bf3d038e815f2406bd5c5629f8553
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd SchemaNodeIdentifier.{first,last}Identifer() 08/91508/1
Robert Varga [Tue, 21 Jul 2020 15:29:46 +0000 (17:29 +0200)]
Add SchemaNodeIdentifier.{first,last}Identifer()

A number of operations involving SchemaNodeIdentifier are interested
in either the first or the last part of it. Add methods to efficiently
access them.

Change-Id: I0ecb9ee2d4ce0aba7ca7c302a751c273555456e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd SchemaNodeIdentifier.Absolute.intern() 02/91502/2
Robert Varga [Tue, 21 Jul 2020 12:02:19 +0000 (14:02 +0200)]
Add SchemaNodeIdentifier.Absolute.intern()

We will be using SchemaNodeIdentifiers in a lot of contexts, some
of which involve dynamic wiring lookups. In these contexts we want
the ability to squash an Absolute schema node identifier into a
JVM-wide single instance -- hence we get benefits of cached hash
code and instance-shortcuts on equals().

Change-Id: I2144ba659a783d585e59103dde3e6d292a63ec48
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump versions to 5.0.5-SNAPSHOT 95/91395/1
Robert Varga [Fri, 17 Jul 2020 15:54:52 +0000 (17:54 +0200)]
Bump versions to 5.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: I35d576671154998adba1643361ce0dc86ad576cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump to odlparent-7.0.4 35/91235/5
Robert Varga [Sat, 11 Jul 2020 14:22:25 +0000 (16:22 +0200)]
Bump to odlparent-7.0.4

Pick up latest upgrades from upstream.

Change-Id: I9843867449ac5f0eaf16d562df493cb13b495f4c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse modifiable List when resolving relative xpath 18/91318/9
Tomas Cere [Tue, 14 Jul 2020 13:05:18 +0000 (15:05 +0200)]
Use modifiable List when resolving relative xpath

When we have split the path into its components, we can end up
compressing them further. Make sure the list is actually mutable.

JIRA: YANGTOOLS-1125
Change-Id: I1d4cd66d2efbb1955bb189763ea09fefeba93d25
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoClean up predicates prior to xpath normalization 29/91329/2
Tomas Cere [Wed, 15 Jul 2020 08:43:57 +0000 (10:43 +0200)]
Clean up predicates prior to xpath normalization

Path splitting is not equipped to ignore step predicates, which leads
it to do arrive at the wrong path. Remove any predicates before
embarking on resolving the reference.

JIRA: YANGTOOLS-1126
Change-Id: Ia32836ad1acec0762d9baa7ded5f65fa72f39b93
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
3 years agoUpdate approval link 86/91286/2
Robert Varga [Sun, 12 Jul 2020 21:22:14 +0000 (23:22 +0200)]
Update approval link

YANGTOOLS does have an approval link -- it is not easy to find,
but it is linked from graduation review.

Change-Id: Id30ae9493072389b4c6d7da0979acec47af86d64
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd INFO.yaml for yangtools 70/91270/1
Anil Belur [Sun, 12 Jul 2020 02:51:11 +0000 (12:51 +1000)]
Add INFO.yaml for yangtools

Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
Change-Id: I1ab91a7cde9e13b44181f7d74318a613151cb849

3 years agoFix YangConstants.RFC6020_YIN_MEDIA_TYPE 64/90964/1
Robert Varga [Tue, 7 Jul 2020 17:53:14 +0000 (19:53 +0200)]
Fix YangConstants.RFC6020_YIN_MEDIA_TYPE

The definition and reference are wrong here, fix that up.

JIRA: YANGTOOLS-1124
Change-Id: Ied4f0f1855329a536cdd0b73e38a69dcde72d377
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c22a8da40553df3302e02cad846c65ce013fc8e8)

3 years agoUpdate YANG lexer/parser to accept free-standing '+' 04/89104/5
Robert Varga [Fri, 17 Apr 2020 18:01:36 +0000 (20:01 +0200)]
Update YANG lexer/parser to accept free-standing '+'

The lexer is not quite accurate, as it does not allow for strings
starting with a '+' when not quoted. Fix this up, relaxing the
rules.

JIRA: YANGTOOLS-1089
Change-Id: Ifaf9c65966b43f26f37fc88a11d77fc9f43d2c8c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoClean up OpenConfigVersionSupport 25/90925/1
Robert Varga [Mon, 6 Jul 2020 09:24:27 +0000 (11:24 +0200)]
Clean up OpenConfigVersionSupport

Type parameters should be referencign OpenConfigVersionEffectiveStatement,
fix it up.

Change-Id: Ied2cf301c16270bd21e6f211a97665d682269aaa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd UnknownSchemaNodeMixin 22/90922/1
Robert Varga [Sun, 5 Jul 2020 18:28:20 +0000 (20:28 +0200)]
Add UnknownSchemaNodeMixin

Add basic mixin to use with effective statement implementations.

JIRA: YANGTOOLS-1123
Change-Id: Iaa0a7e9624d22999285d36f28ee6a0d797b936db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor ExtensionStatementSupport 18/90918/3
Robert Varga [Fri, 3 Jul 2020 14:52:15 +0000 (16:52 +0200)]
Refactor ExtensionStatementSupport

Using RecursiveObjectLeaker requires integration with object
construction and is inherently dangerous.

As it turns out, we can solve this problem differently, without
having to rely on this magic by pre-allocating the resulting
effective statement and populating it into a thread-local map.

That allows us to pick up that object for purposes of including
it in substatements -- thus breaking the recursion. Once we have
acquired substatements, the real build methods just fill them
into the pre-allocated object are return it.

On exit we check whether we have cleared the state map and clean
it up automatically, as this is not expected to be a major
performance problem.

JIRA: YANGTOOLS-1122
Change-Id: Iebbbffd6f62fa57ce496a2ab7bc8e5792198d3a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor {Module,Submodule}EffectiveStatementImpl 02/87502/7
Robert Varga [Fri, 3 Jul 2020 09:56:35 +0000 (11:56 +0200)]
Refactor {Module,Submodule}EffectiveStatementImpl

Modules and submodules are tied together via AbstractEffectiveModule,
which holds on to old layout. While it is not directly harmful to
these implementations, having statement creation outside of actual
constructors is a long-term goal.

Refactor AbstractEffectiveModule and thus both implementations to
create substatements separately in BaseStatementSupport.

The inlining of submodule statements is hooked into
BaseStatementSupport lifecycle via buildEffectiveSubstatements(),
so that modules can stop mucking with statement build rules and just
pick up whatever was created for the corresponding submodule.

For declared statements we introduce AbstractDeclaredEffectiveRootStatement
as a replacement for AbstractRootStatement, which is now deprecated
for removal.

JIRA: YANGTOOLS-1065
Change-Id: I032bb1ea4f2ee5db87d9b0dbbdeb89f152bc4593
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove statement filter caches from AbstractEffectiveModule 13/90913/3
Robert Varga [Fri, 3 Jul 2020 09:03:21 +0000 (11:03 +0200)]
Remove statement filter caches from AbstractEffectiveModule

Majority of collections kept by AbstractEffectiveModule are simple
filters on effective substatements. Use Collections2.filter()
instead of fully instantiating them.

Since we are dealing with generic Collections, this is also flushing
out a bad use of equality in a test.

JIRA: YANGTOOLS-1065
Change-Id: If6e8689fdd6638aaddfd45c4846086c03d91032e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove simple AbstractEffectiveModule properties 12/90912/1
Robert Varga [Fri, 3 Jul 2020 08:49:39 +0000 (10:49 +0200)]
Remove simple AbstractEffectiveModule properties

A number of properties are just a simple search in substatements,
let's not waste fields on having them cached, as they are typically
unused anyway.

JIRA: YANGTOOLS-1065
Change-Id: I61c05bb89129beb5d0876067763a016e7d850e12
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove AbstractEffectiveModule.get{Namespace,Revision} 11/90911/1
Robert Varga [Fri, 3 Jul 2020 08:43:49 +0000 (10:43 +0200)]
Remove AbstractEffectiveModule.get{Namespace,Revision}

These methods are provided as default methods in Module, remove
them to reduce clutter.

JIRA: YANGTOOLS-1065
Change-Id: I6139d1ee9d0ab42f6a52677a20d6823b2dc98022
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove AbstractEffectiveModule.name 10/90910/1
Robert Varga [Fri, 3 Jul 2020 08:42:26 +0000 (10:42 +0200)]
Remove AbstractEffectiveModule.name

This field is just shadowing argument(), remove it.

JIRA: YANGTOOLS-1065
Change-Id: Ib3b078548269b50ae69f4cecceee47dc9890b562
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDeprecate EffectiveStatementBase for removal 05/90905/3
Robert Varga [Thu, 2 Jul 2020 22:27:43 +0000 (00:27 +0200)]
Deprecate EffectiveStatementBase for removal

With all immediate users migrated or deprecated, mark the grim
future for this class, slating it for removal/integration.

JIRA: YANGTOOLS-1065
Change-Id: I4d06bdceedc3fcf5e45125f2f7fcfffe3de7d35e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove {Numerical,String}RestrictionsImpl 04/90904/3
Robert Varga [Thu, 2 Jul 2020 22:13:53 +0000 (00:13 +0200)]
Remove {Numerical,String}RestrictionsImpl

As noted during previous migration, these classesalong with their
support is unused. Furthermore NumericalRestrictions is
mis-declared.

Remove the implementation and drop a FIXME for next major version,
so that we at least fix the definition or decide its overall
future.

Note this concept is probably useful, as it gates towards tasks
which are currently done by AbstractTypeStatementSupport and those
could be split out if we rework interactions with simple built-in
types.

JIRA: YANGTOOLS-1065
Change-Id: Ief43d59dbc541b094ca80e39382f8c0c8767bac2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate InstanceIdentifierSpecificationSupport 03/90903/2
Robert Varga [Thu, 2 Jul 2020 22:08:34 +0000 (00:08 +0200)]
Migrate InstanceIdentifierSpecificationSupport

InstanceIdentifierSpecificationSupport can use memory-efficient
representation through BaseStatementSupport. Furthermore we can reuse
TypeEffectiveStatementImpl instead of brewing a separate effective
implementation.

JIRA: YANGTOOLS-1065
Change-Id: I821172baf33bd639fd52e02160db7122b4f53367
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate LeafrefSpecificationSupport 02/90902/3
Robert Varga [Thu, 2 Jul 2020 21:56:30 +0000 (23:56 +0200)]
Migrate LeafrefSpecificationSupport

LeafrefSpecificationSupport can use memory-efficient representation
through BaseStatementSupport. Furthermore we can reuse
TypeEffectiveStatementImpl instead of brewing a separate effective
implementation.

JIRA: YANGTOOLS-1065
Change-Id: I735563730e8c382b49ea01fccc00191ffcfdfb14
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate UnionSpecificationSupport 01/90901/2
Robert Varga [Thu, 2 Jul 2020 21:44:23 +0000 (23:44 +0200)]
Migrate UnionSpecificationSupport

UnionSpecificationSupport can use memory-efficient representation
through BaseStatementSupport. Furthermore we can reuse
TypeEffectiveStatementImpl instead of brewing a separate effective
implementation.

JIRA: YANGTOOLS-1065
Change-Id: I93ad3126e000c489776ea92aed58e9183e93da42
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate IdentityRefSpecificationSupport 00/90900/2
Robert Varga [Thu, 2 Jul 2020 21:28:27 +0000 (23:28 +0200)]
Migrate IdentityRefSpecificationSupport

IdentityRefSpecificationSupport can use memory-efficient representation
through BaseStatementSupport. Furthermore we can reuse
TypeEffectiveStatementImpl instead of brewing a separate effective
implementation.

JIRA: YANGTOOLS-1065
Change-Id: Ic198df95ab519f42c687b7bec0d0620b9c9a9126
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate EnumSpecificationSupport 99/90899/4
Robert Varga [Thu, 2 Jul 2020 21:08:20 +0000 (23:08 +0200)]
Migrate EnumSpecificationSupport

EnumSpecificationSupport can use memory-efficient representation
through BaseStatementSupport. Furthermore we can reuse
TypeEffectiveStatementImpl instead of brewing a separate effective
implementation.

JIRA: YANGTOOLS-1065
Change-Id: I0b211e2cfd09cae8e69ca614b190a562ba85e090
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate Decimal64SpecificationSupport 96/90896/3
Robert Varga [Thu, 2 Jul 2020 20:54:20 +0000 (22:54 +0200)]
Migrate Decimal64SpecificationSupport

Decimal64SpecificationSupport can use memory-efficient representation
through BaseStatementSupport. Furthermore we can reuse
TypeEffectiveStatementImpl instead of brewing a separate effective
implementation.

JIRA: YANGTOOLS-1065
Change-Id: Ic00af914cf31095179b2e9da4484679929431ed0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate BitsSpecificationSupport 95/90895/3
Robert Varga [Thu, 2 Jul 2020 20:43:18 +0000 (22:43 +0200)]
Migrate BitsSpecificationSupport

BitsSpecificationSupport can use memory-efficient representation
through BaseStatementSupport. Furthermore we can reuse
TypeEffectiveStatementImpl instead of brewing a separate effective
implementation.

JIRA: YANGTOOLS-1065
Change-Id: Id2d9b816388584ceda3c8cc8528b8cccfae08fbb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConsolidate IntegralTypeEffectiveStatementImpl 94/90894/4
Robert Varga [Thu, 2 Jul 2020 18:25:52 +0000 (20:25 +0200)]
Consolidate IntegralTypeEffectiveStatementImpl

TypeEffectiveStatementImpl can easily support the case of each
integral type, migrate it.

JIRA: YANGTOOLS-1065
Change-Id: I21f9cbdd97966f7a1d36ae536ac01fb93f3596ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConsolidate StringTypeEffectiveStatementImpl 93/90893/5
Robert Varga [Thu, 2 Jul 2020 18:18:59 +0000 (20:18 +0200)]
Consolidate StringTypeEffectiveStatementImpl

TypeEffectiveStatementImpl can easily support the case of a string
type, migrate it.

JIRA: YANGTOOLS-1065
Change-Id: Icaf85f1cb49f98a8c019fb0752777f00a98b5491
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConsolidate LeafrefTypeEffectiveStatementImpl 92/90892/5
Robert Varga [Thu, 2 Jul 2020 18:14:41 +0000 (20:14 +0200)]
Consolidate LeafrefTypeEffectiveStatementImpl

TypeEffectiveStatementImpl can easily support the case of a
leafref type, migrate it.

JIRA: YANGTOOLS-1065
Change-Id: I39bd8f7520c4c1678725ab2dfb1d805fc07e8034
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConsolidate InstanceIdentifierTypeEffectiveStatementImpl 91/90891/4
Robert Varga [Thu, 2 Jul 2020 18:09:34 +0000 (20:09 +0200)]
Consolidate InstanceIdentifierTypeEffectiveStatementImpl

TypeEffectiveStatementImpl can easily support the case of an
instance-identifier type, migrate it.

JIRA: YANGTOOLS-1065
Change-Id: I07db26a6e96a937c9335afe081d92441b29d3553
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConsolidate EnumTypeEffectiveStatementImpl 90/90890/4
Robert Varga [Thu, 2 Jul 2020 18:06:11 +0000 (20:06 +0200)]
Consolidate EnumTypeEffectiveStatementImpl

TypeEffectiveStatementImpl can easily support the case of an enum
type, migrate it.

JIRA: YANGTOOLS-1065
Change-Id: I756ee91f4ce9c9e846ee65afbc4629dd23668002
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConsolidate DecimalTypeEffectiveStatementImpl 89/90889/5
Robert Varga [Thu, 2 Jul 2020 18:02:43 +0000 (20:02 +0200)]
Consolidate DecimalTypeEffectiveStatementImpl

TypeEffectiveStatementImpl can easily support the case of an decimal
type, migrate it.

JIRA: YANGTOOLS-1065
Change-Id: I352675843882b2fce414b10b58a38315c759278d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConsolidate BitsTypeEffectiveStatementImpl 88/90888/4
Robert Varga [Thu, 2 Jul 2020 17:59:18 +0000 (19:59 +0200)]
Consolidate BitsTypeEffectiveStatementImpl

TypeEffectiveStatementImpl can easily support the case of an bits
type, migrate it.

JIRA: YANGTOOLS-1065
Change-Id: I80bb47dd6b5aa77aad619c271cea70fdab2547d1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConsolidate UnionTypeEffectiveStatementImpl 87/90887/4
Robert Varga [Thu, 2 Jul 2020 17:52:49 +0000 (19:52 +0200)]
Consolidate UnionTypeEffectiveStatementImpl

TypeEffectiveStatementImpl can easily support the case of an union
type, migrate it.

This was the last user of AbstractTypeStatementSupport, so remove
that, too.

JIRA: YANGTOOLS-1065
Change-Id: Ic69a9b4126062c06fe137c0b3144d431fd8124e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConsolidate IdentityrefTypeEffectiveStatementImpl 86/90886/4
Robert Varga [Thu, 2 Jul 2020 17:49:30 +0000 (19:49 +0200)]
Consolidate IdentityrefTypeEffectiveStatementImpl

TypeEffectiveStatementImpl can easily support the case of an identityref
type, migrate it.

JIRA: YANGTOOLS-1065
Change-Id: Ibc13fff074cf7c4f597686f75ba55f65f6870ba1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConsolidate EmptyTypeEffectiveStatementImpl 85/90885/4
Robert Varga [Thu, 2 Jul 2020 17:46:43 +0000 (19:46 +0200)]
Consolidate EmptyTypeEffectiveStatementImpl

TypeEffectiveStatementImpl can easily support the case of an empty
type, migrate it.

JIRA: YANGTOOLS-1065
Change-Id: I9b77ce4b609f1624a18de97e3f3c6272ea22003b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConsolidate BooleanTypeEffectiveStatementImpl 84/90884/4
Robert Varga [Thu, 2 Jul 2020 17:43:56 +0000 (19:43 +0200)]
Consolidate BooleanTypeEffectiveStatementImpl

TypeEffectiveStatementImpl can easily support the case of a boolean
type, migrate it.

JIRA: YANGTOOLS-1065
Change-Id: I24bc5fa4909710805d9503db69ed49f65878e1af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConsolidate BinaryTypeEffectiveStatementImpl 83/90883/4
Robert Varga [Thu, 2 Jul 2020 17:38:04 +0000 (19:38 +0200)]
Consolidate BinaryTypeEffectiveStatementImpl

Derived TypeEffectiveStatements follow an obvious pattern, where
we do not need to have specialized subclasses for each of them.

Introduce TypeEffectiveStatementImpl and migrate 'type binary' to
use it.

JIRA: YANGTOOLS-1065
Change-Id: I16c259718c3502d85ad0e77c5f612eb9d601d979
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate AbstractTypeStatementSupport 82/90882/5
Robert Varga [Thu, 2 Jul 2020 16:11:15 +0000 (18:11 +0200)]
Migrate AbstractTypeStatementSupport

Support for 'type' statement is rather twisted, but at the end of
the day, externalizing substatement creation is rather easy.

Switching to BaseStatementSupport allows us to discern when we can
end up pointing to a BuiltinTypeStatement -- since there is not such
thing as an implicit type statement.

On the declared front, this is a straightforward migration to
AbstractDeclaredStatement.WithRawStringArgument subclasses, which
ends up reducing typical footprint from 32 bytes to 16/24 bytes.

On the effective front, this does not really do anything, as these
are handled on per-type basis.

JIRA: YANGTOOLS-1065
Change-Id: I421f72a765fd6a28f984d463d8b9991dd7c1d231
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoSplit out AbstractTypeStatementSupport.resolveTypeReference() 81/90881/4
Robert Varga [Thu, 2 Jul 2020 16:22:18 +0000 (18:22 +0200)]
Split out AbstractTypeStatementSupport.resolveTypeReference()

The implementation of createEffective() method is quite huge,
split out the switch lookup part out of it, saving a few lines.

JIRA: YANGTOOLS-1065
Change-Id: I97c36b2263a3ee2c4f394f77e3d5651846aa91f3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoReuse common superclass for BuiltinTypeStatement 80/90880/4
Robert Varga [Thu, 2 Jul 2020 15:47:29 +0000 (17:47 +0200)]
Reuse common superclass for BuiltinTypeStatement

BuiltinTypeStatement duplicates pretty much all of its implementation
from AbstractDeclaredStatement.WithRawStringArgument. Eliminate
duplication, so we have less code to maintain.

JIRA: YANGTOOLS-1065
Change-Id: Ib27fe7f19001c5ffd563dad41843e74a3539765d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMinimize AbstractTypeStatementSupport.internArgument() 78/90878/4
Robert Varga [Thu, 2 Jul 2020 15:37:13 +0000 (17:37 +0200)]
Minimize AbstractTypeStatementSupport.internArgument()

Use an expression instead of assignement/check to reduce bytecode
footprint.

JIRA: YANGTOOLS-652
Change-Id: I2f900e0175904828e8efc273e9aca391221d19ce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoOptimize deviate statement implementations 77/90877/5
Robert Varga [Thu, 2 Jul 2020 15:21:06 +0000 (17:21 +0200)]
Optimize deviate statement implementations

deviate is a simple statement, optimize the memory layout of its
implementation classes.

JIRA: YANGTOOLS-1065
Change-Id: Ibffb49bca02952f685250d9b5a6a2cdf56966a7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoOptimize refine statement implementations 75/90875/4
Robert Varga [Thu, 2 Jul 2020 14:47:40 +0000 (16:47 +0200)]
Optimize refine statement implementations

refine is a simple statement, optimize the memory layout of its
implementation classes. Most of the benefits here are coming from
not needing to retain source/definition, but for simple refines
we can also skip a singleton list.

Also mark future direction for evolving the implementation contract,
as it has some aspects which are definitely not nice.

JIRA: YANGTOOLS-1065
Change-Id: Ic07ba74b0d2ea685a3ce8aed567a89125d04850e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoOptimize unique statement implementations 73/90873/3
Robert Varga [Thu, 2 Jul 2020 14:30:33 +0000 (16:30 +0200)]
Optimize unique statement implementations

unique is a simple statement, optimize the memory layout of its
implementation classes.

JIRA: YANGTOOLS-1065
Change-Id: Idccce468b38726ac25851b11352528c489e92b5e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDeprecate UndeclaredEffectiveStatementBase for removal 74/90874/2
Robert Varga [Thu, 2 Jul 2020 14:35:55 +0000 (16:35 +0200)]
Deprecate UndeclaredEffectiveStatementBase for removal

We have a more powerful way of implementing implict statements
with AbstractUndeclaredEffectiveStatement, which does not require
storage of substatements.

Deprecate UndeclaredEffectiveStatementBase for removal and schedule
a FIXME for 6.0.0.

JIRA: YANGTOOLS-1065
Change-Id: Id0112c7bf9d0f99b37f825aa489924f966591b54
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoOptimize if-feature statement implementations 72/90872/2
Robert Varga [Thu, 2 Jul 2020 14:12:11 +0000 (16:12 +0200)]
Optimize if-feature statement implementations

if-feature is a simple statement, optimize the memory layout of its
implementation classes.

JIRA: YANGTOOLS-1065
Change-Id: I9e2a1dbf1f32b4fdfefd965ff88fd63425bcb5d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoOptimize path statement implementations 71/90871/2
Robert Varga [Thu, 2 Jul 2020 13:42:41 +0000 (15:42 +0200)]
Optimize path statement implementations

This migrates 'path' statement support to use denser objects, as
the argument is not affected by any copying around.

JIRA: YANGTOOLS-1065
Change-Id: Idb1281cf54e449db28c63645252a721191ed8de1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoEliminate DeviateEffectiveStatementImpl.deviateType 76/90876/2
Robert Varga [Thu, 2 Jul 2020 15:13:34 +0000 (17:13 +0200)]
Eliminate DeviateEffectiveStatementImpl.deviateType

We are just duplicating the argument field here, let's get rid
of this.

JIRA: YANGTOOLS-1065
Change-Id: Id8a5855e352cb032b88e9af0ffb30cb64e3653ce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFurther optimize RevisionDateStatement implementations 68/90868/2
Robert Varga [Thu, 2 Jul 2020 12:19:35 +0000 (14:19 +0200)]
Further optimize RevisionDateStatement implementations

Revision.toString() results in the raw argument string, hence we
can use that to our advantage and save a one field, dropping the
instance size to 16 bytes in typical scenarios.

JIRA: YANGTOOLS-1065
Change-Id: Id0f6c4a64be9ae70ecbe0917c19c9ac2b7aecd57
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd BaseQNameStatementSupport.historyAndStatusFlags() 67/90867/3
Robert Varga [Thu, 2 Jul 2020 12:03:13 +0000 (14:03 +0200)]
Add BaseQNameStatementSupport.historyAndStatusFlags()

A number of subclasses are open-coding the same computation, let's
centralize it a bit.

Change-Id: I1ebbe63a16dcc876324960c2a11baca604476ba5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert UsesStatementSupport to BaseQNameStatementSupport 66/90866/2
Robert Varga [Thu, 2 Jul 2020 11:37:42 +0000 (13:37 +0200)]
Convert UsesStatementSupport to BaseQNameStatementSupport

Uses statement is a bit more complicated in its effective form,
hence we end up with four different implementations when we optimize
for size.

JIRA: YANGTOOLS-1065
Change-Id: I7f01ecd8277a042821cb5b37c0d9406a1e9204be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert bit statement 46/90846/3
Robert Varga [Wed, 1 Jul 2020 18:25:10 +0000 (20:25 +0200)]
Convert bit statement

Convert the mostly trivial case of bit statement, which can be easily
minimized.

Change-Id: I4b1041c3205034d28844be0e8faab5545006ea23
JIRA: YANGTOOLS-1065
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMark AbstractEffectiveDocumentedNode(WithStatus) evolution 44/90844/3
Robert Varga [Wed, 1 Jul 2020 17:17:04 +0000 (19:17 +0200)]
Mark AbstractEffectiveDocumentedNode(WithStatus) evolution

We want to eventually completely remove these classes, as they are
making SchemaNode assumptions. We already have a less stateful
replacement, which can be used when needed.

Change-Id: I4633ea8b2d1027eed34824fda524704bfdfc8828
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor PatternConstraintImpl 43/90843/4
Robert Varga [Wed, 1 Jul 2020 16:52:56 +0000 (18:52 +0200)]
Refactor PatternConstraintImpl

We have two distinct cases for the definition here, where the smaller
does not have metadata, where as the full does have. This saves four
fields in under-documented cases.

Also mark Pattern(Effective)Statement for further refactor so we do
not have to play weird tricks with constraints.

JIRA: YANGTOOLS-1065
Change-Id: I6748ca7fefdb4b2a088324ff9bba821c131fe7ab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert pattern statement 42/90842/3
Robert Varga [Wed, 1 Jul 2020 14:54:36 +0000 (16:54 +0200)]
Convert pattern statement

Convert the mostly trivial case of pattern statement, which can be easily
minimized.

We also terminally-deprecate AbstractConstraintEffectiveStatement,
as it is no longer needed.

JIRA: YANGTOOLS-1065
Change-Id: Ib207d3389959822635578733ef09607fe3f2373a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove MaxElementsEffectiveStatementImpl 41/90841/2
Robert Varga [Wed, 1 Jul 2020 14:44:12 +0000 (16:44 +0200)]
Remove MaxElementsEffectiveStatementImpl

This is a follow-up patch removing an unused class.

JIRA: YANGTOOLS-1065
Change-Id: I9d8761139db206d917067971a2e840f2df7319ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert range statement 39/90839/2
Robert Varga [Wed, 1 Jul 2020 14:38:15 +0000 (16:38 +0200)]
Convert range statement

Convert the mostly trivial case of range statement, which can be easily
minimized.

We also terminally-deprecate AbstractListConstraintEffectiveStatement,
as it is no longer needed.

JIRA: YANGTOOLS-1065
Change-Id: I38c0583aaf46670639c4b8a5b9464113c0032bb4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert length statement 29/90829/11
Robert Varga [Tue, 30 Jun 2020 20:54:47 +0000 (22:54 +0200)]
Convert length statement

Convert the mostly trivial case of length statement, which can be easily
minimized.

JIRA: YANGTOOLS-1065
Change-Id: I4cdb6d80b2b9c71e493e9f145c87e2be9e25ef20
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate Must/WhenStatementSupport to BaseStatementSupport 23/90823/9
Robert Varga [Tue, 30 Jun 2020 11:19:35 +0000 (13:19 +0200)]
Migrate Must/WhenStatementSupport to BaseStatementSupport

This allows us to reduce the footprint of individual declared
and effective instances.

JIRA: YANGTOOLS-1065
Change-Id: I6a5dcba7fdbb2a6cdeba54c99627a41423683e05
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert AbstractEnumStatementSupport 27/90827/6
Robert Varga [Tue, 30 Jun 2020 20:32:30 +0000 (22:32 +0200)]
Convert AbstractEnumStatementSupport

Convert the mostly trivial case of enum statement, which can be easily
minimized. Also addresses a FIXME for hiding the implementation class.

JIRA: YANGTOOLS-1065
Change-Id: I04d5d87b8ef59f89b41cd46e78761025ac967d78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>