yangtools.git
4 years agoBump versions to 4.0.6-SNAPSHOT 15/86915/1
Robert Varga [Wed, 15 Jan 2020 00:11:24 +0000 (01:11 +0100)]
Bump versions to 4.0.6-SNAPSHOT

This starts the next development iteration.

Change-Id: I92005a8389ba8e42a5d96617c7a928164204c00e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCheck if we are operating in a grouping before issuing a warning 97/86897/2
Robert Varga [Tue, 14 Jan 2020 16:30:09 +0000 (17:30 +0100)]
Check if we are operating in a grouping before issuing a warning

If we are examining a list in a grouping, we should not be issuing
a warning, as we do not know where that grouping is going to be
instantiated.

Once we determine that a warning may be appropriate, walk statement
contexts upwards, searching for a grouping -- if we find one, just
bail out without any warning.

JIRA: YANGTOOLS-957
Change-Id: If54b05cc444f19f56c6f8b4f931d85b0b270b4ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate DataNodeIterator 79/86879/1
Robert Varga [Tue, 14 Jan 2020 14:56:18 +0000 (15:56 +0100)]
Deprecate DataNodeIterator

This class is used in two places only, where each of the places
only needs specific type of nodes. Expose utility methods for
those two cases and a general tranverser method from SchemaNodeUtils
and deprecate DataNodeIterator.

Change-Id: I4fdc47e16fe2ea7e6f042bb80fe869657ee93fac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoOptimize DataNodeIterator.hasNext() 78/86878/1
Robert Varga [Tue, 14 Jan 2020 14:18:42 +0000 (15:18 +0100)]
Optimize DataNodeIterator.hasNext()

This does not quite make sense, but can be optimized to only quickly
look at the collection.

Change-Id: Iabc8414ff712126699f54c02f5aaf9506c4f3f6b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate AbstractEffectiveContainerSchemaNode 64/86864/14
Robert Varga [Mon, 13 Jan 2020 15:02:40 +0000 (16:02 +0100)]
Deprecate AbstractEffectiveContainerSchemaNode

With ContainerEffectiveStatementImpl refactored, this class does not
have a direct user and can thus be folded into
AbstractEffectiveOperationContainerSchemaNode.

Deprecate it for removal, so that it does not accidentally pick up
any new users.

JIRA: YANGTOOLS-1065
Change-Id: Ie078b2de0161798a7580e125b19955cebeb1d525
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRefactor ContainerEffectiveStatementImpl 61/86861/17
Robert Varga [Mon, 13 Jan 2020 12:42:04 +0000 (13:42 +0100)]
Refactor ContainerEffectiveStatementImpl

The story here is very similar to ListEffectiveStatementImpl,
with the additional simplifications that containers are pretty
much same.

Size reduction from this refactor ends up being typical 104 bytes
to 40 bytes typical, eliminating a bunch of static collections
in the process.

JIRA: YANGTOOLS-1065
Change-Id: I1050c4e8f82f60274c78e810fc31896daccba389
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate AbstractEffectiveMustConstraintAwareSimpleDataNodeContainer 62/86862/15
Robert Varga [Mon, 13 Jan 2020 12:46:44 +0000 (13:46 +0100)]
Deprecate AbstractEffectiveMustConstraintAwareSimpleDataNodeContainer

With ListEffectiveStatementImpl gone, this class does not have a direct
user and can thus be folded into AbstractEffectiveContainerSchemaNode.

Deprecate it for removal, so that it does not accidentally pick up
any new users.

JIRA: YANGTOOLS-1065
Change-Id: I70b4f11941d248f44dbb8fc146bf5564193b368d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRefactor ListEffectiveStatementImpl 57/86857/18
Robert Varga [Sun, 12 Jan 2020 18:12:09 +0000 (19:12 +0100)]
Refactor ListEffectiveStatementImpl

ListEffectiveStatement implementation is immensely big -- it takes
anywhere between 112 and 224 bytes (120 typical), most of which are
really only indices on substatements, which we can construct on demand.

Applying mixin + layout classes here allows us to drop the size of
these statements to 40/48 bytes typical, with 88 bytes worst case.

The effect on retained memory is ~12% memory foot print reduction,
driven by both reduction of number of ImmutableSets and reduced object
size.

JIRA: YANGTOOLS-1065
Change-Id: Iebcf16b500a874dff94bb21b6f9f59bf056fea51
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRefactor Leaf(List)EffectiveStatementImpl 15/86815/24
Robert Varga [Wed, 8 Jan 2020 23:22:32 +0000 (00:22 +0100)]
Refactor Leaf(List)EffectiveStatementImpl

Leaf(List)EffectiveStatementImpl costs 88 bytes each instance in common
Linux deployment. This turns out to be unnecessary, as be can easily
drop the size to 32/40 (48 worst) bytes by splitting out well-known
constants. This can represent as much as 10% savings on retained heap.

Since the two statements are sharing mapping towards SchemaNode world,
we introduce EffectiveStatementMixins -- utility bridge interfaces,
which are implementing aspects of DocumentedNode and its subclasses
in terms of EffectiveStatement and some mixed-in state.

JIRA: YANGTOOLS-1065
Change-Id: Icdafc4a196d86d2a493a44523bc81b1024854acb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix statement support generic arguments 70/86870/2
Robert Varga [Mon, 13 Jan 2020 22:32:44 +0000 (23:32 +0100)]
Fix statement support generic arguments

StatementSupport implementations should be specifying exact effective
statement, so that EffectiveStatement is correctly tied into the support.

This leads to less generic arguments, making the code easier to read
and more predictable in results.

Change-Id: I24c611035731124315778f834e1a6d6f6a779e0f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCleanup AugmentEffectiveStatementImpl 68/86868/3
Robert Varga [Mon, 13 Jan 2020 21:08:54 +0000 (22:08 +0100)]
Cleanup AugmentEffectiveStatementImpl

NamespaceRevisionAware is derived from a QName, hence we can store
the namespace/revision as a QNameModule, saving us a field.

