yangtools.git
3 years agoFix warnings when we are augmenting-in a list 29/92529/1
Robert Varga [Mon, 21 Sep 2020 10:48:07 +0000 (12:48 +0200)]
Fix warnings when we are augmenting-in a list

When we are targetting a non-configuration list we end up issuing
a warning because the augment content contains the list as well --
and is not suppressed. Add logic to suppress it.

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

3 years agoBump odlparent to 7.0.6 58/92558/2
Robert Varga [Mon, 21 Sep 2020 12:13:06 +0000 (14:13 +0200)]
Bump odlparent to 7.0.6

Pick up latest odlparent version.

Change-Id: I08e2ae6ba7cef95bafd515b1aa377ad2515a0b1a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse assertThrows() in common-util 57/92557/2
Robert Varga [Mon, 21 Sep 2020 12:02:49 +0000 (14:02 +0200)]
Use assertThrows() in common-util

Using assertThrows() allows us to clean up some of the tests, so that
we do not have needed flow control and expected= tests.

Change-Id: I0b2ca1af3a50109ea68e0161c70f918b76275fb5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse StandardCharsets 28/92528/1
Robert Varga [Mon, 21 Sep 2020 10:52:12 +0000 (12:52 +0200)]
Use StandardCharsets

Java 10 allows us to use a proper constant for charset.

Change-Id: Ie7706356bf5bcbde05e7632b099901d226f40cf1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd clarification around NormalizedNode being identifiable 02/92502/1
Robert Varga [Sat, 19 Sep 2020 13:32:16 +0000 (15:32 +0200)]
Add clarification around NormalizedNode being identifiable

While we do not have enough time to address the entire issue, update
at least documentation so as we have a bit more progress towards
splitting identifier from NormalizedNode.

JIRA: YANGTOOLS-1074
Change-Id: Icc742a1b1a5ab65fd01f13abfcba68af0e3eea43
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDefine MaxAccess enumeration 92/92492/7
Robert Varga [Fri, 18 Sep 2020 22:06:18 +0000 (00:06 +0200)]
Define MaxAccess enumeration

RFC2578 specifies which strings are actually valid as max-access
arguments. Make sure we properly validate them and use an enum.

JIRA: YANGTOOLS-1134
Change-Id: I9e22dccb115f34ab50aaa8cf84e09d12713c69fa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix SubIdStatement/ObjectIdentifier ranges 93/92493/8
Robert Varga [Fri, 18 Sep 2020 22:12:07 +0000 (00:12 +0200)]
Fix SubIdStatement/ObjectIdentifier ranges

RFC2578 makes it clear that each sub-identifier is an uint32 as
well as that there is at most 128 of them present in an ObjectIdentifier.

JIRA: YANGTOOLS-1134
Change-Id: Ic19baf8158c3e291c505c943bf16eae7cfd4ad58
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove IetfYangSmiv2Namespace 87/92487/1
Robert Varga [Fri, 18 Sep 2020 20:49:04 +0000 (22:49 +0200)]
Remove IetfYangSmiv2Namespace

This namespace is useless, remove it.

JIRA: YANGTOOLS-1134
Change-Id: Ic285d7e68daf090b6a024f38a32de0c8e15414c1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd RFC6643 parser support 85/92485/3
Robert Varga [Fri, 18 Sep 2020 15:54:47 +0000 (17:54 +0200)]
Add RFC6643 parser support

RFC6643 defines a way to map SMIv2 to YANG. This mapping retains
the original SMI details using YANG extensions, so that the resulting
model can be mapped back.

This patch adds semantic support for these extensions, so that the
semantics are supported out of the box.

JIRA: YANGTOOLS-1134
Change-Id: I494b2537e89e5a104debe486a9012d22d5c7b3aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4223bf8c4eae4a003b71554fbcc98b5377ddce2b)
(cherry picked from commit 1200789c3e9591882ef066ecc6bad7f8ff63a7f7)

3 years agoFix IRStatement formatting 30/92430/2
Robert Varga [Wed, 9 Sep 2020 12:22:06 +0000 (14:22 +0200)]
Fix IRStatement formatting

We should append a fragment rather than starting a new toString()
chain.

Change-Id: Ie54b70ed0faa7ae914c25bb8ea8c6152445496ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoTake advantage of ANTLR keyword validation 03/92203/11
Robert Varga [Thu, 20 Aug 2020 09:44:42 +0000 (11:44 +0200)]
Take advantage of ANTLR keyword validation

We can guarantee keyword matches only valid identifiers, hence there
is little reason to perform additional validation in QName itself.

This patch punches a hole in the API for the sake of improved CPU
usage in the most common use case.

Change-Id: Ib190f44cbe29ed4dd62ab20e62254a9d23b78e10
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMass-migrate to use EffectiveModelContext 17/92417/2
Robert Varga [Mon, 7 Sep 2020 11:36:25 +0000 (13:36 +0200)]
Mass-migrate to use EffectiveModelContext

This is the next step in migration: make sure most of our yang-data
constructs operate on EffectiveModelContext.

Change-Id: I85a314899bcd29ead0396a4b4ebd369f4e141014
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAllow module to be represented in different formats 15/92415/3
Robert Varga [Mon, 7 Sep 2020 09:02:42 +0000 (11:02 +0200)]
Allow module to be represented in different formats

We may need to allow for different source packaging. The default
is YangTextSchemaSource, which we always packaged. We may introduce
additional types at a later point.

