yangtools.git
4 years agoPush out YangInstanceIdentifier FIXMEs 09/88709/2
Robert Varga [Thu, 26 Mar 2020 12:48:32 +0000 (13:48 +0100)]
Push out YangInstanceIdentifier FIXMEs

These ideas need to be moved out to next major release.

Change-Id: Ia6406c70623652b4fb6371da9c8155cd0878f0f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove SchemaPath FIXMEs 08/88708/2
Robert Varga [Thu, 26 Mar 2020 12:43:57 +0000 (13:43 +0100)]
Remove SchemaPath FIXMEs

We actually do not want to use SchemaPath relative/absolute classes,
as we want to get rid of SchemaPath. The use cases related to the
FIXMEs here are already covered by SchemaNodeIdentifier, which is
being used as appropriate.

Change-Id: I6257df419ab9a2fbdb2cbbf88b9593a6b01a4712
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate newDataInputWithoutValidation() for removal 07/88707/2
Robert Varga [Thu, 26 Mar 2020 12:42:46 +0000 (13:42 +0100)]
Deprecate newDataInputWithoutValidation() for removal

This is a mighty historic hack, which should no longer be used,
as it delays stream validation to some unknown future access.

Change-Id: I49d02b77bb09b059fe641e83216ae111eecdee18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove FIXME marker 06/88706/2
Robert Varga [Thu, 26 Mar 2020 12:40:10 +0000 (13:40 +0100)]
Remove FIXME marker

We really want get away from Serializable due to the constraints
and inefficiencies it brings. Remove a FIXME which would see us
proliferate Serializable.

Change-Id: I009084aaedbdad23fa5d6a9dc6f2ff22485f2b8a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake SchemaNode.getPath() implementations as deprecated 04/88704/1
Robert Varga [Thu, 26 Mar 2020 12:29:49 +0000 (13:29 +0100)]
Make SchemaNode.getPath() implementations as deprecated

Implementations and other overrides could end up hiding the fact
getPath() is deprecated. Make sure all known implementations
are marked deprecated.

JIRA: YANGTOOLS-1069
Change-Id: I34c27e8b0985b89dc4eefeb5a053cf88d2624217
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd SchemaInferenceStack 98/88098/13
Robert Varga [Thu, 27 Feb 2020 13:17:42 +0000 (14:17 +0100)]
Add SchemaInferenceStack

Migrating away from use of SchemaPath requires us to introduce a
concept which can be used to transfer inference state across functional
blocks.

SchemaInferenceStack is precisely such a concept. It is inherently
attacked to an EffectiveModelContext and can be manipulated by users
to reflect traversal through EffectiveStatements. The statements can
be pushed and popped based on application decisions, but the stack
always retains information as to how we got to a particular statement.

This provides superior accuracy when compared to SchemaPath-driven
operation, which is ambiguous around groupings. It also allows
efficient transfer of this state for the purposes of further inference
-- for example to perform static analysis of a leaf-ref type.

JIRA: YANGTOOLS-1086
Change-Id: Id50a2daac0af6c5944b4bb2ef29734f7efb5315b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFixup AbstractDeclaredEffectiveStatement 94/88694/1
Robert Varga [Thu, 26 Mar 2020 09:43:27 +0000 (10:43 +0100)]
Fixup AbstractDeclaredEffectiveStatement

Nullable annotation here conflicts with the change made in
interface specification. Clean that up.

JIRA: YANGTOOLS-908
Change-Id: If1397a98d756c879eec3f7f8eed97c071113ead5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate SchemaNode.getPath() 49/86949/6
Robert Varga [Wed, 15 Jan 2020 20:52:49 +0000 (21:52 +0100)]
Deprecate SchemaNode.getPath()

SchemaNode.getPath() has the problem of not being exact enough
and affecting scaling. Deprecate it so that we can find users
and offer replacement strategies.

JIRA: YANGTOOLS-1069
Change-Id: I2587abcc3dfb0c3c1f01d9208b5b1d0c99813346
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove @Nullable annotation 88/88488/6
Robert Varga [Wed, 18 Mar 2020 13:07:21 +0000 (14:07 +0100)]
Remove @Nullable annotation

ModelStatement.argument()'s return is causing quite a bit of grief
with static analysis. Remove the annotation, as its currently unused
anyway. In future we will make sure concretizations end up
constraining <A> to @NonNull type.

JIRA: YANGTOOLS-908
Change-Id: Id1771de902866b5925d9b7e9ea0177ac676d14c1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 7.0.0 68/88668/2
Robert Varga [Wed, 25 Mar 2020 08:07:33 +0000 (09:07 +0100)]
Bump odlparent to 7.0.0

Do not rely on snapshots, use the released version.

Change-Id: Ic2b15184c32691ffe443a84b488c80e625e146c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove StackedReversePathArguments.haveSize 93/88493/3
Robert Varga [Wed, 18 Mar 2020 13:38:43 +0000 (14:38 +0100)]
Remove StackedReversePathArguments.haveSize

We do not need to have a separate field here, as the size cannot
legally be here 0 -- as stacking guarantees we have at least one
parent.

Change-Id: Id319d4ef05efc1c3691b7b97b6b188cc09701547
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate JAXB API reference 53/88653/1
Robert Varga [Tue, 24 Mar 2020 16:24:45 +0000 (17:24 +0100)]
Migrate JAXB API reference

odlparent-7 is using Jakarta-sourced jaxb-api, adjust to that.

Change-Id: I6b4875f86b81d8ce74de34cceb1676f3d6c578e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSeparate out UnmodifiedRootDataTreeCandidateNode 76/88476/2
Robert Varga [Wed, 18 Mar 2020 10:39:42 +0000 (11:39 +0100)]
Separate out UnmodifiedRootDataTreeCandidateNode

