yangtools.git
5 years agoRemove unneeded javax.annotation suppressions 40/81140/1
Robert Varga [Mon, 25 Mar 2019 08:52:26 +0000 (09:52 +0100)]
Remove unneeded javax.annotation suppressions

We are not pulling in JSR305 anymore, remove import suppressions.

Change-Id: Ibce8b30dab04e4c84d972e02f6b190ffd104a938
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump odlparent to 5.0.0 92/80892/23
Robert Varga [Fri, 15 Mar 2019 14:26:57 +0000 (15:26 +0100)]
Bump odlparent to 5.0.0

This integrates odlparent-5.0.0 and removes reliance on JSR305
annotations. Nullness annotations were migrated in previous patches,
this switches the remainder to Checker Framework annotations.

Change-Id: Ia59d13f424d68a0bd8e86c952db0f1926ad7efbc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate nullness annotations to JDT 39/81139/1
Robert Varga [Mon, 25 Mar 2019 08:20:44 +0000 (09:20 +0100)]
Migrate nullness annotations to JDT

This converts the remaining classes and interfaces to not use JSR305
nullness annotations.

JIRA: YANGTOOLS-907
Change-Id: I94ffa71649f45dac2b02dfb90b0524a39a897fd2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove @NotThreadSafe annotations 38/81138/2
Robert Varga [Mon, 25 Mar 2019 08:18:05 +0000 (09:18 +0100)]
Remove @NotThreadSafe annotations

Document classes as not-thread-safe in javadoc rather than using
JSR305 to do that.

Change-Id: I088869591a8f7a1c5eb67fe7e83685cd7823ab81
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoClean up StatementDefinition argument definition interface 43/81043/8
Robert Varga [Wed, 20 Mar 2019 15:08:28 +0000 (16:08 +0100)]
Clean up StatementDefinition argument definition interface

This makes it impossible for implementations to present a wrong
argument definition by encapsulating it in ArgumentDefinition.

To simplify implementations, an AbstractStatementDefinition class
is provided, which keeps the two components decomposed and creates
the definition on demand.

Change-Id: If941eb697ebfd53540da54074cba6018f4172452
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove @ThreadSafe annotation from AbstractCodecFactory 03/81103/2
Robert Varga [Thu, 21 Mar 2019 16:50:20 +0000 (17:50 +0100)]
Remove @ThreadSafe annotation from AbstractCodecFactory

Rather than using JSR305, document thread-safety in Javadoc, as it
is nuanced.

Change-Id: Iab25ee3919d6515a2b3d1ad3f31f178a7552a23a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove YangXPathParserFactory @ThreadSafe annotation 02/81102/2
Robert Varga [Thu, 21 Mar 2019 16:46:28 +0000 (17:46 +0100)]
Remove YangXPathParserFactory @ThreadSafe annotation

Replace JSR305 with explicit documentation of the fact we expect
implementations to be thread-safe.

Change-Id: If04d9b930f731387c794731261e745064048db0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove @ThreadSafe annotations from CodecCaches 01/81101/2
Robert Varga [Thu, 21 Mar 2019 16:42:50 +0000 (17:42 +0100)]
Remove @ThreadSafe annotations from CodecCaches

The documentation mentions these are thread-safe, there is no
point to keep JSR305 around.

Change-Id: Ide63bd3923ee61539e93fe6b259b0c00e736de7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove RecursiveObjectLeaker @ThreadSafe annotation 00/81100/2
Robert Varga [Thu, 21 Mar 2019 16:35:00 +0000 (17:35 +0100)]
Remove RecursiveObjectLeaker @ThreadSafe annotation

This is a utility class, which exposes only static methods, it is
naturally expected to be thread-safe. Remove JSR305 annotation and
fix Javadoc a bit.

Change-Id: Ie7afcef7b2339e308c7d1958141b539230aa3d85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove ListenerRegistry @ThreadSafe annotation 99/81099/2
Robert Varga [Thu, 21 Mar 2019 16:34:06 +0000 (17:34 +0100)]
Remove ListenerRegistry @ThreadSafe annotation

Rather than relying on JSR305, add a bit of javadocs and mention
the class is thread-safe.

Change-Id: I157e6873246b865be7dc00b7efa71d2923a80437
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoIntroduce UnqualifiedQName and QualifiedQName 58/81058/8
Robert Varga [Wed, 20 Mar 2019 22:15:16 +0000 (23:15 +0100)]
Introduce UnqualifiedQName and QualifiedQName

For the purposes of XPath expressions we need the concept of a future
node-identifier which is not bound to a concrete namespace (which
is already covered by QName).

This node identifier comes in two forms, qualified and unqualified,
each of which undergoes different namespace binding lifecycle.

This patch introduces AbstractQName, which serves as the base class
for all QName constructs and two separate classes UnqualifiedQName
and QualifiedQName, which have the ability to be be converted to
a full QName.

Note that due to Serializable contract, QName cannot be made a
subclass of AbstractQName. This fact is marked up for a future
API change.

Change-Id: I87242dcab93ecdd1050630fd4b3c320419ae10d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake QNameModule use externalizable proxy pattern 61/81061/2
Robert Varga [Thu, 21 Mar 2019 09:00:07 +0000 (10:00 +0100)]
Make QNameModule use externalizable proxy pattern

This disconnects the serialized form from the object itself,
allowing the two of them to evolve independently.

Change-Id: I5688c2c930282307f2cf5bf9ebd23295fb314c63
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake QName use externalizable proxy pattern 60/81060/2
Robert Varga [Thu, 21 Mar 2019 08:12:13 +0000 (09:12 +0100)]
Make QName use externalizable proxy pattern

This patch disconnects QName serialization layout from its class
hierarchy, allowing the two evolve separately.