Change-Id: I46dcde1052c36fbc5105a320ac3ec58186d24f61
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove ASTSchemaSource 11/92411/6
Robert Varga [Fri, 4 Sep 2020 13:50:44 +0000 (15:50 +0200)]
Remove ASTSchemaSource

ASTSchemaSource has been deprecated, remove it along with all
compatibility code.

Change-Id: Ib6b92056304b8f8d30bd82e7f4c334a26ba93108
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoIntroduce IRSchemaSource 05/92305/6
Robert Varga [Thu, 27 Aug 2020 09:51:02 +0000 (11:51 +0200)]
Introduce IRSchemaSource

Rather than using ASTSchemaSource, use a dedicated IRSchemaSource,
which ends up being the replacement for ASTSchemaSource. We are
undoing some work previously done, but it allows easier backporting.

JIRA: YANGTOOLS-1130
Change-Id: Ifdeaa0d053558eda12432264fb768ed0d821468f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove YangModelDependencyInfo.COLON_SPLITTER 04/92304/1
Robert Varga [Thu, 27 Aug 2020 09:09:10 +0000 (11:09 +0200)]
Remove YangModelDependencyInfo.COLON_SPLITTER

Now that we are operating on our explicit intermediate representation
we do not need to split identifiers. Remove the now-unused splitter.

JIRA: YANGTOOLS-1130
Change-Id: Ida081bfa8c143a3062ac22d4862923aef49426be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoEliminate DQUOT_START/SQUOT_START tokens 50/92250/2
Robert Varga [Sun, 23 Aug 2020 20:53:39 +0000 (22:53 +0200)]
Eliminate DQUOT_START/SQUOT_START tokens

Quoted strings are naturally terminated by end marker, potentially
preceded by DQUOT_STRING/SQUOT_STRING. This renders the corresponding
start tokens really just a academic completeness, costing us memory
while not bringing anything to the table.

Skip generation of these tokens, reducing memory usage by up to 4.5%.

JIRA: YANGTOOLS-1089
Change-Id: I0b7ce9bf292b0dd8475d63869ddfd8d2b86a387c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDisconnect IRStatement from ANTLR 46/92246/1
Robert Varga [Sun, 23 Aug 2020 10:44:21 +0000 (12:44 +0200)]
Disconnect IRStatement from ANTLR

While we currently allow instantiation only from ANTLR, we may end
up with other ways of instantiating the intermediate form. Make sure
IRStatement does not have a dependency on ANTLR.

JIRA: YANGTOOLS-1130
Change-Id: I4d28f7c4fd8457fe01e7eae967e0917c1a91b4e0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoEliminate quotedString parser construct 44/92244/7
Robert Varga [Sun, 23 Aug 2020 07:10:02 +0000 (09:10 +0200)]
Eliminate quotedString parser construct

Double-quoted strings are very common and having a separate parser
construct is not giving us much for the memory footprint it incurs.

Inline the recursive definition into argument and adjust parsing
code to cope with the change. This results in memory usage improvement
of up to 3.7%.

JIRA: YANGTOOLS-1089
Change-Id: I9fce7d1ed9f8df4bcc602978c66fcfba7bbd8ed8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoTreat empty double-quoted strings as single-quoted 45/92245/4
Robert Varga [Sun, 23 Aug 2020 08:24:43 +0000 (10:24 +0200)]
Treat empty double-quoted strings as single-quoted

Since the string is empty, there is nothing left to be done anyway
for double quotes. Converting the quotes has the slight benefit of
skipping some amount of inspection during assembly.

JIRA: YANGTOOLS-1130
Change-Id: Ie1ff0672f9556d1137f3a466085863ac65f574c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoSwitch SchemaAwareApplyOperation error reporting 02/90002/3
Robert Varga [Wed, 27 May 2020 12:23:31 +0000 (14:23 +0200)]
Switch SchemaAwareApplyOperation error reporting

Switch to reporting IllegalStateException when the target schema
node is not as opposed to IllegalArgumentException. This makes it
clear that we have entered internal inconsistency rather than
the user doing something wrong.

Furthermore eliminate the possibility of throwing an unchecked
exception when the user has made a wrong reference -- opting for
a well-controlled checked exception instead.

JIRA: YANGTOOLS-1105
Change-Id: Icd3ddb03a721358d07427e1fddeec8a71e73b933
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFurther optimize YANG statement parsing 39/92239/1
Robert Varga [Sat, 22 Aug 2020 20:26:56 +0000 (22:26 +0200)]
Further optimize YANG statement parsing

Recursive definition of stringPart can easily end up with a large
number of retained objects -- i.e. we get StringPartContext for
each concatenation, with potentially small lists of three tokens.

Furthermore each unquotedString has ends up being typically defined
by a UnquotedStringContext containing a single StringPartContext,
which is clearly wasteful.

The grammar we are looking at is not that complex, hence we can
rewrite it without relying on recursion -- thus improving memory
footprint.

JIRA: YANGTOOLS-1089
Change-Id: I18eb1305d3e024d530552ac5cea0b5a928da0048
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix eclipse nullness warnings around Class 35/92235/5
Robert Varga [Sat, 22 Aug 2020 17:20:42 +0000 (19:20 +0200)]
Fix eclipse nullness warnings around Class

Eclipse warns about @NonNull mismatch in typical callers, fix these
warnings.

Change-Id: I81973fa08bcd9408c99f38a6d7df0083c3445526
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
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>