In case we have an unmodified root we can freely reuse a single
object for all such DataTreeCandidates. Move the anonymous
implementation to its standalone class and expose the single object.

Change-Id: Iabc8358684c96c129e374c8dd491b0d8a29874a9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImprove StmtContextUtils nullness handling 99/88499/6
Robert Varga [Wed, 18 Mar 2020 14:48:28 +0000 (15:48 +0100)]
Improve StmtContextUtils nullness handling

Improve null handling by using coerceParentContext() and storing
its result -- making it clear to static analysis tools that a null
cannot be coming here.

Change-Id: Iac5dc93e0e7d7dc6f41595bde972f744a2d86ec2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse coerceStatementArgument() in AbstractQNameStatementSupport 98/88498/6
Robert Varga [Wed, 18 Mar 2020 14:46:37 +0000 (15:46 +0100)]
Use coerceStatementArgument() in AbstractQNameStatementSupport

We really mean to enforce non-null here, make sure to use the proper
method to do that.

Change-Id: I8736c07c7945c5b3657d470c65440f51ec823931
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix buildType() nullness 95/88495/5
Robert Varga [Wed, 18 Mar 2020 14:22:25 +0000 (15:22 +0100)]
Fix buildType() nullness

We have a slight inconsistency here, as we are peeling buildType()
implementation, without also propagaing @NonNull. Fix that up.

Change-Id: I7b2e79f28f02bc81a8d06a101ef3e4bd34b9848b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix StackedYangInstanceIdentifier.getParent() nullness 92/88492/5
Robert Varga [Wed, 18 Mar 2020 13:32:40 +0000 (14:32 +0100)]
Fix StackedYangInstanceIdentifier.getParent() nullness

Stacked version always has a parent, as well as the argument, make
sure we reflect that in annotations.

Change-Id: If0f391920fd77bb718fdb7170b3e0792e1c28c7b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRequire JDT annotations transitively 89/88489/3
Robert Varga [Wed, 18 Mar 2020 13:19:03 +0000 (14:19 +0100)]
Require JDT annotations transitively

We are using these in return values and generally in APIs, make sure
we require them transitively.

Change-Id: I78756188922fe8956d373ad98089c886e241b9e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDocument SingletonSet 87/88487/2
Robert Varga [Wed, 18 Mar 2020 13:06:33 +0000 (14:06 +0100)]
Document SingletonSet

This fixes an inappropriate @Nullable annotation and adds a bit of
javadoc.

Change-Id: I480b2d2d8bc8cdd663cbc3cbba4c0953657868f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd DataTreeCandidateInputOutput 74/88474/3
Robert Varga [Wed, 18 Mar 2020 10:27:54 +0000 (11:27 +0100)]
Add DataTreeCandidateInputOutput

DataTreeCandidate is a yangtools concept, which is commonly
serialized by users of DataTree. Make sure we support its serialization
in the binary stream -- importing the implementation from controller
as of e66759266dc43d5f58b2837aca5047b42c205e4a.

Change-Id: I5d63a3f9b1ced38e762ce0a74fb3fd820d67614a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 7.0.0-SNAPSHOT 28/88228/3
Robert Varga [Tue, 3 Mar 2020 20:36:59 +0000 (21:36 +0100)]
Bump odlparent to 7.0.0-SNAPSHOT

This picks up upgraded odlparent, notably for pre-installed SCR.

Change-Id: Ia09fd208833dc022aaa23834569f334910f9e8fa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix immutables.org reference 30/88230/1
Robert Varga [Tue, 3 Mar 2020 20:50:31 +0000 (21:50 +0100)]
Fix immutables.org reference

We should be using just annotations here, not the entire
processor.

Change-Id: If4d2e577ff08e46c9fde41d576759edf4590270b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpdate ExceptionMapper documentation 29/88229/1
Robert Varga [Tue, 3 Mar 2020 20:49:26 +0000 (21:49 +0100)]
Update ExceptionMapper documentation

Do not link Futures.makeChecked(), as that is going away. Also
reformat the documentation to be more readable.

Change-Id: I67042feba8ac407b9a1f31f875e0284327637fc1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFilter registered listeners 56/88156/1
Robert Varga [Sat, 29 Feb 2020 11:18:28 +0000 (12:18 +0100)]
Filter registered listeners

There is a small race window where the registration could be marked
as unregistered and not removed from the map. Check that condition
before letting the listener through.

Change-Id: I1938e6459faaaadf69bc7907ba6ba71e65fe9e8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd AbstractRegistration.notClosed() 55/88155/1
Robert Varga [Sat, 29 Feb 2020 11:17:07 +0000 (12:17 +0100)]
Add AbstractRegistration.notClosed()

This is a utility method useful for stream integration.

Change-Id: I6408cc25a1a10f010fc4f42ee83d50db31ca8bfa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDo not instantiate a Consumer for registration 54/88154/1
Robert Varga [Sat, 29 Feb 2020 10:51:34 +0000 (11:51 +0100)]
Do not instantiate a Consumer for registration

Taking a Consumer forces us to instantiate it to capture listeners
Set. We can do the same by simply moving the reference away. For
safety we only get a Collection<?>, for which remove(Object) is just
what we want.

Change-Id: I4f3bd473a75dabee1d1a31e10cf0fefe57c4896b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove ListenerRegistry.getRegistrations() 53/88153/1
Robert Varga [Sat, 29 Feb 2020 10:44:17 +0000 (11:44 +0100)]
Remove ListenerRegistry.getRegistrations()