Change-Id: I1be13e02ed4eec537cb86f86e009ba058687f153
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoShorten QName.toString() 63/81063/2
Robert Varga [Thu, 21 Mar 2019 09:11:35 +0000 (10:11 +0100)]
Shorten QName.toString()

Take advantage of fluent StringBuilder, removing a bit of bytecode.

Change-Id: I8d7c55b6118066529c2b62d8b48134affd58c1ea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSpeed up QName.intern() a bit 57/81057/1
Robert Varga [Wed, 20 Mar 2019 22:17:37 +0000 (23:17 +0100)]
Speed up QName.intern() a bit

In case we end up interning the localName, we should use the private
constructor to side-step re-validating localName.

Change-Id: I54029d15c93ae32f5c857e890c8313a9f62f58f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoExpose Relative/Absolute YangLocationPath 32/81032/2
Robert Varga [Wed, 20 Mar 2019 12:20:38 +0000 (13:20 +0100)]
Expose Relative/Absolute YangLocationPath

This patch exposes the two concretizations of YangLocationPath,
so they can be used for constructing type-safe APIs.

Change-Id: I9f0678141d7f6df668020531250a6a10fab67512
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix XPathExpr parsing 31/81031/2
Robert Varga [Wed, 20 Mar 2019 12:04:46 +0000 (13:04 +0100)]
Fix XPathExpr parsing

The parser mistakenly treated filter/path concatenation as a binary
expression, which lead to its inability to parse leafrefs, which
contain such a concatenation in predicates.

This fixes the parser to correctly use XPathExpr in this case.

Change-Id: Ica1ac3ee7d099273dccdf8565da2a69d9f11c046
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMerge location step shorthand handling 28/81028/1
Robert Varga [Wed, 20 Mar 2019 11:19:08 +0000 (12:19 +0100)]
Merge location step shorthand handling

This eliminates duplicate code by introducing parseStepShorthand()
and adjusting its two users to use it.

Change-Id: I0e4db3e9a7fd062e5085ce27f6ba6d21cf6cf668
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove descendant_schema_nodeid 24/81024/3
Robert Varga [Wed, 20 Mar 2019 09:22:59 +0000 (10:22 +0100)]
Remove descendant_schema_nodeid

This parser rule is never references and is unused in current
code base. Remove it.

JIRA: YANGTOOLS-969
Change-Id: I6c4bb47fed5d7081ddaf902208a19d9b924a5900
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup LeafRefPath{Lexer,Parser} 23/81023/3
Robert Varga [Wed, 20 Mar 2019 09:20:26 +0000 (10:20 +0100)]
Cleanup LeafRefPath{Lexer,Parser}

Drop CRLFs and remove a trailing space.

JIRA: YANGTOOLS-969
Change-Id: I24fabf164db72164e07bc3ea149e11e028ba91a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDefine PathExpression is a separate concept 22/81022/3
Robert Varga [Wed, 20 Mar 2019 09:17:00 +0000 (10:17 +0100)]
Define PathExpression is a separate concept

RevisionAwareXPath is not what leafref types are referencing, define
PathExpression which captures the proper semantic concept, which
is based on YangLocationPath.

JIRA: YANGTOOLS-969
Change-Id: I1f4a670d13a39ca60cda4771bb7ff46a90449bfe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEliminate unneeded YangLocationPath subclasses 20/81020/2
Robert Varga [Wed, 20 Mar 2019 07:59:22 +0000 (08:59 +0100)]
Eliminate unneeded YangLocationPath subclasses

*WithSteps subclasses are not that helpful, as we only have single
onjects which do not have steps. Integrate steps into YangLocationPath,
making it bimorphic (and its getSteps() method monomorphic).

Also clean up arguments/returns, so that we propagate only Immutable
collections.

Change-Id: Ie0cdd2fb558b0b51071fd49eded9bfa1f6e20b1b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd YangXPathAxis.asStep() methods without predicates 19/81019/1
Robert Varga [Wed, 20 Mar 2019 07:40:02 +0000 (08:40 +0100)]
Add YangXPathAxis.asStep() methods without predicates

In some contexts we know we do not not have any predicates, add
convenience functions for instantiating such steps.

Change-Id: I141053c041095add35590b6ff77440036450cb58
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove LeafRefValidatation 16/81016/1
Robert Varga [Tue, 19 Mar 2019 19:45:12 +0000 (20:45 +0100)]
Remove LeafRefValidatation

This is a misnomer, use LeafRefValidation instead.

Change-Id: I67f4d6b2226f7218aadbddc036e8205f47082105
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFixup xpath resolution 56/80956/2
Robert Varga [Mon, 18 Mar 2019 16:53:20 +0000 (17:53 +0100)]
Fixup xpath resolution

Add basic handling for method invocations, namely deref() and
interrupted '..' chains.

JIRA: YANGTOOLS-968
Change-Id: I9b99a5aa84039749fb04f1dca8420d41b24ba6e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd Automatic-Module-Name declarations 36/80936/1
Robert Varga [Sat, 16 Mar 2019 14:58:03 +0000 (15:58 +0100)]
Add Automatic-Module-Name declarations

Providing automatic module name allows downstreams to better
modularize their deployment with JDK9+. Provide this header
for all production artifacts.

Change-Id: I1dedaea93b7aea9df0ca17a9dad2bcc0ec7848af
JIRA: YANGTOOLS-933
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove checkstyle-logging 35/80935/1
Robert Varga [Sat, 16 Mar 2019 14:18:13 +0000 (15:18 +0100)]
Remove checkstyle-logging

Most of the checks performed by this plugin are covered by
jp.skypencil.findbugs.slf4j. Remove this plugin, as we are no
longer using it.