JIRA: YANGTOOLS-1065
Change-Id: I5026ba79fe28686b6d8d05390db558f2b30845b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRefactor KeyEffectiveStatementImpl 43/86843/10
Robert Varga [Thu, 9 Jan 2020 17:04:07 +0000 (18:04 +0100)]
Refactor KeyEffectiveStatementImpl

KeyEffectiveStatementImpl costs 32 bytes each instance in common
Linux deployment. This turns out to be unnecessary, as be can easily
drop the size to 16/24 bytes, based on whether the key is referenced
in the same module as it is defined.

The method we do this by is to provide 4 distinct implementations,
based on 2x2 matrix of locality w.r.t declared statement (same module
means we can can reuse declared argument) and number of substatements
-- "key" with a substatement is exceedingly unlikely, hence we can
usually not store substatements.

JIRA: YANGTOOLS-1065
Change-Id: Id1235131a8568236870521cb988e730a233ea96c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRefactor simple effective statements 14/86814/14
Robert Varga [Wed, 8 Jan 2020 20:21:16 +0000 (21:21 +0100)]
Refactor simple effective statements

Currently DescriptionEffectiveStatementImpl takes 32 bytes in typical
Linux environment, which is not much, but for well-documented models this
can amount to 8% of the cost of a SchemaContext.

The primary cause is of course is inlining of groupings, but even if that
is fixed we will end up with at least one instance for each description,
so sizing here is important.

We can get rid of this cost by decomposing the implementation by known
DescriptionEffectiveStatement invariants, so that we end up with using
16 (typical) or 24 bytes in the same environment. Worst case size is
reduced to 24 (typical) or 32 bytes (from 48). The overall benefit is
expected to be around 4% SchemaContext size.

Apply the same refactor to reference, contact, belongs-to, ordered-by,
default, error-app-tag, error-message, prefix, presence, reference, units.

JIRA: YANGTOOLS-1065
Change-Id: Ic8da0c38cd89ae10c66ebb70719cf582cb0f627b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoGeneralize findFirstEffectiveSubstatement() 48/86848/1
Robert Varga [Fri, 10 Jan 2020 22:43:20 +0000 (23:43 +0100)]
Generalize findFirstEffectiveSubstatement()

There is no point in restricting what instances we can seach for,
make sure we can work with any class.

Change-Id: Ia8834fd5a7550295b861d3494b5a343d760d3e86
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse parallel stream to process YANG text files 97/86797/3
Robert Varga [Tue, 7 Jan 2020 23:21:49 +0000 (00:21 +0100)]
Use parallel stream to process YANG text files

When we are examining local YANG files, we are also performing
first step of parsing to determine what the module/revision is
without relying on the file name. This process can take quite
some time if the models are large and/or there are many of them.

Since each file is independent at this stage, use a parallel
stream (and hence common FJ pool) to perform this task in multiple
threads before moving on to processing.

JIRA: YANGTOOLS-1062
Change-Id: I31cee2aa7f313052565ba723cf4c52566821a625
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix {Length,Range}Statement retaining ArrayLists 27/86827/2
Robert Varga [Thu, 9 Jan 2020 15:06:16 +0000 (16:06 +0100)]
Fix {Length,Range}Statement retaining ArrayLists

We want the statement argument to be immutable, make sure this
is so, incidentally reducing footprint, too.

Change-Id: I5e3353ad885ab3cc9eef910d2d4bff1db9eabcf0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRelease YangParser from ProcessorModuleReactor 96/86796/2
Robert Varga [Tue, 7 Jan 2020 22:23:12 +0000 (23:23 +0100)]
Release YangParser from ProcessorModuleReactor

Once we have built the SchemaContext, we should not be retaining
the YangParser instance, as it contains a reference to
BuildGlobalContext, which in turn holds all the scratch data
used during SchemaContext assembly.

Throw all of that away as soon as we have a SchemaContext.

JIRA: YANGTOOLS-1061
Change-Id: Idbc4ab91861e3e7581daa3cebceb0fa49823a028
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCorrect ByteBufUtils javadoc 96/86696/1
Robert Varga [Sat, 4 Jan 2020 12:00:47 +0000 (13:00 +0100)]
Correct ByteBufUtils javadoc

We have some copy&paste references to Byte, which should actually
point to other types. This patch fixes those.

Change-Id: I51661b2519d64a586447e42bd05f5ba8b5d67b5c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCompact YT891Test 51/86651/2
Robert Varga [Mon, 30 Dec 2019 21:49:25 +0000 (22:49 +0100)]
Compact YT891Test

This removes duplicate builder chain in favor of passing variant
value to a helper method.

Change-Id: If24612f5d559a9556a7152dbbdd1ab28199e4ad2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove YANGTOOLS-821 test 47/86647/3
Robert Varga [Mon, 30 Dec 2019 21:12:28 +0000 (22:12 +0100)]
Move YANGTOOLS-821 test

As the test does not rely on anything XML, move it to yang-data-impl,
where the tested implementation actually lives.

Change-Id: I6f2cd22aa39dc48d175e537ff7754bfb11d37296
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoYangtools821Test does not need XML 46/86646/3
Robert Varga [Mon, 30 Dec 2019 20:39:24 +0000 (21:39 +0100)]
Yangtools821Test does not need XML

This migrates the test to not use XML parsing for simple data
structures and defines them statically.

Change-Id: Iba508e3024c6f7e0820f8914f7e0f2a0c35cebee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReuse SchemaContext in Yangtools821Test 45/86645/3
Robert Varga [Mon, 30 Dec 2019 20:20:56 +0000 (21:20 +0100)]
Reuse SchemaContext in Yangtools821Test

There is no point in re-creating schemacontext, just initialize
it in @BeforeClass.

Change-Id: Ic08596eac6b47415e3511c41d962a494daed4f93
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove YANGTOOLS-892 test 44/86644/3
Robert Varga [Mon, 30 Dec 2019 20:17:49 +0000 (21:17 +0100)]
Move YANGTOOLS-892 test