Disconnect the class from Collection API, so that its footprint
is reduced. It also makes it clear that registrations are just
a pass-through API.

Change-Id: I7a301dfa636376fba464b396680e2600bbf3951b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd ListenerRegistry.clear() 52/88152/1
Robert Varga [Sat, 29 Feb 2020 10:30:28 +0000 (11:30 +0100)]
Add ListenerRegistry.clear()

There are callers who mean to only clear the registry for which
they are accessing the public view. Provide a method to do that
and mark getRegistrations() as deprecated.

Change-Id: I73b18443c505e7c7cea7efec627cc87196793d46
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix @NonNull module-info reference 51/88151/1
Robert Varga [Sat, 29 Feb 2020 10:29:33 +0000 (11:29 +0100)]
Fix @NonNull module-info reference

We are using JDT annotations in API components, hence we need to
propagate them as transitive.

Change-Id: Idec142340d833aa7629d560cd0a234dfd28e24b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImprove SchemaNodeIdentifier.toString() 15/88115/6
Robert Varga [Fri, 28 Feb 2020 06:37:48 +0000 (07:37 +0100)]
Improve SchemaNodeIdentifier.toString()

We typically have a number of node identifiers and they tend to
share the same namespace. Make toString() more human-friendly by
not emitting consecutive occurance of the same namespace.

JIRA: YANGTOOLS-1083
Change-Id: Ida0cba70a5eac0cfb7fb44fd20d6f5789f4923a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoQName namespace is always non-null 14/88114/1
Robert Varga [Fri, 28 Feb 2020 06:20:08 +0000 (07:20 +0100)]
QName namespace is always non-null

Simplify QName.toString() by realizing the namespace is guaranteed
to be non-null.

Change-Id: I06d2ab019fe9a9542e4ca3114235af6b6db42db1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd missing @NonNull annotations 97/88097/1
Robert Varga [Thu, 27 Feb 2020 12:28:06 +0000 (13:28 +0100)]
Add missing @NonNull annotations

SchemaNodeIdentifier's factory methods return non-null, add
annotations to that effect.

Change-Id: I5c9cbd87d87874727438e401d212d33ab678bb29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate NormalizedNode.findNode(SchemaPath) 89/88089/1
Robert Varga [Thu, 27 Feb 2020 08:38:28 +0000 (09:38 +0100)]
Deprecate NormalizedNode.findNode(SchemaPath)

SchemaNodeIdentifier serves essentially the same purpose, with the
added benefit of being reliable. Deprecate the old method.

Change-Id: I1c0dffb25f8e728bfe95250c6bb4bdae5af86839
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove yangtools.yang.data.api.schema.xpath 88/88088/1
Robert Varga [Thu, 27 Feb 2020 08:35:44 +0000 (09:35 +0100)]
Move yangtools.yang.data.api.schema.xpath

This API is implemented only as a preview and it relies on
SchemaPaths for identification. Move it into its sole experimental
implementation.

Change-Id: I236843ff47e00272a7d5d9c3b913bbb60d63f948
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove DataNodeIterator 87/88087/2
Robert Varga [Thu, 27 Feb 2020 08:32:19 +0000 (09:32 +0100)]
Remove DataNodeIterator

This utility is superfluous as we have a more general/efficient
ways of achieving the same result. Remove it and migrate the tests
to test generic infra.

Change-Id: I16bd9b8b6f86e64da3c45e6f0441e97f951fb7cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAugment effective statements can vary in argument 35/88035/1
Robert Varga [Tue, 25 Feb 2020 10:54:39 +0000 (11:54 +0100)]
Augment effective statements can vary in argument

Augment is serving dual purposes, either as a top-levle statement
or embedded in uses statement. The latter means the argument can
vary across instantiations and we therefore need to take that into
account.

JIRA: YANGTOOLS-1065
Change-Id: Ib7ac9870876f477c5c1c1b3da3d73c2bc1d34781
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd YangTextSchemaContextResolver factory method 16/88016/1
Robert Varga [Sun, 23 Feb 2020 19:55:50 +0000 (20:55 +0100)]
Add YangTextSchemaContextResolver factory method

We also need a factory method which takes YangParserFactory, so
users do not end up calling down to default ServiceLoader if they
can provide a proper factory.

JIRA: YANGTOOLS-1085
Change-Id: Ic7b15ad22798e678c73a309a6405ac2486bb5021
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoConvert ConstantArrayCollectionTest to use assertThrows() 02/88002/1
Robert Varga [Sat, 22 Feb 2020 10:11:28 +0000 (11:11 +0100)]
Convert ConstantArrayCollectionTest to use assertThrows()

This reduces verbosity of the test.

Change-Id: I31a3dc7850c5286faba5335cff04ec67ee646cbd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoInject YangParserFactory into SharedSchemaRepository 01/88001/2
Robert Varga [Sat, 22 Feb 2020 08:21:14 +0000 (09:21 +0100)]
Inject YangParserFactory into SharedSchemaRepository

Attempting to access defaultReactor() in OSGi environment trips up
the inability to load XPath parser -- as that only works in single
classloader. Force users to add parser reference, so that we can
go through the proper API.

JIRA: YANGTOOLS-1085
Change-Id: I9c1632f07c782234fd00b6f12a9a497d514557cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove yang-data-impl activator 45/87945/3
Robert Varga [Fri, 21 Feb 2020 15:32:58 +0000 (16:32 +0100)]
Remove yang-data-impl activator

Use declarative services, so that we can lose a class and make things
consistent with other services we provide.