Change-Id: Id5f2ae3d8435fb987add358e042524a59313afbc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDeprecate preliminary XPath/NormalizedNode interfaces 34/80934/7
Robert Varga [Sat, 16 Mar 2019 00:26:22 +0000 (01:26 +0100)]
Deprecate preliminary XPath/NormalizedNode interfaces

We have our own XPath parser implementation, which allows introspection
into the content and allows further transformations.

The APIs in yang.data.api.schema.xpath assume the XPath parser and
evaluator are kept in the same artifact, which does not work well
with the need to parse XPaths in yang-model-api context and then
evaluating them either in yang-model-api context or in yang-data-api
context.

This patch deprecates those APIs and creates a staging artifact for
APIs which integrate with yang-xpath-api.

yang-data-jaxen is relegated to an experimental feature, pending its
update to the newly-defined APIs.

JIRA: YANGTOOLS-967
Change-Id: I661d50e7024fad3e3bc1f06d8650e506bc061fb7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPromote yang-xpath to stable features 19/80919/8
Robert Varga [Sat, 16 Mar 2019 00:26:22 +0000 (01:26 +0100)]
Promote yang-xpath to stable features

yang-xpath-* is ready to be promoted, this patch integrates
it into odl-yangtools-xpath and defined odl-yangtools-xpath-api

JIRA: YANGTOOLS-966
Change-Id: Iefc0343bbdd52892769422900465b7c6565fca47
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix HTML5 javadoc compliance 22/80922/8
Robert Varga [Sat, 16 Mar 2019 00:40:07 +0000 (01:40 +0100)]
Fix HTML5 javadoc compliance

We are using HTML4 tags for no good reason, migrate to better
concepts to improve compatibility.

Change-Id: I4f5bb01ed2bb163ba7775f36469c94f9b2cbfd89
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove @ThreadSafe annotations 21/80921/7
Robert Varga [Sat, 16 Mar 2019 00:36:24 +0000 (01:36 +0100)]
Remove @ThreadSafe annotations

This annotation is not needed in the following case:
- static methods are expected to be thread-safe
- package-private classes can be examined for safety
- Immutable interfaces imply thread safety

Change-Id: I0d27d061dc59149b606cd096e777d72361cd4aeb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoExtend Immutable contract 23/80923/6
Robert Varga [Sat, 16 Mar 2019 00:53:42 +0000 (01:53 +0100)]
Extend Immutable contract

Rather than using Immutable annotation, extend interface to implement
Immutable interface, which has equal connotations, but can be run-time
checked and implies thread-safety.

Change-Id: Ifc1cdbff50ba328eee7b2afbf85cee5bbe2623bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove object cache declaration 18/80918/1
Robert Varga [Sat, 16 Mar 2019 00:26:55 +0000 (01:26 +0100)]
Remove object cache declaration

object-cache has been removed in 2.1.0, remove its declaration.

Change-Id: I3aaad19fd21a306f32d4f2b661564df40ab3fa36
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoHook if-feature statements onto FeatureNamespace 39/80739/7
Robert Varga [Fri, 8 Mar 2019 17:10:07 +0000 (18:10 +0100)]
Hook if-feature statements onto FeatureNamespace

IfFeatureStatementSupport should perform a check against FeatureNamespace,
so that invalid feature references are properly caught and reported.

JIRA: YANGTOOLS-964
Change-Id: If9fe8da3235533a702a34ceac26d62d91acc03c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRedefine if-feature statement in terms IfFeatureExpr 37/80737/4
Robert Varga [Fri, 8 Mar 2019 16:41:39 +0000 (17:41 +0100)]
Redefine if-feature statement in terms IfFeatureExpr

Rather than anonymizing the argument to a Predicate, use our custom
model of if-feature-expr.

JIRA: YANGTOOLS-964
Change-Id: Iaa3371691853a0f56216041314c8abbe88970669
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDefine IfFeature via a specialized class 36/80736/4
Robert Varga [Fri, 8 Mar 2019 14:04:34 +0000 (15:04 +0100)]
Define IfFeature via a specialized class

This reworks the grammar to use less recursion, as we can use
wildcards to eagerly combine expressions like "foo || bar || baz"
into any(foo, bar, baz) rather than or(foo, or(bar, baz)).

In order to properly support this contract, we define IfFeatureExpr,
which we specialize, so that we do not need to lug an opaque
predicate tree.

JIRA: YANGTOOLS-964
Change-Id: I048c3ced9c074e340031ac53c1117ce881b0a78b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake sure we populate features 38/80738/3
Robert Varga [Fri, 8 Mar 2019 17:38:04 +0000 (18:38 +0100)]
Make sure we populate features

The way features work with EffeciveModules means features are not
populated into FeatureNamespace. In fact that namespace is not
activated at all.

Fix this up, so features can be cross-referenced with if-feature.

Change-Id: I73cb4e8cf648e5f8ef72edce00556e4e69ee908c
JIRA: YANGTOOLS-964
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake getIfFeaturePredicate() a default method 35/80735/1
Robert Varga [Fri, 8 Mar 2019 16:38:03 +0000 (17:38 +0100)]
Make getIfFeaturePredicate() a default method

This is just a reference to the argument, there is no point in
forcing implementations to deal with this.

Change-Id: I40cb0c349694f9fe9e224e4458fea2b2c05fa870
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDisconnect AnnotationEffectiveStatement and AnnotationSchemaNode 33/80733/2
Robert Varga [Fri, 8 Mar 2019 08:07:12 +0000 (09:07 +0100)]
Disconnect AnnotationEffectiveStatement and AnnotationSchemaNode

These interfaces should be independent, make sure this is the case.
Also update AnnotationStatement with common accessors.