As the test does not rely on anything XML, move it to yang-data-impl,
where the tested implementation actually lives.

Change-Id: I9d77734bc05e5c4b1033da5f32f9bc80f50bd827
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd missing test assertions 48/86648/1
Robert Varga [Mon, 30 Dec 2019 21:24:03 +0000 (22:24 +0100)]
Add missing test assertions

While the test has shown the exception no longer occurs, it should
also make assertions. Add that.

JIRA: YANGTOOLS-1060
Change-Id: Id3f864f769c3ac845fe5ed3501fba24502206202
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoYangtools892Test does not need XML 34/86634/5
Robert Varga [Mon, 30 Dec 2019 16:09:28 +0000 (17:09 +0100)]
Yangtools892Test does not need XML

This migrates the test to not use XML parsing for simple data
structures and defines them statically.

Change-Id: I1c4f71035d1949395cc6780a74a49133a1b28b98
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImprove QName resolution 29/86629/2
Robert Varga [Mon, 30 Dec 2019 13:44:49 +0000 (14:44 +0100)]
Improve QName resolution

AbstractQName, as exposed from QNameStep is sufficient for us to
execute the step. Take advantage of this, simplifying and speeding
up namespace binding.

Change-Id: I1a5f58a5008ee077fb6496a59d4bbb0c132ca6ed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove YANGTOOLS-891 test 33/86633/2
Robert Varga [Mon, 30 Dec 2019 15:55:21 +0000 (16:55 +0100)]
Move YANGTOOLS-891 test

As the test does not rely on anything XML, move it to yang-data-impl,
where the tested implementation actually lives.

Change-Id: Ifdcc561f9fffb4b93e03a8e7538261046fd338d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoYangtools891Test does not need XML 32/86632/2
Robert Varga [Mon, 30 Dec 2019 15:18:44 +0000 (16:18 +0100)]
Yangtools891Test does not need XML

This migrates the test to not use XML parsing for simple data
structures and defines them statically.

Change-Id: Iaf97f4853349b74efb21d1600bd72c4ea35c325a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSpeed up YT891 test 31/86631/2
Robert Varga [Mon, 30 Dec 2019 14:59:06 +0000 (15:59 +0100)]
Speed up YT891 test

Rather than parsing SchemaContext multiple times, just use @BeforeClass
to initialize it once.

Change-Id: I4c9e5c30a2767bab35133557121e0ff1710e688c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoPropagate 'absolute path' invariant 26/86626/2
Robert Varga [Mon, 30 Dec 2019 11:56:23 +0000 (12:56 +0100)]
Propagate 'absolute path' invariant

Since we are checking whether an expression is absolute or not,
we can hook onto our internal methods, improving performance a bit
and reducing reliance on PathExpressionImpl.

Change-Id: I1e73f9f5ac2652b57517bdfc1631ba49e98396f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove duplicate checkState() 25/86625/2
Robert Varga [Mon, 30 Dec 2019 11:54:00 +0000 (12:54 +0100)]
Remove duplicate checkState()

The only caller already checks for the path being absolute, there
is no need to check twice.

Change-Id: I24a038ccfe73b47ceaa13e65f3ea3b74c1a3176f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCollapse SchemaContextUtil.typeDefinition() 24/86624/2
Robert Varga [Mon, 30 Dec 2019 11:36:34 +0000 (12:36 +0100)]
Collapse SchemaContextUtil.typeDefinition()

We have TypedDataSchemaNode to hold the leaf/leaf-list trait of
having a type. This allows us to ditch some code duplication.

Change-Id: I959ff6a8f997e557736a081f89df6c16b69e1270
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDefer path stripping 23/86623/2
Robert Varga [Mon, 30 Dec 2019 11:29:31 +0000 (12:29 +0100)]
Defer path stripping

If we are passed a relative path, we end up first stripping it
and then realizing it's relative. Invert the order, making absolute
proper invariant.

Change-Id: Ic272ac83a9df9d2343b1cd8c5f71debdcdc0faad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove useless SchemaContextUtil. qualification 22/86622/2
Robert Varga [Mon, 30 Dec 2019 11:27:39 +0000 (12:27 +0100)]
Remove useless SchemaContextUtil. qualification

This trims a few lines, making navigation easier.

Change-Id: I42bef346e774d9bd1173092bdefcd68e400b9a5e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix SchemaContextUtils.findDataSchemaNode() namespace handling 11/86611/16
Robert Varga [Sun, 29 Dec 2019 08:11:29 +0000 (09:11 +0100)]
Fix SchemaContextUtils.findDataSchemaNode() namespace handling

If we encounter a qualified identifier in a path define in a submodule
which uses a prefix defined in the submodule only (without a matching
import in the main module), we would end up not being able to resolve
the prefix.

Ever since we integrated YANGTOOLS-969, this is not necessary, as the
parser resolves all qualified identifiers, as per PathExpression API
contract.

Take advantage of this fact, reducing the amount of re-parsing we do
for historic reasons, completely removing the need to resolve prefixes.

JIRA: YANGTOOLS-1060
Change-Id: Id761d103f1070738624cd0ef1865270e4b884be2
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd another alternative SchemaContextUtil.findDataSchemaNode() 21/86621/6
Robert Varga [Mon, 30 Dec 2019 08:11:16 +0000 (09:11 +0100)]
Add another alternative SchemaContextUtil.findDataSchemaNode()

We have a number of call sites which are using the XPath variant
of SchemaContextUtil.findDataSchemaNode() in context where the
complexity is not warranted.

Introduce utility methods to migrate those callers to a simplified
version which takes resolved QNames (but does not use SchemaPath),
reducing proliferation of PathExpressionImpl.

JIRA: YANGTOOLS-1060
Change-Id: Id645563733af448f42ecdc62b26205c1a97a2216
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoClean up SchemaContextUtilTest 16/86616/2
Robert Varga [Sun, 29 Dec 2019 13:09:03 +0000 (14:09 +0100)]
Clean up SchemaContextUtilTest