JIRA: YANGTOOLS-1085
Change-Id: I6d5f6dc8ac7cba47b8f01e7ca1af668cacd13dbf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRequire XPath parser implementation in RFC7950 reactors 40/87940/7
Robert Varga [Thu, 20 Feb 2020 13:52:28 +0000 (14:52 +0100)]
Require XPath parser implementation in RFC7950 reactors

XPath parser is now considered full production ready and our system
needs to process XPaths at compile-time.

Flip to requiring a parser instance for all RFC7950-based reactors,
supplied by ServiceLoader when used in static contexts.

JIRA: YANGTOOLS-1085
Change-Id: I32f12d7285bc25c522606cd51f04312ac41a287f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd FIXMEs 44/87944/2
Robert Varga [Fri, 21 Feb 2020 15:28:54 +0000 (16:28 +0100)]
Add FIXMEs

Change-Id: I8332bc4ca4d82343a5dec0e69cd870724324fdec
JIRA: YANGTOOLS-1074
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd inject annotations 22/87922/1
Robert Varga [Thu, 20 Feb 2020 07:45:15 +0000 (08:45 +0100)]
Add inject annotations

Add @Singleton to activation factories, so that they get
recognized by DI frameworks.

Change-Id: Ic7955fc712946a1477512416c84ac2c97e6ae5ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd SchemaNodeIdentifier-based lookup in NormalizedNodes 09/87809/3
Robert Varga [Mon, 17 Feb 2020 12:16:33 +0000 (13:16 +0100)]
Add SchemaNodeIdentifier-based lookup in NormalizedNodes

SchemaPath is ugly and does not really work, add an alternative
which works on well-defined SchemaNodeIdentifier.Descendant.

JIRA: YANGTOOLS-1083
Change-Id: I4ce5ccd6cebaecbc7620aebf226c9d68f1112a85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse SchemaNodeIdentifier in AugmentationSchemaNode 07/87807/7
Robert Varga [Mon, 17 Feb 2020 11:53:12 +0000 (12:53 +0100)]
Use SchemaNodeIdentifier in AugmentationSchemaNode

We do not want to use SchemaPath here, as the statement can only
target schema tree residents, not the generalized indeterminism
of SchemaPath.

JIRA: YANGTOOLS-1084
Change-Id: I882690ab9741ce5a09a38606e27ac0ad6673002f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoTeach yang-data-codec-binfmt about SchemaNodeIdentifiers 08/87808/4
Robert Varga [Mon, 17 Feb 2020 12:04:47 +0000 (13:04 +0100)]
Teach yang-data-codec-binfmt about SchemaNodeIdentifiers

SchemaNodeIdentifier is replacing SchemaPath in all contexts that
are being used with data entries. Make sure our users can deal
with them appropriately.

JIRA: YANGTOOLS-1083
Change-Id: I9e938ed81acfce0b5076e79e4019054ef3000bff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUsesNode should expose GroupingDefinition directly 93/87793/4
Robert Varga [Sun, 16 Feb 2020 13:00:50 +0000 (14:00 +0100)]
UsesNode should expose GroupingDefinition directly

There is no point in playing tricks here -- just return the source
definition instead of requiring users to look it up.

JIRA: YANGTOOLS-1084
Change-Id: I1247b363c721e5868a33c2dd9ed356a2188c75a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake sure refines are declaration-ordered 06/87806/1
Robert Varga [Mon, 17 Feb 2020 11:42:21 +0000 (12:42 +0100)]
Make sure refines are declaration-ordered

Our current way of constructing the map is not predictable, as we
it depends on JVM specifics. Make sure the map retains declaration
order.

Change-Id: Ie451e2e8bdbbdd5f5ae444502bc4b291876567b8
JIRA: YANGTOOLS-1084
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse absolute schema node identifier in Deviation.getTargetPath() 05/87805/2
Robert Varga [Mon, 17 Feb 2020 11:34:12 +0000 (12:34 +0100)]
Use absolute schema node identifier in Deviation.getTargetPath()

This changes the return value so that it maps directly to argument,
removing a source of SchemaPaths from our APIs.

JIRA: YANGTOOLS-1084
Change-Id: I1718e763558f7ef54fab15f39159c069db7e80b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse SchemaNodeIdentifier.Descendant to map refined nodes 00/87800/7
Robert Varga [Sun, 16 Feb 2020 21:35:39 +0000 (22:35 +0100)]
Use SchemaNodeIdentifier.Descendant to map refined nodes

SchemaPath is completely ambiguous here, whereas we really want to
say 'Descendant' here -- that captures correctly how the path should
be interpreted.

JIRA: YANGTOOLS-1084
Change-Id: I5b6d9b75184dec419831ca7451de35e43812ea2b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeviationStatement should use absolute SchemaNodeIdentifier 98/87798/8
Robert Varga [Sun, 16 Feb 2020 16:30:24 +0000 (17:30 +0100)]
DeviationStatement should use absolute SchemaNodeIdentifier

The spec is clear on this one -- we should capture the fact that
'deviation' always has an absolute path as its argument.

JIRA: YANGTOOLS-1083
Change-Id: Iff758465eee7fb568515773e7a067d54d20eb142
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRefineStatement should operate on SchemaNodeIdentifier.Descendant 97/87797/8
Robert Varga [Sun, 16 Feb 2020 16:23:29 +0000 (17:23 +0100)]
RefineStatement should operate on SchemaNodeIdentifier.Descendant

The spec is clear, this has to be a descendant, make sure we reflect
that in the API.

JIRA: YANGTOOLS-1083
Change-Id: Icab418a7e5f8ff2c9f0e3b6e2640a3b87010538a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoKeyStatement is defined in terms of Set<QName> 96/87796/6
Robert Varga [Sun, 16 Feb 2020 16:14:12 +0000 (17:14 +0100)]
KeyStatement is defined in terms of Set<QName>