Change-Id: Ib59c5f99a36ecb3cf30d5a77e4dd539bf6b92277
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd YANG Schema Mount parser support 30/80730/4
Robert Varga [Thu, 7 Mar 2019 19:18:21 +0000 (20:18 +0100)]
Add YANG Schema Mount parser support

This adds the necessary bits and pieces to properly support
mount-point extension in the parser.

JIRA: YANGTOOLS-965
Change-Id: I7ca1b6c8c961e3033dc8023089d9169573dc3c4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix AnnotationStatement definition 31/80731/1
Robert Varga [Thu, 7 Mar 2019 20:37:13 +0000 (21:37 +0100)]
Fix AnnotationStatement definition

Annotation argument is required to be identifiers, which means their
argument really binds as a QName to the defining module. Change the
definition to reflect this fact.

This forces the argument to be validated properly as well as making
it easier to use.

Change-Id: Idca53d98517ab3627b4b555386bed6a740c3e66d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd YangInstanceIdentifier.createReverse(Deque) 97/80697/3
Robert Varga [Wed, 6 Mar 2019 10:39:13 +0000 (11:39 +0100)]
Add YangInstanceIdentifier.createReverse(Deque)

There are use cases when we need to instantiate a YangInstanceIdentifier
and we have the components available in a stack (i.e. deque). We can
provide an optimized instantiator which will walk the stack in reverse
order, reducing the need for one invert operation.

This patch adds two methods, one operating on a Deque<PathArgument>
and one operating on Deque<Object> with an extractor function.

Change-Id: If2b05d62dcbfb5d37415a2ecb241c8265ceb1be6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEliminate ImmutableNormalizedNodeStreamWriter.getBuilders() 99/80699/2
Robert Varga [Wed, 6 Mar 2019 00:44:45 +0000 (01:44 +0100)]
Eliminate ImmutableNormalizedNodeStreamWriter.getBuilders()

The only caller is interested only in current container builder,
for which we already have a method.

Change-Id: I4ea7bc3d5dd6478b40ed1bd1c56b608650801a57
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate NormalizedMetadata(StreamWriter) design 89/80689/2
Robert Varga [Tue, 5 Mar 2019 15:13:38 +0000 (16:13 +0100)]
Update NormalizedMetadata(StreamWriter) design

While having a complete decomposition of metadata blocks would be
a nice design, it is not efficient for our current use:

- NormalizedMetadata has the block readily-available
- Both JSON and XML parsers fully assemble attributes before
  emitting them. Even if the implementation changes, both parsers
  can very easily assemble the full block, as XML encodes it just
  after the element and JSON uses dedicated objects.
- NETCONF edit-config processing requires metadata to be visible
  before it can decide how to process the node

This patch changes NormalizedMetadataStreamWriter have a single
metadata() event, which takes an ImmutableMap. This communicates
the intent quite clearly and allows for optimizations on both ends.

JIRA: YANGTOOLS-961
Change-Id: I638c78d5ab1d3a8b544ab53a84b872420b49d637
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd RFC7952 data model extensions 43/80643/29
Robert Varga [Thu, 28 Feb 2019 12:48:56 +0000 (13:48 +0100)]
Add RFC7952 data model extensions

RFC7952 has implications on NormalizedNodeStreamWriter, namely
the ability to emit metadata attached to NormalizedNodes.

This patch introduces the concept of NormalizedMetadata, which
is the metadata counterpart to NormalizedNode. It also defines
NormalizedMetadataStreamWriter as an extension of
NormalizedNodeStreamWriter and implements NormalizedMetadataWriter,
which piggy-backs a NormalizedMetadata structure on top of a
NormalizedNode structure, so that the two are emitted as a single
event stream.

JIRA: YANGTOOLS-961
Change-Id: I8f1a69361d18cf5f9c14185778cca7c2d6ebc4f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd AnnotationSchemaNodeAware interface 81/80681/5
Robert Varga [Tue, 5 Mar 2019 09:32:15 +0000 (10:32 +0100)]
Add AnnotationSchemaNodeAware interface

It seems that having annotations indexed at the SchemaContext level.
To support that, add AnnotationSchemaNodeAware interface and make it
trivially implemented by SimpleSchemaContext.

Also retrofit AnnotationSchemaNode.find(SchemaContext) to recognize
AnnotationSchemaNodeAware and defer to the index if its available.

JIRA: YANGTOOLS-960
Change-Id: I1f3cd68a8356b20bceb2d0d620992ade10649e5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Add NETCONF/RFC7952 compatibility" 82/80682/2
Robert Varga [Tue, 5 Mar 2019 10:01:15 +0000 (11:01 +0100)]
Revert "Add NETCONF/RFC7952 compatibility"

This reverts commit 0b86189513b25601ba12a4a38230017315914344, as
the relevant support needs to be provided by netconf project and
can be retrofitted via either decorating a SchemaContext, or
overriding the ietf-netconf.yang model.

JIRA: YANGTOOLS-961
Change-Id: I81d5a760703461fcc55b83b6caa95b69049299c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse ForwardingNormalizedNodeStreamWriter for QName tranformation 67/80667/7
Robert Varga [Mon, 4 Mar 2019 12:56:05 +0000 (13:56 +0100)]
Use ForwardingNormalizedNodeStreamWriter for QName tranformation

We have a utility forwarder, which can be used as a baseline, reducing
transformation complexity a bit. Also make sure we reuse identifiers
when they are not transformed.

Change-Id: Ife4025cd47145b4501ff9f6186f47503cfb2aa45
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRework NormalizedNodeStreamWriter 62/80662/16
Robert Varga [Fri, 1 Mar 2019 13:05:52 +0000 (14:05 +0100)]
Rework NormalizedNodeStreamWriter

