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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
Robert Varga [Thu, 31 Oct 2019 15:54:23 +0000 (16:54 +0100)]
Instantiate yang-data-codec-binfmt
This instantiates the artifact to hold the incoming controller
code, removing superfluous imports.
JIRA: YANGTOOLS-1035
Change-Id: Ide2213d6f8a224df1e339a8efc405cc7783fe130
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Anil Belur [Thu, 31 Oct 2019 14:28:57 +0000 (19:58 +0530)]
Merge branch 'master' of ../controller
Change-Id: I3611c067a26521829ae9212e4be1ed44acbd7dd2
Robert Varga [Tue, 29 Oct 2019 21:44:25 +0000 (22:44 +0100)]
Add static ArgumentUtils XPath integration
YANG parser needs to interpret when/must expressions so that they
can be used by downstreams in their effective view.
We add static binding of rfc7950.stmt to an implementation of
YangXPathParserFactory. This makes it clear we do not need to
actually store URIs to make things useful, hence we deprecate
URIStringToImportPrefix namespace.
JIRA: YANGTOOLS-966
Change-Id: Iaf771ad5e0bcdd058fe537ed67d5c9e4e6556e81
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 30 Oct 2019 20:21:10 +0000 (21:21 +0100)]
Add YangXPathExpression.getYangVersion()
Retrofit awareness of features contained in a particular expression,
so that runtime can properly evaluate them.
Also update parser to intercept RuntimeExceptions and turn them into
checked XPathExpressionExceptions.
JIRA: YANGTOOLS-1036
Change-Id: I7beab757d6f8fa45f9064a77b6c20f2076903b8e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 30 Oct 2019 13:44:56 +0000 (14:44 +0100)]
Expose minimum YANG version for YangFunction
Not all YangFunctions are available when we are operating in RFC6020
mode. This patch exposes the minimum YANG version from YangFunction,
so it can be checked at runtime.
JIRA: YANGTOOLS-1036
Change-Id: Ieedd58202dd14be9da7cd079c5180e92450c9e5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 22 Oct 2019 20:41:21 +0000 (22:41 +0200)]
Add a FIXME guide to YANGTOOLS-784
This just drops some clarification into code as I am in the area.
This needs to be cleaned up when the issue is addressed.
JIRA: YANGTOOLS-784
Change-Id: I988c43731480a399d6d8faa71fb00fa1acaa8d7e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 22 Oct 2019 20:20:00 +0000 (22:20 +0200)]
Reinstate "Check for nested augmentations"
This reverts commit
02fa7531709e3c4599bc9ec23dc605a21a711bc1, effectively
re-applying
759e69d85991edb987a760165adb83fa3f2ab67b.
We also add the mechanics needed to walk the copy history backwards, as
needed to understand the copy process.
JIRA: YANGTOOLS-956
Change-Id: I96b3afb30fdcd326ef9b780ff02ccc7f1c94e07e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
serngawy [Tue, 15 Oct 2019 20:00:59 +0000 (16:00 -0400)]
Add lenient JsonParserStream
It is beneficial to have the JSON parser ignore unknown constructs,
so that all other data gets parsed successfully.
This patch adds JsonParserStream.createLenient() to return such
parsers.
JIRA: YANGTOOLS-1034
Change-Id: I5ec9dbbf6dc52270bf83d7c4ed6c4d16181f74a7
Signed-off-by: serngawy <m.elserngawy@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
50ba8458e9b8eb48cd47ecf8d0a0f6fb1d83d812)
(cherry picked from commit
be62b4e0494ae2b551373760c4da1b03ff19df83)
Robert Varga [Sat, 19 Oct 2019 07:05:46 +0000 (09:05 +0200)]
Add OperationAsContainer @NonNull annotations
This makes working with the class easier a bit.
Change-Id: Ica69b5517b5feb9a55c20dbb9fe465ad9081ba23
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 20 Oct 2019 08:24:59 +0000 (10:24 +0200)]
Bump versions to 4.0.3-SNAPSHOT
This starts the next development iteration.
Change-Id: Idf713e64dae9a78c043aefa8d5075386d6be4672
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 17 Oct 2019 22:40:25 +0000 (00:40 +0200)]
Bump odlparent to 6.0.1
This bumps odlparent to 6.0.1, picking up latest updates.
Change-Id: Ib0ee6b87c716e436c3cc009eba07022feebd3d3c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 18 Oct 2019 08:22:27 +0000 (10:22 +0200)]
Fix foldable trigraphs
Sonar correctly points out the expression can be simplified, this
patch does exactly that.
Change-Id: I0ea51d18d551be0f4bd416d7b18da3eb543e0244
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 18 Oct 2019 08:02:28 +0000 (10:02 +0200)]
Cleanup code smells reported by sonar
We are duplicating code here, so introduce a check-and-cast method
and use that from the 5 callsites.
Change-Id: Ic1b734f62cb2d79b8dd28a1fcee76cbffea72c33
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 14 Oct 2019 08:16:02 +0000 (10:16 +0200)]
Use careful byte-masking/shifting in Mg Input
We really want to operate on byte and not int, the bytes are to
be treated as unsigned, which gets wrecked by sign extension.
Introduce an explicit mask(byte, byte) method and use it where
we are potentially sign-extending.
JIRA: CONTROLLER-1919
Change-Id: I0484f440c1589859fb268947f5a80a2b4969451e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 14 Oct 2019 08:16:02 +0000 (10:16 +0200)]
Use careful byte-masking/shifting in Mg Input
We really want to operate on byte and not int, the bytes are to
be treated as unsigned, which gets wrecked by sign extension.
Introduce an explicit mask(byte, byte) method and use it where
we are potentially sign-extending.
JIRA: CONTROLLER-1919
Change-Id: I0484f440c1589859fb268947f5a80a2b4969451e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 13 Oct 2019 08:40:36 +0000 (10:40 +0200)]
Add utility converters
This adds toUint{8,16,32,64} methods to ease conversion between
Uint types.
JIRA: YANGTOOLS-1033
Change-Id: I010a9103e2115e7808aa7d04ea9a5b41ab12ddd6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 13 Oct 2019 08:33:56 +0000 (10:33 +0200)]
Add Uint constants
This adds TWO/TEN constants to all Uint types as well some more
javadocs.
JIRA: YANGTOOLS-1032
Change-Id: I66cce018e99fdbf4c4824415fe23f112f7e6ab53
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 1 Oct 2019 17:05:29 +0000 (19:05 +0200)]
Deprecate old MD-SAL APIs for removal
These APIs are slated for removal in Aluminium, make sure our
warning is more stern.
JIRA: CONTROLLER-1917
Change-Id: Ib4f7dcfd5183b87dd10b9ce2b773a59a548892c9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 11 Oct 2019 12:01:15 +0000 (14:01 +0200)]
Disable slf4j SSL link
slf4j does not provide apidocs over TLS, link HTTP site instead.
Change-Id: I2158c043a2d9e810a329587159fc6af9d57d8e56
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 10 Oct 2019 12:05:49 +0000 (14:05 +0200)]
Remove CheckedFuture from RemoteSchemaProvider
The API contract we are implementing is defined in terms of
ListenableFuture, hence we can drop the use of CheckedFuture.
Change-Id: I9d99b2e42c3995c4c11b44e595a81a93b2b31b7e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 10 Oct 2019 10:36:57 +0000 (12:36 +0200)]
Add type-bound equals() to common int types
This adds additional Object.equals() flavors to bind to smaller methods
when the objects are known to be of matching types (but still nullable).
JIRA: YANGTOOLS-1030
Change-Id: I4c750e135069692682ba65b21503345fc682051a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 10 Oct 2019 10:29:23 +0000 (12:29 +0200)]
Fix Decimal64.equals()
There is a typo here, which would end up not comparing objects
properly.
Change-Id: I5cfe31887b109bbe7be6e564078f250ea6b61747
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 20 Aug 2019 14:37:51 +0000 (16:37 +0200)]
Bump yangtools to 4.0.1
This bumps yangtools to 4.0.1 as part of Magnesium MRI.
Change-Id: I1ac7d3f856af310f4e8015875223d30eac3a8276
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>