SchemaNodeIdentifier would be appropriate here only if it were
allowed, which it is not and we dance around the class anyway.

Fix the interface definition and ditch a chunk of unneeded code.

JIRA: YANGTOOLS-1083
Change-Id: Ie20c05bc379f5534716ee9a8558c57a3600e1ac1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFixup SchemaNodeIdentifier design 95/87795/7
Robert Varga [Sun, 16 Feb 2020 14:33:56 +0000 (15:33 +0100)]
Fixup SchemaNodeIdentifier design

There are a number of errors with regard to how SchemaNodeIdentifier
interacts with its non-existent users. Clean these up as well as
the overall implementation interactions.

JIRA: YANGTOOLS-1083
Change-Id: I616efbad3a2d54df5ecbfa656b3a843e852c187a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix SchemaNodeIdentifier parlance 94/87794/4
Robert Varga [Sun, 16 Feb 2020 14:29:21 +0000 (15:29 +0100)]
Fix SchemaNodeIdentifier parlance

There is no 'relative' schema node identifier, there is only a
'descendant' schema node identifier.

JIRA: YANGTOOLS-1083
Change-Id: Ief5fe0140daee2d126e40ac52cb1d560f3d968aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd common code patterns docs 20/87720/2
Robert Varga [Sat, 15 Feb 2020 00:09:03 +0000 (01:09 +0100)]
Add common code patterns docs

This is just a basic brain dump, needs to be cleaned up.

Change-Id: Id45b947824eeaa91e659e747adef6479c2dd4a2c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoOptimize AbstractResumedStatement.buildDeclared() 23/87723/1
Robert Varga [Sat, 15 Feb 2020 02:25:40 +0000 (03:25 +0100)]
Optimize AbstractResumedStatement.buildDeclared()

Optimize bytecode size of buildDeclared() by off-loading actual
work to loadDeclared(). Improves inlining and improves tracing
visibility -- which shows that the cache has about 90% cach hit
rate.

Change-Id: If09d417ab5257bf6651b94da2506695a6ced0104
JIRA: YANGTOOLS-652
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoTrim buildEffective() bytecode 19/87719/2
Robert Varga [Fri, 14 Feb 2020 22:55:40 +0000 (23:55 +0100)]
Trim buildEffective() bytecode

This method is hot as hell, let's make sure it's also as small as
possible to aid inlining.

Change-Id: I0540a7efac1037cabb49190eb55da9ad022bc9d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSplit onPhaseCompleted() 18/87718/1
Robert Varga [Fri, 14 Feb 2020 22:54:08 +0000 (23:54 +0100)]
Split onPhaseCompleted()

This is a hot method, hence we want to aid inlining as much as
possible. Profiling is also helped by separating callback logic
into a separate method.

JIRA: YANGTOOLS-652
Change-Id: I1ab80b50db131879326b3ae1de7e4746ede92071
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDo not try to finish already completed phase 08/87708/5
Robert Varga [Fri, 14 Feb 2020 10:49:36 +0000 (11:49 +0100)]
Do not try to finish already completed phase

Profiling shows that completion of substatement phases is the most
expensive operation we are performing. This stems from the fact
that inference is reactive and eager -- hence at we can attempt
to complete a particular phase against a statement multiple times.

Each time we will end up also walking all children (and their
children), attempting to complete the phase -- even when a particular
child has already successfully completed it.

This exposes a slight issue in our logic, as we have always assumed
child statements need to go through all the phases with us -- which
has not been true due to 'typedef' statements reuse, which would
end up being churned through phase complete (but always end with
EFFECTIVE_MODEL completed).

Fix both issues by checking whether the statement has executed
requested (or a subsequent) phase before going into actual phase
execution. This also requires that any substatements added to
a statement transition to the parent's completed phase before they
are made visible -- otherwise we could could end up with a statement
tree whose root has completed EFFECTIVE_MODEL, but not all of its
substatements have, triggering state violation assertions.

JIRA: YANGTOOLS-1082
Change-Id: Id6ed0d7feefc6d838c055e9690db69ae26633d95
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEffectiveStatements track StatementContextBase 13/87713/1
Robert Varga [Fri, 14 Feb 2020 14:10:22 +0000 (15:10 +0100)]
EffectiveStatements track StatementContextBase

While StatementContextBase.effective is declared to hold Mutable
contexts, in reality it should only ever hold StatementContextBase
(or whatever is the lowest reactor base class).

Add explicit verification, allowing us to eliminate an instanceof
check in completeChildren().

JIRA: YANGTOOLS-1082
Change-Id: Ic25d056492dba49e2dd8042d3de9e79443369738
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSplit up tryToCompletePhase() 06/87706/3
Robert Varga [Fri, 14 Feb 2020 09:52:07 +0000 (10:52 +0100)]
Split up tryToCompletePhase()

This method is incredibly hot, split it up so that it is easier
to optimize as well as profile.

JIRA: YANGTOOLS-652
Change-Id: I3f87a00061c5f45f80364de3ba1a249beaa25b7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEliminate StatementMap.capacity() 86/87686/1
Robert Varga [Thu, 13 Feb 2020 20:30:22 +0000 (21:30 +0100)]
Eliminate StatementMap.capacity()

This method is not used anywhere, remove it.

JIRA: YANGTOOLS-652
Change-Id: Id53e5b8b9d9106b5b3201127a02f0e2d1523da2c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake StatementMap extend AbstractCollection 85/87685/1
Robert Varga [Thu, 13 Feb 2020 18:54:29 +0000 (19:54 +0100)]
Make StatementMap extend AbstractCollection