This patch reworks NormalizedNodeStreamWriter to issue start/end
events for even simple nodes, allowing attributes to be seamlessly
integrated into open nodes.

This necessitates some updates to serializers, which need to track
these simple nodes and properly handle endNode() events.

JIRA: YANGTOOLS-497
Change-Id: I9aa0979b778f54ce77be365b3ad8ba6690138df2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix ForwardingNormalizedNodeStreamWriter 66/80666/1
Robert Varga [Mon, 4 Mar 2019 12:34:56 +0000 (13:34 +0100)]
Fix ForwardingNormalizedNodeStreamWriter

Forwarding objects should allow all methods to be overridden, fix
that.

Change-Id: Ibb57fa99880914ffd2aff62b67e9e20ecadd4696
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake NormalizedNodeStreamWriter extensible 45/80645/9
Robert Varga [Thu, 28 Feb 2019 14:54:24 +0000 (15:54 +0100)]
Make NormalizedNodeStreamWriter extensible

NormalizedNodeStreamWriter needs to cater to at least one extension,
which is metadata emission. Introduce
NormalizedNodeStreamWriterExtension and add a getExtensions() method,
which returns no extensions by default.

JIRA: YANGTOOLS-497
Change-Id: Iebe11b80c3199f6b37b46c85bd7362a764de4ed6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd NETCONF/RFC7952 compatibility 48/80648/5
Robert Varga [Thu, 28 Feb 2019 15:52:40 +0000 (16:52 +0100)]
Add NETCONF/RFC7952 compatibility

RFC6241 pre-dates RFC7952 and defines an attribute which should
be modeled as a metadata annotation.

For legacy reasons, we are carrying support for this attribute
in yang-data-api, which does not quite fit the semantic model
and requires special-casing.

Since ietf-netconf.yang does not define the metadata annotation,
which would make RFC7952 work seamlessly, we need to hack this
around a bit and make the correspoding schema definition available.

JIRA: YANGTOOLS-961
Change-Id: Ib6c98e9bb8a7c9ae8351b61522c3fbfdd943393c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix YangParserImpl streaming use 47/80647/2
Robert Varga [Thu, 28 Feb 2019 18:48:44 +0000 (19:48 +0100)]
Fix YangParserImpl streaming use

We should not be returning null, but "this", fix that.

Change-Id: I0683da43a4c1d0b30f8f7d0680be2aa17f4e05ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd ExtensibleObject interface 44/80644/3
Robert Varga [Thu, 28 Feb 2019 15:10:14 +0000 (16:10 +0100)]
Add ExtensibleObject interface

This adds the basic ExtensibleObject and ObjectExtension interfaces,
which can be reused to define extensible objects.

Unlike a full-blown implementation, these interfaces provide only
access interface, not a mechanism to perform actual state attachment.

The attachment mechanism will be defined in future, when the need
for it actually arises.

JIRA: YANGTOOLS-497
Change-Id: Ie390b6174b8909c87595dddc0d467858f36ef8bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove yang-model-immutable 33/80633/2
Robert Varga [Wed, 27 Feb 2019 15:47:52 +0000 (16:47 +0100)]
Remove yang-model-immutable

This is an unfinished component, remove it as it will need to be
reimplemented from scratch.

Change-Id: Ic55be7d3b66ea23d6a5363e1d6529542c394fb16
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRefactor yang-xpath-impl error handling 30/80630/3
Robert Varga [Wed, 27 Feb 2019 14:38:10 +0000 (15:38 +0100)]
Refactor yang-xpath-impl error handling

Separate out CapturingErrorListener and make sure we install it
in InstanceIdentifierParser.

Change-Id: I9313161708daa122854b423015bdbcffef369bda
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove generics from YangNumberExpr 26/80626/4
Robert Varga [Wed, 27 Feb 2019 14:22:23 +0000 (15:22 +0100)]
Remove generics from YangNumberExpr

Generics are only getting in the way with the class and its support,
remove them from interface classes and move them to
AbstractYangXPathMathSupport.

Change-Id: I81b69e88786db1ce014c4ee83b65c01da09fbdad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPropagate namespaceContext/mathSupport to FunctionSupport 23/80623/5
Robert Varga [Wed, 27 Feb 2019 12:50:00 +0000 (13:50 +0100)]
Propagate namespaceContext/mathSupport to FunctionSupport

A number of operations in Functions requires either mathSupport
or namespaceContext to work correctly. This patch makes sure it
is available.

Change-Id: Icdbf6eda25017f9c921d2009b52e1fa012d08033
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate yang-xpath-api design 19/80619/11
Robert Varga [Tue, 26 Feb 2019 21:14:28 +0000 (22:14 +0100)]
Update yang-xpath-api design

This is the first round of API design update, bringing the following
changes:
- MathMode is now a top-level enumeration
- YangXPathMathSupport is an API interface providing common functions
- Prefix resolution is done through YangNamespaceContext
- YangNaryExpr is final
- math-specific YangNumberExprs are hidden classes
- YangFunctionCallExpr.NoArgs is folded into YangFunctionCallExpr
- YangLiteralExpr is now final
- YangXPathExpression exposes MathMode
- Literal interpretation is lazy and works on subexpressions

Change-Id: Ie721678b5513dc088c1a267b98f38d9b0643cb33
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd ModuleNameNamespaceContext 22/80622/2
Robert Varga [Wed, 27 Feb 2019 11:17:48 +0000 (12:17 +0100)]
Add ModuleNameNamespaceContext

This adds a utility YangNamespaceContext, which maps QNameModules
to their corresponding module name as contained in a SchemaContext.