There is no need to parse YANG files multiple times, just use
@BeforeClass to resolve invariants.

JIRA: YANGTOOLS-1052
Change-Id: Id290aec957b5f70bcdaa7e020799783b02b23c28
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove SchemaContextUtilTest 15/86615/3
Robert Varga [Sun, 29 Dec 2019 12:45:46 +0000 (13:45 +0100)]
Move SchemaContextUtilTest

We now have the proper place to hold this unit test, move it to
yang-model-util. Also split out tests which rely on pure mocking
so that they run in yang-model-util instead.

JIRA: YANGTOOLS-1052
Change-Id: Ic736621c7ec2f55ee45d608866f7a581a6d60ef6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoClean up openconfig-version test resources 14/86614/1
Robert Varga [Sun, 29 Dec 2019 12:28:39 +0000 (13:28 +0100)]
Clean up openconfig-version test resources

This moves the test resources so they are not scattered across
two directory hierarchies.

Change-Id: I202f415b8f7366047a691f80c1899b6d2875a4a7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove useless UnsupportedOperationException throws 12/86612/2
Robert Varga [Sun, 29 Dec 2019 09:28:13 +0000 (10:28 +0100)]
Remove useless UnsupportedOperationException throws

Utility methods have a private constructor, there is no need to
explicitly guard against instantiation.

Change-Id: I93562128b61f051510245de5fe78226508f571b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse findTargetNode() in findDataSchemaNode() 10/86610/2
Robert Varga [Sun, 29 Dec 2019 08:47:18 +0000 (09:47 +0100)]
Use findTargetNode() in findDataSchemaNode()

This removes a bit of duplication by sharing the code path with
relative resolver.

Change-Id: Icb619aca8d87ade490066fd8c6abe0d2a96dec96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate PathExpressionImpl for removal 09/86609/1
Robert Varga [Sun, 29 Dec 2019 08:07:59 +0000 (09:07 +0100)]
Deprecate PathExpressionImpl for removal

This transitional class is deprecated, mark it for removal, too.

Change-Id: I8241fd17780f1a9bd5940d2e3dfc52888f301a29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd RFC8341 NACM module identity 32/80732/4
Robert Varga [Fri, 8 Mar 2019 05:01:07 +0000 (06:01 +0100)]
Add RFC8341 NACM module identity

This adds revisions of RFC8341 without actually binding to them.

Change-Id: Icaae9347c5f4e3f02f976d629a4f760eca6dd464
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump versions to 4.0.5-SNAPSHOT 02/86602/1
Robert Varga [Sat, 28 Dec 2019 17:47:11 +0000 (18:47 +0100)]
Bump versions to 4.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: I1b3713dde4fb051e2486190f7dc2e37bd04cbc98
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoIssue an info message when a config=true list does not have keys 98/86598/1
Robert Varga [Sat, 28 Dec 2019 10:09:37 +0000 (11:09 +0100)]
Issue an info message when a config=true list does not have keys

RFC7950 section 7.8.2 places an explicit requirement that lists
representing configuration (i.e. config=true) must define at least
one key.

This restriction does make sense in contexts like NETCONF, but is
generally not needed in OpenDaylight. Since it hurts model
interoperability, add a message pointing this violation out.

JIRA: YANGTOOLS-957
Change-Id: If29078e51aa1ec55fa070f263755f15147ad835f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate resetAugmenting() for removal 96/86596/1
Robert Varga [Sat, 28 Dec 2019 09:59:19 +0000 (10:59 +0100)]
Deprecate resetAugmenting() for removal

These methods were forgotten in the 4.0.0 transition, mark them
as deprecated-for-removal. A follow-up patch will remove them in
the 5.0.0 time frame.

Change-Id: I1920129e01cef2bf8ee8679d579679dd986d0ed5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd yang-common JMPS javadoc 85/86585/1
Robert Varga [Thu, 26 Dec 2019 21:38:19 +0000 (22:38 +0100)]
Add yang-common JMPS javadoc

This adds Module-level documentation, at least its bare bones.

Change-Id: I08c98f111063d3dffb1f2812aab69a20de289ea5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSplit out RFC7950 ANTLR grammars 80/86580/3
Robert Varga [Thu, 26 Dec 2019 12:51:40 +0000 (13:51 +0100)]
Split out RFC7950 ANTLR grammars

ANTLR-generated code does not pass SpotBugs validation, leaving a
lot of code uncovered by SpotBugs enforcement. This patch splits
the grammars into a separate artifact, allowing the rest of the
parser to be cleaned up.

JIRA: YANGTOOLS-1057
Change-Id: If65bf28e1add5085cb43a2fc2ad71cafc4cd6adb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpdate yang-xpath-antlr a bit 79/86579/2
Robert Varga [Thu, 26 Dec 2019 13:04:31 +0000 (14:04 +0100)]
Update yang-xpath-antlr a bit

This adds the description of the package held in this artifact, adding
a warning about API stability.

Also turn the artifact into a proper JPMS module, as it does not really
depend on anything.

JIRA: YANGTOOLS-1055
Change-Id: Id5a2fef1fa9ef0e56f1ab6994c5a90f06f0ab4f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSuppress UPM_UNCALLED_PRIVATE_METHOD 82/86582/2
Robert Varga [Thu, 26 Dec 2019 13:24:11 +0000 (14:24 +0100)]
Suppress UPM_UNCALLED_PRIVATE_METHOD

This is a SpotBugs deficiency, suppress warnings generated from it.

JIRA: YANGTOOLS-1056
Change-Id: I5d440de6ce98207c72727273eedf26d3c0626f86
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRework LeafRefValidation 66/86566/17
Robert Varga [Wed, 25 Dec 2019 11:12:54 +0000 (12:12 +0100)]
Rework LeafRefValidation

This reworks LeafRefValidation in terms of interpreting XPathExpression
via exposed parsed steps. This allows us to eliminate a chunk of parsing
code, speeding the initialization process up.