Creating proxies to access statements is not entirely efficient,
by making StatementMap directly provide Collection, we can side-step
that need.

JIRA: YANGTOOLS-652
Change-Id: Ib77fb0a910c950ffad3907810abe2c6e89878e27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSplit processStatement a bit more 76/87676/2
Robert Varga [Thu, 13 Feb 2020 16:18:29 +0000 (17:18 +0100)]
Split processStatement a bit more

Split out the slow path (of allocating a statement) into a separate
method, so that the main entrypoint is more easily inlineable.

JIRA: YANGTOOLS-652
Change-Id: Iccae60e336915e06d64731e3fe4aa278cba90996
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSplit StatementContextVisitor.processStatement() 66/87666/3
Robert Varga [Thu, 13 Feb 2020 10:38:30 +0000 (11:38 +0100)]
Split StatementContextVisitor.processStatement()

This method is needlessly large and directly-recursive. Split it
up into two methods, allowing both to be smaller.

JIRA: YANGTOOLS-652
Change-Id: Ie3aab06cf66e8423a03fab6debebde7efbfcb2c1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoHide SourceSpecificContext and make it final 71/87671/9
Robert Varga [Thu, 13 Feb 2020 12:27:40 +0000 (13:27 +0100)]
Hide SourceSpecificContext and make it final

This class is used only by the reactor, hide it from outside view
and make it explicitly final. Also remove methods forwarding to
BuildGlobalContext, as they have a single caller which can perform
the dispatch itself.

JIRA: YANGTOOLS-652
Change-Id: I9c6ef4eb599a9d703ec599fb1b76f175c5e8066c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove StatementWriter.{resume,store}Statement default implementations 69/87669/7
Robert Varga [Thu, 13 Feb 2020 12:17:37 +0000 (13:17 +0100)]
Remove StatementWriter.{resume,store}Statement default implementations

We have only a single implementation of this interface, let's require
implementations to supply these methods.

JIRA: YANGTOOLS-652
Change-Id: I891c3757d0eea6b8d87844e288b98fcc6dca65ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove SourceSpecificContext.lookupDeclaredChild() 70/87670/5
Robert Varga [Thu, 13 Feb 2020 12:24:57 +0000 (13:24 +0100)]
Move SourceSpecificContext.lookupDeclaredChild()

This method is only used from StatementContextWriter and it is
not touching any SourceSpecificContext state. Move it to its sole
caller as a private method returning a nullable.

JIRA: YANGTOOLS-652
Change-Id: Ib05581b2edcca213734748e31d17d0b7caeb9a92
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoTurn ArgumentContextUtils into an abstract class 56/87656/3
Robert Varga [Thu, 13 Feb 2020 02:54:28 +0000 (03:54 +0100)]
Turn ArgumentContextUtils into an abstract class

Having this as a non-enum is actually better, as we can defer
loading of version-specific subclasses as needed.

JIRA: YANGTOOLS-1079
Change-Id: Ie6024b9f551823cf8f3ac5b51d2563c0c816ab36
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSeparate out ArgumentContextUtils.normalizeDoubleQuoted() 55/87655/2
Robert Varga [Thu, 13 Feb 2020 00:31:42 +0000 (01:31 +0100)]
Separate out ArgumentContextUtils.normalizeDoubleQuoted()

appendString() is really just a lexer-to-logic dispatch method,
which we may end up moving. Even if not, it provides benefits
in being small and well auditable, as well as being readily
inlineable.

A nice side-effect here is that we get the control over both
whitespace and unescaping, which makes it obvious we can check
for existing escapes and then go into dealing with them, with
a known position of the first backslash.

JIRA: YANGTOOLS-1079
Change-Id: I157795634eb6caea10a819feb4a50fb9b394b267
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoOptimize ArgumentContext parsing 53/87653/5
Robert Varga [Wed, 12 Feb 2020 22:10:25 +0000 (23:10 +0100)]
Optimize ArgumentContext parsing

Looking for strings is overly-pessimistic, as it forces allocation
of an intermediate list -- which we do not need, as we really want
to just invoke our method on appropriate methods.

Furthermore IDENTIFIER tokens are much more common than STRING, so
we want to make the decision for the correct codepath without any
bias -- and a switch statement does exactly that.

On top of that IDENTIFIER tokens do not need any further processing,
we just short-circuit to returning the token string.

JIRA: YANGTOOLS-1079
Change-Id: Ia1bf7e39d35b16b2e68f4f132cd14d60ce89492e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRefactor ArgumentContextUtils 52/87652/2
Robert Varga [Wed, 12 Feb 2020 21:21:19 +0000 (22:21 +0100)]
Refactor ArgumentContextUtils

This is a static utility class, whose behavior depends on YANG
version. Refactor it into an enum, which expresses the differences
in terms of two separate subclasses, so that JIT can make the right
decisions.

Also mark spots for follow-up improvements.

JIRA: YANGTOOLS-1079
Change-Id: I1bc1dad7c0a313065d32174578ccbe941a9f3e3a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove StmtOrderingNamespace 43/87643/1
Robert Varga [Wed, 12 Feb 2020 18:06:49 +0000 (19:06 +0100)]
Remove StmtOrderingNamespace

This namespace is not really used anywhere, hence there is no point
in maintaining it.

JIRA: YANGTOOLS-652
Change-Id: I8c74a555218b55c59a8c3e301d2a20c53bbee63a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEnable SpotBugs enforcement in yang-validation-tool 41/87641/1
Robert Varga [Wed, 12 Feb 2020 17:59:43 +0000 (18:59 +0100)]
Enable SpotBugs enforcement in yang-validation-tool