Change-Id: I3be6316d0e7c1f9f98439e3bca3b9b0d385f63bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd YangNamespaceContext 18/80618/6
Robert Varga [Wed, 27 Feb 2019 08:35:18 +0000 (09:35 +0100)]
Add YangNamespaceContext

We require prefix/QNameModule mapping in multiple contexts, some
of which are bound to a SchemaContext, some of which are bound to
a particular Module.

This patch adds a generalized YangNamespaceContext to serve in these
situations and provides a simple BiMap-based implementation.

Change-Id: I3d44a55ea3569532395b3acb9dc7dedba70c1f4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove ClassLoaderUtils.withClassLoader() 10/80610/2
Robert Varga [Tue, 26 Feb 2019 12:38:17 +0000 (13:38 +0100)]
Remove ClassLoaderUtils.withClassLoader()

These methods have disambiguated versions available and have been
deprecated. We now remove them.

Change-Id: I2f61c6ee56ace39a4597bf77bc348ff0ffc241b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove ClassLoaderUtils.construct() 09/80609/2
Robert Varga [Tue, 26 Feb 2019 12:37:21 +0000 (13:37 +0100)]
Remove ClassLoaderUtils.construct()

This is a useless utility method, which is not used anywhere,
remove it.

Change-Id: Ia3c5cc2a6f61de86bb1b5ebe8f834b4c947a2ad7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate RequireInstanceRestrictedTypeBuilder type bound 08/80608/2
Robert Varga [Tue, 26 Feb 2019 11:53:19 +0000 (12:53 +0100)]
Update RequireInstanceRestrictedTypeBuilder type bound

Builder is defined only on top of RequireInstanceRestrictedTypeDefinition
instances, express that in generic type constraint.

Change-Id: I9394d2bb67b58527b14df37cd839c174434b6583
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove SchemaTracker.create(SchemaContext) 07/80607/1
Robert Varga [Tue, 26 Feb 2019 11:49:11 +0000 (12:49 +0100)]
Remove SchemaTracker.create(SchemaContext)

This method is superfluous, as it is a special case of
SchemaTracker.create(DataNodeContainer). Remove it.

Change-Id: Ieb5cda64d1b3bb730a29f6536bf3b70deaf9d7b5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove CompatUtils.compatLeafType() 06/80606/1
Robert Varga [Tue, 26 Feb 2019 11:44:40 +0000 (12:44 +0100)]
Remove CompatUtils.compatLeafType()

This method is superseded by compatType(), which handles both
LeafSchemaNode and LeafListSchemaNode.

Change-Id: I9af0349211a1be6b0a4873b78d8859020514e874
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove deprecated SchemaContextFactory methods 94/80594/1
Robert Varga [Tue, 26 Feb 2019 10:21:25 +0000 (11:21 +0100)]
Remove deprecated SchemaContextFactory methods

Specification of StatementParserMode and supported features has been
moved to SchemaContextFactoryConfiguration, now remove deprecated
compatibility methods.

Change-Id: I6e3710c0791527a0ab930f879550b447e1dd1490
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove deprecated SchemaRepository.createSchemaContextFactory() 88/80588/7
Robert Varga [Mon, 25 Feb 2019 15:54:59 +0000 (16:54 +0100)]
Remove deprecated SchemaRepository.createSchemaContextFactory()

Filter-based createSchemaContextFactory() has been deprecated, remove
it in the next major release.

Change-Id: I3033670b833cf3f6d5c7fc21fed7921255d516c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unneeded build-helper-plugin 93/80593/1
Robert Varga [Tue, 26 Feb 2019 09:51:53 +0000 (10:51 +0100)]
Remove unneeded build-helper-plugin

yang-parser-impl does not include any antlr sources, hence we do
not need to helper plugin anymore.

Change-Id: I0b1439a24afae1cb0733846226161d5482adb67d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRefactor ListEntryNodeDataWithSchema 92/80592/3
Robert Varga [Mon, 25 Feb 2019 17:06:11 +0000 (18:06 +0100)]
Refactor ListEntryNodeDataWithSchema

This refactors ListEntryNodeDataWithSchema to contain to two
separate implementations, dealing with keyed and unkeyed lists
separately. Also retrofit AbstractNodeDataWithSchema to capture
SchemaNode type.

Change-Id: Id79e028866201fbf10871334f1fa3932d54c9f0f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove deprecated JsonParserStream methods 91/80591/1
Robert Varga [Mon, 25 Feb 2019 16:51:55 +0000 (17:51 +0100)]
Remove deprecated JsonParserStream methods

These methods have been deprecated for more than a year and have
better replacements, hence remove them.

Change-Id: I1ba83612ab1a5fc077c4fafaeb5e6b13dd5f1fbb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove deprecated JSONCodecFactory methods 89/80589/2
Robert Varga [Mon, 25 Feb 2019 16:01:07 +0000 (17:01 +0100)]
Remove deprecated JSONCodecFactory methods

These methods have been moved to JSONCodecFactorySupplier, remove
their deprecated definitions.

Change-Id: I78860c620155c80c02669e70b879ca30a75eb3a7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove deprecated yang.model.api.stmt constructs 90/80590/2
Robert Varga [Mon, 25 Feb 2019 16:10:06 +0000 (17:10 +0100)]
Remove deprecated yang.model.api.stmt constructs

This removes the various FooGroup and FooContainer interfaces,
inlining their definition in the corresponding declared statements.

Change-Id: I8a40fd8db97f5c424bad7d9250f8d8bb5459f7cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoQName is a YANG identifier 73/80573/8
Robert Varga [Mon, 25 Feb 2019 12:53:39 +0000 (13:53 +0100)]
QName is a YANG identifier

Move argument enforcement to QName, as it is required to conform
to YANG identifier.