QNamePredicateImpl/AbstractQNameWithPredicate are losing their Serializable
trait, as it is not really useful and tickles SpotBugs unnecessarily.

JIRA: YANGTOOLS-1051
Change-Id: I502f54052ca8bb10e6595f41ba7aca6cef9550ce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoIntroduce yang-xpath-antlr 77/86577/4
Robert Varga [Wed, 25 Dec 2019 22:52:59 +0000 (23:52 +0100)]
Introduce yang-xpath-antlr

This splits out ANTLR-generated parser code into a separate
artifact, so that it does not interfere with our regular
hand-written code.

Also fixup the two issues reported by spotbugs and flip
the switch on enforcement.

JIRA: YANGTOOLS-1055
Change-Id: Ida1c152af8d5e2e235831f1d7b3e272820b085ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRework incoming candidate check 76/86576/2
Robert Varga [Wed, 25 Dec 2019 22:21:33 +0000 (23:21 +0100)]
Rework incoming candidate check

SpotBugs does not like the checkArgument()-based check, rework
it in terms of an explicit if(), so that SpotBugs is happy.

Change-Id: Ic0cb1554a80cdc1971e650c9d23180faf969b8d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix ValueWithQName.getQName() name 75/86575/2
Robert Varga [Wed, 25 Dec 2019 22:17:11 +0000 (23:17 +0100)]
Fix ValueWithQName.getQName() name

This adds a SpotBugs suppression and adds the correct name for the
method.

Change-Id: Ibe985a63c21693bc9efdcb4cb98513ebf4c01b7c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoInline INCORRECT_LEXICAL_REPRESENTATION 74/86574/1
Robert Varga [Wed, 25 Dec 2019 22:11:21 +0000 (23:11 +0100)]
Inline INCORRECT_LEXICAL_REPRESENTATION

This inlines the string used from a single place, eliminating
the need for String.format() and thus fixing a SpotBugs
VA_FORMAT_STRING_USES_NEWLINE issue.

Change-Id: I0746b4b28cce4ff991a632ab38ad8499e5f9aadf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRework QNameStep API integration 70/86570/4
Robert Varga [Wed, 25 Dec 2019 18:49:37 +0000 (19:49 +0100)]
Rework QNameStep API integration

What we really want here is to take advantage of the fact we have
AbstractQName. It allows us to simplify our XPath model in terms
of class differences.

JIRA: YANGTOOLS-1054
Change-Id: Icfb8f82ae5dbcc0888bf7fd734b4eb23bc277933
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix PathExpressionParser predicate path handling 71/86571/2
Robert Varga [Wed, 25 Dec 2019 20:58:24 +0000 (21:58 +0100)]
Fix PathExpressionParser predicate path handling

Handling of a predicate was wrong in that the right-handside
involving a current() call did not correctly predicates.

This turns out to be a simple typo in two places, fix it and add
an explicit test.

JIRA: YANGTOOLS-1053
Change-Id: I54bac10cdd508503ad896edd628ffa436173ca6b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd spotbugs/811 suppression 65/86565/1
Robert Varga [Wed, 25 Dec 2019 11:24:25 +0000 (12:24 +0100)]
Add spotbugs/811 suppression

JDK11 incurs a spotbugs warning which is not correct, supress it.

Change-Id: Ib4262bfd0aa3728fe7eb94eb970e4b59035cc0b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix InterningLeafSetNodeBuilder check 64/86564/1
Robert Varga [Wed, 25 Dec 2019 11:23:09 +0000 (12:23 +0100)]
Fix InterningLeafSetNodeBuilder check

The instanceof check is wrong, as pointed out by SpotBugs, as we
want to check for LeafListSchemaNode not LeafSetNode.

Change-Id: If538beca159c100621d5661dc8dced5c1051dfe9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoTrim deref() argument 60/86560/1
Robert Varga [Tue, 24 Dec 2019 21:55:41 +0000 (22:55 +0100)]
Trim deref() argument

When we are evaluating a deref() call we need to make sure we
strip the string completely, otherwise we would arrive at incorrect
path.

JIRA: YANGTOOLS-1050
Change-Id: I36b45677243bcb8ccbf91f8813f082dbddee2a6a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCorrect deref() leafref handling 49/86549/8
Robert Varga [Mon, 23 Dec 2019 19:06:56 +0000 (20:06 +0100)]
Correct deref() leafref handling

deref() invocation requires the target node to actually be examined,
derefenced and any subsequent path evaluated on top of it.

We correct the implementation to account for correct derefence and
add a UT for a confusing test case. This is implemented using
YangParserTestUtils in a separate internal artifact, hence future
test cases are easy to implement.

JIRA: YANGTOOLS-1050
Change-Id: I0777da339577f93ecc2786f5beab40b29554fe0e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAllow Errata 5617 expressions in leafref 90/82690/20
Robert Varga [Mon, 24 Jun 2019 16:01:16 +0000 (18:01 +0200)]
Allow Errata 5617 expressions in leafref

This updates PathExpression interface to allow expressing
leafref paths which start with a deref(...) function call,
as proposed by https://www.rfc-editor.org/errata/eid5617.

This unfortunately necessitates breaking the API contract of this
interface, as the original object model could not express these.

JIRA: YANGTOOLS-968
Change-Id: I3a193d338de5a82b95d2dd6cc5200e77032e67d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
4 years agoForce path expression parsing consume all data 45/86545/3
Robert Varga [Sun, 22 Dec 2019 10:20:29 +0000 (11:20 +0100)]
Force path expression parsing consume all data

We really need to make sure we do not end up ignoring part of the
expression just because our rules are not exhaustive. This adds
the appropriate test and fix in grammar.

JIRA: YANGTOOLS-1049
Change-Id: I85278f0cd109897459be1db029fafbc95e203201
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMark yang-maven-plugin as thread-safe 14/86414/1
Robert Varga [Fri, 13 Dec 2019 08:16:25 +0000 (09:16 +0100)]
Mark yang-maven-plugin as thread-safe

The plugin can be executed in multiple projects concurrently,
mark it as such.