There are just two issues reported, fix/suppress them and flip
enforcement on.

Change-Id: Id145facbd6da836108d8d938150e34462f9fde5e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEnable test for invalid leafrefs 40/87640/1
Robert Varga [Wed, 12 Feb 2020 17:53:24 +0000 (18:53 +0100)]
Enable test for invalid leafrefs

This refactors the ignored test to correctly assert what we are
doing and enables it.

Change-Id: I9be5ff3a7b419596ed3bc11dd4d05885c0927192
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEnable SpotBugs enforcement in yang-data-impl 39/87639/1
Robert Varga [Wed, 12 Feb 2020 17:45:08 +0000 (18:45 +0100)]
Enable SpotBugs enforcement in yang-data-impl

Fix up the few remaining issues reported and enable enforcement
so we do not regress.

Change-Id: I282c0905fea741cb2200e08e62bf2ba86353f0f3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDocument ModifiedNode.getValidatedNode() 38/87638/1
Robert Varga [Wed, 12 Feb 2020 17:35:53 +0000 (18:35 +0100)]
Document ModifiedNode.getValidatedNode()

This method is using unusual nullable-Optional return mechanics,
document it and add appropriate suppression.

Change-Id: I597f0cf29ff7094c11efda2bd0bca6179bc77f2f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEnable Bug6972Test 30/87630/1
Robert Varga [Wed, 12 Feb 2020 16:49:15 +0000 (17:49 +0100)]
Enable Bug6972Test

This is an ancient test to assert that unit statements share
the same instance. Enable it now that we have fixed underlying
issue.

JIRA: YANGTOOLS-694
Change-Id: Ifc88e2fc63cf0f2fc9b33459caf6980b3a1545ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCleanup AugmentArgumentParsingTest 29/87629/1
Robert Varga [Wed, 12 Feb 2020 16:45:28 +0000 (17:45 +0100)]
Cleanup AugmentArgumentParsingTest

Use assertThrows() and matchers to identify mismatch in behavior,
while also enabling previously-disabled tests.

Change-Id: I3098a4178db3e274757e2755cca450e760679942
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEnable spotbugs in yang-parser-rfc7950 81/86581/8
Robert Varga [Thu, 26 Dec 2019 13:13:12 +0000 (14:13 +0100)]
Enable spotbugs in yang-parser-rfc7950

This fixes up the final batch of problems reported by spotbugs
and flips enforcement on so we do not regress.

JIRA: YANGTOOLS-1056
Change-Id: Ib4a56e6ad766039482ca855c6fe4bc565434521d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix incorrect statement ordering in augment 28/87628/1
Robert Varga [Wed, 12 Feb 2020 16:22:41 +0000 (17:22 +0100)]
Fix incorrect statement ordering in augment

This is a day-0 bug pointed out by SpotBugs: the increment here is
ineffective, as the Integer is unboxed, incremented and the result
is thrown away -- leading to a dead store and incorrect operation.

Fix this by separating the variables, making it clear what is going
on.

Change-Id: I1393fcdf0e95394fd5a18cf8d843ce2f9e07f898
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix StmtContext nullness confusion 27/87627/1
Robert Varga [Wed, 12 Feb 2020 16:15:02 +0000 (17:15 +0100)]
Fix StmtContext nullness confusion

The API contract states that null is a valid return, but returned
value is tagged with @NonNull -- throwing off static analysis quite
a bit. Correct the annotation, making life easier.

Change-Id: I4c9cf79e99c6f3d59d5adfaadbbd8ce855a2c47d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove redundant interface 23/87623/1
Robert Varga [Wed, 12 Feb 2020 15:49:06 +0000 (16:49 +0100)]
Remove redundant interface

SpotBugs correctly points out our use of redundant interfaces,
fix that up.

JIRA: YANGTOOLS-1056
Change-Id: I081b07fe2430384c15c8952a2cb77639a6eea458
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake ChildSchemaNodeNamespace operate on StmtContext only 22/87622/1
Robert Varga [Wed, 12 Feb 2020 15:46:40 +0000 (16:46 +0100)]
Make ChildSchemaNodeNamespace operate on StmtContext only

SpotBugs is pointing out an unconfirmed cast, which we really do not
need as we can operate on StmtContexts without having to go through
Mutable.

JIRA: YANGTOOLS-1056
Change-Id: I340f950621dbab23dbd1b3ea8d58675b744517d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake BitsTypeDefinition.Bit only a DocumentedNode.WithStatus 70/86970/8
Robert Varga [Wed, 15 Jan 2020 22:11:11 +0000 (23:11 +0100)]
Make BitsTypeDefinition.Bit only a DocumentedNode.WithStatus

The concept that a bit is a SchemaNode directly contradicts RFC7950,
which does not list it as such. Yes, it does have a name that is
an identifier, but it really does not have a namespace.

Fix this issue, which ends up improving our memory footprint by quite
a bit.

JIRA: YANGTOOLS-1072
Change-Id: Id88e14743f9be43f7e4096728bf3715c38470e1a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCheck for existence of slash before trimming 92/86792/5
Robert Varga [Tue, 7 Jan 2020 16:29:45 +0000 (17:29 +0100)]
Check for existence of slash before trimming

Rather than creating multiple matchers for no good reason at all,
check if the string contains a backslash character before going
in and performing escaping.

JIRA: YANGTOOLS-652
Change-Id: I77fb02bad4ffb13a8393956c56b15ebe3e1dbf3f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd AbstractQName.bindTo(QNameModule) 54/86654/2
Robert Varga [Tue, 31 Dec 2019 17:19:02 +0000 (18:19 +0100)]
Add AbstractQName.bindTo(QNameModule)