JIRA: YANGTOOLS-862
Change-Id: Ia1a5adb6921831476872d14e1e5c6caffc2af2d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake ModuleEffectiveStatement.localQNameModule() mandatory 82/80582/3
Robert Varga [Mon, 25 Feb 2019 13:41:23 +0000 (14:41 +0100)]
Make ModuleEffectiveStatement.localQNameModule() mandatory

This removes an API design hack, so that we require localQNameModule()
to be implemented.

Change-Id: Ic152a358d2d3b4b758a41b09901a83e4d989ed61
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoHide ResourceYangTextSchemaSource 81/80581/3
Robert Varga [Mon, 25 Feb 2019 13:39:10 +0000 (14:39 +0100)]
Hide ResourceYangTextSchemaSource

Exposing a concrete subclass here makes the API design asymmetric,
because YinTestSchemaSource equivament is not exposed. Hide
ResourceYangTextSchemaSource.

Change-Id: I187a0c049cf885bdbc567ba20b55b4d278095198
JIRA: YANGTOOLS-849
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove RpcAsContainer 80/80580/3
Robert Varga [Mon, 25 Feb 2019 13:35:45 +0000 (14:35 +0100)]
Remove RpcAsContainer

This class is superseded by generalized OperationAsContainer, remove
it in this major release.

Change-Id: Icda0272fca7871e53134ef96cafbf185b148bf82
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDocument StoreTreeNode.getChild() nullness 79/80579/3
Robert Varga [Mon, 25 Feb 2019 13:34:14 +0000 (14:34 +0100)]
Document StoreTreeNode.getChild() nullness

Null is not a valid argument, document a NPE being thrown when
a null is encountered.

Change-Id: I5d51ec5800a0f34a3a04123508d72f1acbe22db7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove ImplicitParentAwareStatementSupport inheritence 78/80578/4
Robert Varga [Mon, 25 Feb 2019 13:31:09 +0000 (14:31 +0100)]
Remove ImplicitParentAwareStatementSupport inheritence

Not all StatementSupports are ImplicitParentAwareStatementSupport,
make it an opt-in feature.

Change-Id: I98a1f3ff55c2f023e0806914409b1b5aef50e5a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake NamespaceBehaviour.toString() final 77/80577/3
Robert Varga [Mon, 25 Feb 2019 13:27:06 +0000 (14:27 +0100)]
Make NamespaceBehaviour.toString() final

We are providing addToStringAttributes(), hence toString() should
be final to force consistency.

Change-Id: I40d9dbc355f257b2560c92c6f7a2145a311c8cfa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate Unique{Constraint,EffectiveStatetement,Statement} design 76/80576/3
Robert Varga [Mon, 25 Feb 2019 13:24:21 +0000 (14:24 +0100)]
Update Unique{Constraint,EffectiveStatetement,Statement} design

The argument to 'unique' is required to be a set of relative paths,
rather than a plain collection. Reflect that in the design of these
interfaces.

Change-Id: I3a870fdf16897cfff52b46bfde946869d501560b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDocument MutableTreeNode nullness assumptions 75/80575/3
Robert Varga [Mon, 25 Feb 2019 13:18:39 +0000 (14:18 +0100)]
Document MutableTreeNode nullness assumptions

This adds documentation specifying that a NPE is thrown when
a null argument is encountered.

Change-Id: Id830a1243964dea60e0ee4ecd2e209da4850816e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate ListenerRegistry design 74/80574/3
Robert Varga [Mon, 25 Feb 2019 13:08:49 +0000 (14:08 +0100)]
Update ListenerRegistry design

This addresses FIXMEs marked for 3.0.0 in ListenerRegistry,
including making it final.

Change-Id: I13939fe02fd6f086edc2c13b2f52b56980de9f80
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove RpcResultBuilderCompat 72/80572/3
Robert Varga [Mon, 25 Feb 2019 12:46:19 +0000 (13:46 +0100)]
Remove RpcResultBuilderCompat

This is an ABI compat class, remove it for next major release.

Change-Id: Id5054be7c4adfee26cd5358d167fc47376ef9149
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove javax.xml.parsers.ParserConfigurationException 71/80571/2
Robert Varga [Mon, 25 Feb 2019 12:43:25 +0000 (13:43 +0100)]
Remove javax.xml.parsers.ParserConfigurationException

We do not need to throw this exception, remove it.

Change-Id: I98e6d5ade172933b90ccca6f494e7019cb49d699
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd StatementMap.toString() 90/80390/1
Robert Varga [Tue, 19 Feb 2019 10:36:27 +0000 (11:36 +0100)]
Add StatementMap.toString()

This aids debugging by adding value content, making it easier
to read what is actually in the map.

Change-Id: Ibc4025b34ae2d1485462360069b5ce095c8bc222
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPrefer Immutable collections over Collections.emptyFoo() 37/80337/3
Robert Varga [Thu, 14 Feb 2019 16:47:37 +0000 (17:47 +0100)]
Prefer Immutable collections over Collections.emptyFoo()

Our immutable-checking logic works best on known classes, hence
we bias towards using ImmutableCollection-derived classes.

Change-Id: Ifdcfe3642f33b4ef050051b9cdbec74690740e37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix ImmutableUnkeyedListNodeBuilder.valueEquals() 36/80336/2
Robert Varga [Thu, 14 Feb 2019 16:40:47 +0000 (17:40 +0100)]
Fix ImmutableUnkeyedListNodeBuilder.valueEquals()

Returning an empty Set from getValue() means that if we ever
encountered two instances of this class in comparison, their values
would fail to compare, as valueEquals() expects a List.

Fix this by returning ImmutableList.of() and codify that in the
return value.