Change-Id: I600e733299a7db87dc8040bef89c97ecf9f5f568
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix a method reference 13/86413/1
Robert Varga [Fri, 13 Dec 2019 08:15:36 +0000 (09:15 +0100)]
Fix a method reference

This was missed during upgrade to EffectiveModelContext, fix that.

Change-Id: I9dcb2b97d9648a527b156811568e9bf650a8165a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump versions to 4.0.4-SNAPSHOT 31/86331/3
Robert Varga [Tue, 10 Dec 2019 17:14:48 +0000 (18:14 +0100)]
Bump versions to 4.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: If6e6b987d6db1d7bb6ccf1e6956e27b7f5457cbf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd yang-common-netty 22/86022/5
Robert Varga [Wed, 27 Nov 2019 10:07:31 +0000 (11:07 +0100)]
Add yang-common-netty

This adds common utilities for dealing with Uint8 types with ByteBufs,
along with some convenience nullness-handling methods.

JIRA: YANGTOOLS-1047
Change-Id: Idf5bef51db30c5397d440e2648fe9c417735aae2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse immutables.org annotations only 30/86330/2
Robert Varga [Tue, 10 Dec 2019 17:05:29 +0000 (18:05 +0100)]
Use immutables.org annotations only

odlparent support has been refactored to allow better footprint,
take advantage of that.

Change-Id: Ic40ae632ac9c31cb6dffd5b893d04598ab3d9687
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 6.0.2 29/86329/2
Robert Varga [Tue, 10 Dec 2019 17:04:46 +0000 (18:04 +0100)]
Bump odlparent to 6.0.2

This picks up the latest fixes and improvements.

Change-Id: I88c54a002c5c99501c2abb0a1f84b59d90643cff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove intermediate checking maps 84/85984/8
Robert Varga [Tue, 26 Nov 2019 16:57:27 +0000 (17:57 +0100)]
Remove intermediate checking maps

We are enforcing schema tree validity, which is a superset of
the intermediate checks being done in these constructors. Remove
these maps.

JIRA: YANGTOOLS-1043
Change-Id: I88c6b00794fcc31970571bd72a0f57ecb9bd9a19
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEliminate childNodes map 63/85963/18
Robert Varga [Mon, 25 Nov 2019 15:06:50 +0000 (16:06 +0100)]
Eliminate childNodes map

Both AbstractEffectiveDocumentedDataNodeContainer and
AbstractEffectiveModule are subclasses of
AbstractSchemaEffectiveDocumentedNode, which contains schema tree
index.

As all DataSchemaNodes have to strictly be a subset of the schema
tree, we can ditch the dedicated index and simply perform a lookup
on the schema tree followed by a check for DataSchemaNode.

JIRA: YANGTOOLS-1043
Change-Id: I79d5b8ceeb6c16aef162eda9c2a8430b7a9c98f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCompute mustConstraints lazily 62/85962/11
Robert Varga [Mon, 25 Nov 2019 14:40:50 +0000 (15:40 +0100)]
Compute mustConstraints lazily

We usually do not access unknown nodes (which are mostly empty
anyway). This patch moves their computation to first access.

JIRA: YANGTOOLS-1041
Change-Id: Idd47d93bd2cfd05816d311e3d9271b6173b2faad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCompute unknown nodes lazily 60/85960/15
Robert Varga [Mon, 25 Nov 2019 13:26:29 +0000 (14:26 +0100)]
Compute unknown nodes lazily

We usually do not access unknown nodes (which are mostly empty
anyway). This patch moves their computation to first access.

JIRA: YANGTOOLS-1041
Change-Id: I85b286b4ce8477c2999aeeb34ee76ed32e597cef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCentralize must contraint definitions 61/85961/11
Robert Varga [Mon, 25 Nov 2019 14:11:16 +0000 (15:11 +0100)]
Centralize must contraint definitions

A number of statemnts can contain must expressions, which we are
tracking separately in each class. This adds common superclasses
to hold the common definition, reducing the amount of duplication.

JIRA: YANGTOOLS-1040
Change-Id: Id5733b62838f484350094456452c7a1d0039f3f2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCentralize unknownNodes 59/85959/10
Robert Varga [Mon, 25 Nov 2019 12:54:17 +0000 (13:54 +0100)]
Centralize unknownNodes

We have a number of statements which collect unknown nodes, which
are specified by DocumentedNode. Centralize them as close as possible
in the utility class hierarchy.

JIRA: YANGTOOLS-1040
Change-Id: I337fb684b557269926e641d86d6afd609b2dce57
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRefactor AbstractEffectiveModule 70/85970/10
Robert Varga [Tue, 26 Nov 2019 11:27:57 +0000 (12:27 +0100)]
Refactor AbstractEffectiveModule

AbstractEffectiveModule has a number of special cases in its
constructor, effectively adding behavior based on expected subclass.

Furthermore its layout does not correctly propagate declared/effective
substatements towards superclass, leading to partially-populated
data/schema tree namespaces.

This patch moves the special handling bits to subclasses, making
AbstractEffectiveModule properly agnostic of whether it is used as
a ModuleEffectiveStatement or SubmoduleEffectiveStatement.

For the mechanics of including submodule effective statements into
the main module we introduce ModuleStmtContext, which performs the
semantic addition, thus all StmtContexts are properly visible as if
they were declared in the main module.

JIRA: YANGTOOLS-1042
Change-Id: Ice9609c2db82981ec9156d076f8a02bc637181b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix XPath binary expressions 00/86000/4
Robert Varga [Tue, 26 Nov 2019 23:54:43 +0000 (00:54 +0100)]
Fix XPath binary expressions

AntlrXPathParser.parseRelationalExpr() is consuming acquiring
the operator twice, which leads to iterator state mismatch:

Caused by: java.util.NoSuchElementException
    at java.util.ArrayList$Itr.next (ArrayList.java:999)
    at org.opendaylight.yangtools.yang.xpath.impl.AntlrXPathParser.nextOperator (AntlrXPathParser.java:640)
    at org.opendaylight.yangtools.yang.xpath.impl.AntlrXPathParser.parseRelationalExpr (AntlrXPathParser.java:561)
    at org.opendaylight.yangtools.yang.xpath.impl.AntlrXPathParser.parseRelational (AntlrXPathParser.java:431)
    at org.opendaylight.yangtools.yang.xpath.impl.AntlrXPathParser.parseEquality (AntlrXPathParser.java:310)
    at org.opendaylight.yangtools.yang.xpath.impl.AntlrXPathParser.parseAnd (AntlrXPathParser.java:299)
    at org.opendaylight.yangtools.yang.xpath.impl.AntlrXPathParser.parseExpr (AntlrXPathParser.java:281)
    at org.opendaylight.yangtools.yang.xpath.impl.AntlrXPathParser.parseExpr (AntlrXPathParser.java:261)
    at org.opendaylight.yangtools.yang.xpath.impl.AntlrXPathParser$Qualified.parseExpression (AntlrXPathParser.java:151)

Fix this by properly reusing operator we have already acquired.

JIRA: YANGTOOLS-1045
Change-Id: I757412278eae2d92ff2422782d666cce5bca0720
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSquash self-steps when parsing expression 01/86001/3
Robert Varga [Wed, 27 Nov 2019 00:17:33 +0000 (01:17 +0100)]
Squash self-steps when parsing expression

There is no point to repeat self-reference steps, make sure we
skip them when creating a location path. This results in slightly
smaller expressions as well as more obvious comparisons.

JIRA: YANGTOOLS-1045
Change-Id: If681dce2a6bc7155965fed91c47f19f2c541805a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDetect duplicate groupings in operation definitions 87/85987/1
Robert Varga [Tue, 26 Nov 2019 17:13:47 +0000 (18:13 +0100)]
Detect duplicate groupings in operation definitions

It seems we have been missing a namespace check here, fix that.

Change-Id: Ic6e99dfab8c6c3cfef64e519ffd84a0d6fc242a7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSpeed up confict detection 85/85985/3
Robert Varga [Tue, 26 Nov 2019 17:01:15 +0000 (18:01 +0100)]
Speed up confict detection

Instead of using Set.contains() before issuing an Set.add() and
ignoring its value, we just add the statement and check the return
value -- if it returns false, we know we have detected a conflict.

Change-Id: I3113c344056b9d745c1cdcccd6d61f68cbe9eafa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRework EffectiveStatementBase statement order restoration 67/85967/1
Robert Varga [Tue, 26 Nov 2019 10:03:27 +0000 (11:03 +0100)]
Rework EffectiveStatementBase statement order restoration

Rather than relying on mutation of effective substatements when we
are building an effective statements (and thus requiring StmtContext
to be StatementContextBase), use simple filtering to implement
statement ordering.

This limits the scope of mutable state, explains what is going
on and allows use of different StmtContext implementations.

JIRA: YANGTOOLS-1042
Change-Id: I84a2517ef0ce666fbc2f2c6faa3b0d0a43eef6eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove Collection2.filter() from EffectieStatementBase 64/85964/1
Robert Varga [Tue, 26 Nov 2019 08:30:26 +0000 (09:30 +0100)]
Remove Collection2.filter() from EffectieStatementBase

We use the filtered collection only to iterate in a for loop, hence
it is more efficient to move the filter into the loop itself,
eliminating an intermediate collection.

Change-Id: I0cc944b3cedd0758d713f394f2d3360d44c26e66
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd AbstractEffectiveDocumentedNodeWithoutStatus 57/85957/2
Robert Varga [Mon, 25 Nov 2019 12:07:44 +0000 (13:07 +0100)]
Add AbstractEffectiveDocumentedNodeWithoutStatus

We have a number of statements which are specified to be DocumentedNode,
but not DocumentedNode.WithStatus. These are handled by subclassing
DeclaredEffectiveStatementBase and repeated logic looking up description
and reference.

Introduce AbstractEffectiveDocumentedNodeWithoutStatus, which acts as
a plain DocumentedNode implementation without also implying WithStatus
and retrofits this class to all users.

JIRA: YANGTOOLS-1040
Change-Id: Ied1794c4fbd8ca27a4add1d2245fdfb10d8104cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoTarget statement hiding FIXMEs 58/85958/1
Robert Varga [Mon, 25 Nov 2019 13:14:10 +0000 (14:14 +0100)]
Target statement hiding FIXMEs

This just attaches a concrete version to hide the statements from
public view.

Change-Id: Ib2989ff512b4f94c5d14541ce0b6b5f2aa24e653
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoResync javadoc links 74/85874/1
Robert Varga [Wed, 20 Nov 2019 08:01:55 +0000 (09:01 +0100)]
Resync javadoc links

This re-synchronizes links to upstreams to match odlparent.

Change-Id: Ibc514a9aa5eb5f068561772b91061567796ed171
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSeparate out {Identity,Equality}QueuedNotificationManager 13/83713/22
Robert Varga [Fri, 16 Aug 2019 16:00:47 +0000 (18:00 +0200)]
Separate out {Identity,Equality}QueuedNotificationManager

There are use cases where we would like to use QNM on equality, i.e.
we do not realy have a listener instance, but rather a key to somewhere
else. That other place operates on equality, which makes it incompatible
with the current semantics.

This splits out the baseline queueing logic in from NotificationManager
interface, so that it can be reused to implement different execution
concepts.

QueuedNotificationManager is realized on top of it, so that the baseline
interface is implemented in AbstractQueuedNotificationManager and then
specialized to different lookups.

JIRA: YANGTOOLS-1038
Change-Id: I1123d21664a20ff380ccb7db7096801915491f6e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoNormalize predicate order in ImmutableNodes.fromInstanceId() 88/85588/3
Robert Varga [Tue, 5 Nov 2019 13:04:56 +0000 (14:04 +0100)]
Normalize predicate order in ImmutableNodes.fromInstanceId()