Generalize the implementation, as all subclasses provide a variant
of this method.

Change-Id: I4a5f5654f1687a76a3c5f5a2976edae3a90e3245
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDo not cache path from root 83/87583/5
Robert Varga [Tue, 11 Feb 2020 14:09:49 +0000 (15:09 +0100)]
Do not cache path from root

Heap analysis shows that full 16% of SchemaContext memory is retained
by SchemaPath instances. We can reduce this by removing path caching,
so that each query to getPathFromRoot() results in a new collection.

This saves a pointer field in the structure, saving 8 bytes in typical
64bit JVM scenarios -- going from 32/48 to 24/40 bytes, saving 16-25%
instance size.

JIRA: YANGTOOLS-1076
Change-Id: I5613764c513b9b54473e2e587de2b8b38713ed15
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove SchemaPath.getPath() 84/87584/3
Robert Varga [Tue, 11 Feb 2020 14:29:07 +0000 (15:29 +0100)]
Remove SchemaPath.getPath()

SchemaPath.getPath() has been deprecated for quite some time,
remove it in favor of getPathFromRoot().

Change-Id: Ib70c428fe5e465269fa5a86503d2e645ee506d93
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse VarHandle to cache path in SchemaPath 81/87581/2
Robert Varga [Tue, 11 Feb 2020 12:44:27 +0000 (13:44 +0100)]
Use VarHandle to cache path in SchemaPath

VarHandles offer better ergonomics with their compare-and-exchange
mechanics, allowing us to predictably return the same computed
object without having to synchronize program order with other
entities.

JIRA: YANGTOOLS-652
Change-Id: Ie0e336a82eeb3c12672e0d9ffd305a03b5530d15
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate SchemaPath.getPath() for removal 82/87582/2
Robert Varga [Tue, 11 Feb 2020 13:41:02 +0000 (14:41 +0100)]
Deprecate SchemaPath.getPath() for removal

We do not really need this method anymore, mark it as deprecated.
Also migrate users, whose sole requirement is to have Collection.size()
available.

Change-Id: Ie86bbca934ac5f40a96fe280efdb65dc4124955c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRevert "Do not copy grouping/uses statements" 62/87562/1
Robert Varga [Tue, 11 Feb 2020 09:13:09 +0000 (10:13 +0100)]
Revert "Do not copy grouping/uses statements"

This reverts commit 12c5ce180b266521abfea9a5f3a4366c6d717f88, as
groupings/uses may actually be used during type origin inference.

JIRA: YANGTOOLS-652
Change-Id: I1ff59969da7faa4def0b3c9ebfc406839a3ebef9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRevert ChoiceSchemaNode.getCases() to return a Collection 39/87539/7
Robert Varga [Mon, 10 Feb 2020 14:46:02 +0000 (15:46 +0100)]
Revert ChoiceSchemaNode.getCases() to return a Collection

Using a full map is wasteful here, as we can reuse schema tree
lookups and perform filtering.

JIRA: YANGTOOLS-652
Change-Id: I9ac6fe11731067cb2a3822e6f37cb17ea915c478
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDo not copy grouping/uses statements 63/87363/16
Robert Varga [Sun, 2 Feb 2020 20:02:29 +0000 (21:02 +0100)]
Do not copy grouping/uses statements

All of the effects of grouping/uses should be accounted for when
copying occurs and these statements cannot be otherwise targeted.

Make sure we ignore them during copy operations.

JIRA: YANGTOOLS-1078
Change-Id: I1f3d3fc25c43f29948f21d454330ed8a3ce6932f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 6.0.5 37/87537/2
Robert Varga [Mon, 10 Feb 2020 14:15:09 +0000 (15:15 +0100)]
Bump odlparent to 6.0.5

Pick up latest odlparent release.

Change-Id: Ie2df653789b4954163e37c21d25ae690934884b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove IdentitySchemaNode.getDerivedIdentities() 50/87450/4
Robert Varga [Mon, 10 Feb 2020 12:02:12 +0000 (13:02 +0100)]
Remove IdentitySchemaNode.getDerivedIdentities()

IdentitySchemaNode.getDerivedIdentities() has the unfortunate
property of requiring circular references, which we need to take
care of using slight hacks.

This method is easily implemented in SchemaContext, where we can
index identities based on getBaseIdentities() and arrive at the
same functionality, except in a much lighter-weight mode.

JIRA: YANGTOOLS-652
Change-Id: Ie96d9622b1e53fec115d4fa5536f4fd4bdd4561f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove AbstractSchemaEffectiveDocumentedNode 01/87501/1
Robert Varga [Thu, 6 Feb 2020 17:45:04 +0000 (18:45 +0100)]
Remove AbstractSchemaEffectiveDocumentedNode

This class is not used anywhere, remove it.

JIRA: YANGTOOLS-652
Change-Id: I5f9e5b80bf62083e35933b48e18fa415f5d35800
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRender AbstractSchemaEffectiveDocumentedNode obsolete 00/87500/1
Robert Varga [Thu, 6 Feb 2020 17:43:20 +0000 (18:43 +0100)]
Render AbstractSchemaEffectiveDocumentedNode obsolete

This class serves no purpose, as all of its tenants have been
migrated away.

JIRA: YANGTOOLS-1065
Change-Id: I22920a91aa205bdec8f05a9979589a517a45190d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate schema/data tree-related methods 99/87499/2
Robert Varga [Thu, 6 Feb 2020 17:32:14 +0000 (18:32 +0100)]
Migrate schema/data tree-related methods

AbstractSchemaEffectiveDocumentedNode does not really have value
at this point. Migrate its methods to a superclass common to all
users.

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