Change-Id: I4301f4161648ea391f2e0a1e712e3f87c6dca33c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDefang immutables.org 34/80334/1
Robert Varga [Thu, 14 Feb 2019 15:10:02 +0000 (16:10 +0100)]
Defang immutables.org

We do not want to leak annotations, so specify that in our style,
removing the need to suppress javax.annotation.

JIRA: YANGTOOLS-907
Change-Id: Ic363fc10e79336cd26274fb91d3791e3f8ba1334
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRefactor checkTouchApplicable() 08/80308/2
Robert Varga [Wed, 13 Feb 2019 11:52:14 +0000 (12:52 +0100)]
Refactor checkTouchApplicable()

We can remove direct overrides of checkTouchApplicable() by making
the method smarter in its checking of preconditions. Notably we
do not check TreeNode presence multiple times, but rather perform
a step-wise unpacking of state.

This has the benefit of having a clean place where we check if
automatic lifecycle is in effect and that happens only if the node
does not exist.

JIRA: YANGTOOLS-943
Change-Id: I72f4316c77d8f36efaf95209c36e898c9b4873cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd ModificationPath.toString() 07/80307/1
Robert Varga [Wed, 13 Feb 2019 11:32:37 +0000 (12:32 +0100)]
Add ModificationPath.toString()

While we use ModificationPath internally only, having a toString()
on it is useful for debugging.

Change-Id: I516ae9a02f8467e67209c32ead5c7ccdcc20e146
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove checkApplicable() overrides 98/80298/2
Robert Varga [Tue, 12 Feb 2019 19:44:45 +0000 (20:44 +0100)]
Remove checkApplicable() overrides

The only time we are overriding checkApplicable() is in the TOUCH
case, which can more easily be handled through applyTouch().

Refactor AbstractNodeContainerModificationStrategy to include
the utility bits from AutomaticLifecycleMixin and move the override.
This reduces the number of implementations of checkApplicable()
from 7 to 2, while increasing the number of implementations of
checkTouchApplicable() from 3 to 7.

JIRA: YANGTOOLS-943
Change-Id: Iaf198ba852ff88d8e6b570b7c88b01f1064bb3a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove DelegatingModificationApplyOperation 84/80284/1
Robert Varga [Tue, 12 Feb 2019 12:49:06 +0000 (13:49 +0100)]
Remove DelegatingModificationApplyOperation

MinMaxElementsValidation is the only subclass, hence merge the two
classes into one, making MinMaxElementsValidation type-safe through
use of the SchemaNode-generic of SchemaAwareApplyOperation.

Change-Id: I00700d2b45f4163072d8c4d4c364bd8047e5b430
JIRA: YANGTOOLS-955
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove AlwaysFailOperation 83/80283/1
Robert Varga [Tue, 12 Feb 2019 12:39:25 +0000 (13:39 +0100)]
Remove AlwaysFailOperation

AlwaysFailOperation guards the case when we do not have a schema
context, which is exceeding rare and there is exactly one place
where we can check for null to detect non-presence of an operation.

Remove this implementation along with
NonApplyDelegatedModificationApplyOperation, making
MinMaxElementsValidation the only delegating implementation.

JIRA: YANGTOOLS-955
Change-Id: Id70814eced80dd80948a1a5601287977fa77cf12
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoExpand DataTreeCandidatesTest 78/80278/1
Robert Varga [Fri, 8 Feb 2019 13:01:18 +0000 (14:01 +0100)]
Expand DataTreeCandidatesTest

This expands the test suite with some assertions around merge
operations turning into unmodified nodes.

Change-Id: I385848837d01d3adc242661ddc50dc9098cd4f34
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unneeded Iterator.remove() overrides 63/80263/1
Robert Varga [Mon, 11 Feb 2019 14:23:06 +0000 (15:23 +0100)]
Remove unneeded Iterator.remove() overrides

Java 8 has retrofitted remove() to be a default method which
throws UnsupportedOperationException. Take advantage of this and
remove some of our code.

Change-Id: Ie4e4ac4ef947d5d65a3f5b80c249c21c35909f92
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoExpand ImmutableNodes methods 61/80261/1
Robert Varga [Mon, 11 Feb 2019 11:24:48 +0000 (12:24 +0100)]
Expand ImmutableNodes methods

This performs an audit of the methods exposed as convenience
and makes sure QName-taking methods have their NodeIdentifier-taking
counterpart.

Change-Id: Iaea7e1da4f2b50b06c1af2f9204a85e0780c6a47
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup yang-data-impl nullness annotations 79/80179/4
Robert Varga [Wed, 6 Feb 2019 15:55:16 +0000 (16:55 +0100)]
Cleanup yang-data-impl nullness annotations

This migrates yang-data-impl to use JDT nullness annotations, expanding
use of @NonNull in return types.

JIRA: YANGTOOLS-907
Change-Id: I16869db150ce28a94df5f6e5b55b5cf0fa07c34c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCorrect mandatory leaf enforcement 54/80254/2
Robert Varga [Mon, 11 Feb 2019 10:46:17 +0000 (11:46 +0100)]
Correct mandatory leaf enforcement

Previous patch broke mandatory leaf enforcement on operational
data store. This patch fixes the logic to again apply this check.

Change-Id: I7b5d6ea05fea0b4df60c8cde9075168a3fa18e9c
JIRA: YANGTOOLS-947
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSchemaAwareApplyOperation has getSchema() 78/80178/1
Robert Varga [Wed, 6 Feb 2019 01:13:22 +0000 (02:13 +0100)]
SchemaAwareApplyOperation has getSchema()

Obviously, if an ModificationApplyOperation knows abouts its schema
it should expose it through getSchema(). This allows us to concentrate
fields a bit.

Change-Id: I9656b28dfb32fe7951e3ccd32b43eabe4427929f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>