The only user of this method is NETCONF, which requires predicates
to be ordered in the order of key definition, as per XML encoding
rules.

Make sure we re-create NodeIdentifierWithPredicates in the schema
definition order if the provided order does not already match it.

JIRA: YANGTOOLS-1037
Change-Id: I57c389eeecb9680062be8b56c834eb569e7d3d3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoExpose underlying schema from DataContainerNormalizationOperation 86/85586/2
Robert Varga [Tue, 5 Nov 2019 12:19:21 +0000 (13:19 +0100)]
Expose underlying schema from DataContainerNormalizationOperation

For the purposes for normalizing data child order we will need to
access the underlying schema in a type-safe manner -- this adds
the mechanics to do so.

JIRA: YANGTOOLS-1037
Change-Id: Id52bd0988405429fbee87a88bb2c9d1de093fb30
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRename ListItemNormalization 85/85585/1
Robert Varga [Tue, 5 Nov 2019 12:06:28 +0000 (13:06 +0100)]
Rename ListItemNormalization

This is a confusing name, as it should match the NormalizedNode-speak,
i.e. MapEntry* and UnkeyedListEntry*. This fixes up the names, so it is
clear what node a particular class refers to.

JIRA: YANGTOOLS-1037
Change-Id: I82d57efa13b5571a4d8ca92d81b3c0955811aa7a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate LoggingThreadUncaughtExceptionHandler for removal 45/85545/1
Robert Varga [Mon, 4 Nov 2019 10:46:40 +0000 (11:46 +0100)]
Deprecate LoggingThreadUncaughtExceptionHandler for removal

This class creates leaks SLF4J API as an API dependency, which is
rather wrong. Deprecate it for removal.

Change-Id: I29c43855742928782851a45e9b76b9ea4d74aad3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix reported string duplication warnings 96/85496/2
Robert Varga [Fri, 1 Nov 2019 15:51:38 +0000 (16:51 +0100)]
Fix reported string duplication warnings

Sonar is not happy about duplicated strings. This fixes up duplication
by either specializing the string or moving access to a common method.

Change-Id: Ie4f6ef642a68258c3d8e4f622b96ec95759bad55
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove unused logger from ArgumentUtils 95/85495/2
Robert Varga [Fri, 1 Nov 2019 15:45:11 +0000 (16:45 +0100)]
Remove unused logger from ArgumentUtils

sonar is flagging this unused logger, remove it.

Change-Id: I5abe9aa119bc1cda5b20ac9a007828d583ddffe0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd yang-data-codec-binfmt packaging 21/85421/15
Robert Varga [Mon, 28 Oct 2019 22:11:45 +0000 (23:11 +0100)]
Add yang-data-codec-binfmt packaging

This packages the utility codec in odl-yangtools-codec, so that
it is widely available to downstream users.

JIRA: YANGTOOLS-1035
Change-Id: I9200915bbeeade00bbbadfae8e02568546e1a0e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoExtend yang-data-codec-binfmt test suite 23/85423/17
Robert Varga [Tue, 29 Oct 2019 02:12:13 +0000 (03:12 +0100)]
Extend yang-data-codec-binfmt test suite

Improve coverage to test various values serialization, improving
coverage above 80%.

JIRA: YANGTOOLS-1035
Change-Id: I8accf50944bcceafe9ca09d6ebdfc75c41d35791
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImport yang-data-codec-binfmt test suite 22/85422/14
Robert Varga [Fri, 1 Nov 2019 11:13:19 +0000 (12:13 +0100)]
Import yang-data-codec-binfmt test suite

This imports the test suite and ensures all versions are covered.

JIRA: YANGTOOLS-1035
Change-Id: Ic14370343ff4637284d9338b90a451e2ee81b872
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove useless throws 82/85482/5
Robert Varga [Fri, 1 Nov 2019 11:32:07 +0000 (12:32 +0100)]
Remove useless throws

We trust the utility classes are not going to be instantiated,
hence we do not need to throw UOE.

JIRA: YANGTOOLS-1035
Change-Id: Iecece4dc8a169dfb0bc80e1e914ec7ae2f4d7e9c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoModernize a few descriptions 81/85481/2
Robert Varga [Fri, 1 Nov 2019 10:18:24 +0000 (11:18 +0100)]
Modernize a few descriptions

Description is visible in bundle info, make sure we add a a few
words about what we are actually providing in these.

Change-Id: I56d4263a1baedbc94dc10f9e2b3f1c2267ed77b5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMerge branch 'master' of ../controller
Anil Belur [Fri, 1 Nov 2019 06:59:39 +0000 (12:29 +0530)]
Merge branch 'master' of ../controller

- Pull in classes for src/test

./node
./node/utils
./node/utils/QNameFactoryTest.java
./node/utils/transformer
./node/utils/transformer/NormalizedNodePrunerTest.java
./node/utils/stream
./node/utils/stream/NormalizedNodeStreamReaderWriterTest.java
./node/utils/stream/SerializationUtilsTest.java
./node/utils/stream/LithiumWriteObjectMappingTest.java
./node/utils/stream/SampleNormalizedNodeSerializable.java

Change-Id: I896ea34d6cad7167669f5d9f1be7cb1307a9b9e0

4 years agoClean up public entrypoints 19/85419/6
Robert Varga [Mon, 28 Oct 2019 20:58:58 +0000 (21:58 +0100)]
Clean up public entrypoints

This API is centered around NormalizedNodeStreamVersion, which
defines versions supported by this artifact. An enum cannot really
be rehosted in an API-friendly way, which really makes it an
API entrypoint. Embrace that, eliminating NormalizedNodeInputOutput,
which acted in the same way.

JIRA: YANGTOOLS-1035
Change-Id: I8878bf6df3348981eb9165380844374885176ab1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoHide QNameFactory 18/85418/5
Robert Varga [Mon, 28 Oct 2019 20:10:30 +0000 (21:10 +0100)]
Hide QNameFactory

This cache is an implementation, hide it and remove the deprecated
cache.

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