yangtools.git
3 months agoRefactor binding-dom-adapter
Robert Varga [Sun, 12 Apr 2020 11:35:02 +0000 (13:35 +0200)]
Refactor binding-dom-adapter

BindingNormalizedNodeCodecRegistry is a serializer which allows
dynamic updates to its backing codec. Rather than referencing this
implementation, reference either BindingNormalizedNodeSerializer
(interface) or BindingCodecContext, which is the simple implentation.

This makes it obvious we are not using BindingNormalizedNodeCodecRegistry
in the context of mdsal-binding-dom-codec at all, making it a good
candidate to move to mdsal-binding-dom-adapter. Except we do not want
to just move it, but refactor so that it is properly controlled.

Change-Id: I2be67ed78ac89da5c5b5ec7322d03e769d2826c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoImprove verification message
Robert Varga [Sat, 11 Apr 2020 02:46:48 +0000 (04:46 +0200)]
Improve verification message

Since we have the class identity available, let's use it to diagnoze
failures to supply a proper resource name.

Change-Id: I9b159e9ca8c16565b8e63b82637696ea90a42bc6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoFix mdsal-binding-dom-codec exports
Robert Varga [Sat, 11 Apr 2020 01:40:47 +0000 (03:40 +0200)]
Fix mdsal-binding-dom-codec exports

We only need the .impl package exported, as we do not want to
embed our -api artifact, as that just wrecks source code lookups.

Change-Id: I9c85c7ba0e121c0497cd17e0fcfdc2b7133ddfc8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoAdd more error context to ResourceYangModuleInfo
Robert Varga [Thu, 9 Apr 2020 17:55:32 +0000 (19:55 +0200)]
Add more error context to ResourceYangModuleInfo

In case we end up failing to load a resource, log the subclass
and potentially the ClassLoader where the problem occured.

Change-Id: Id5cbe9875734d0c8f185d7cbbd8cc2cd3f09ee3f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump byte-buddy to 1.10.9
Robert Varga [Tue, 7 Apr 2020 09:52:49 +0000 (11:52 +0200)]
Bump byte-buddy to 1.10.9

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.8
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.9

Change-Id: I6dd7ef731fefd5de334b268f23c9a24bf5ae0a41
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoAdd a simple Binding query language
Robert Varga [Fri, 20 Mar 2020 16:22:09 +0000 (17:22 +0100)]
Add a simple Binding query language

Offloading some amount of data matching towards the storage engine
can give use two-fold improvement:

1) skip instantiation of Binding DTOs, as the query can be realized
   in terms of DOM matches
2) potentially skip transfer of large amount of data

For Binding layer we want to have something type-safe, where we are
in control of the flow the language.

This provides a first cut at the structure, which may end up being
further evolved.

Change-Id: Ica52158c889c0df9a6004227c0b64092590f67af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSimplify empty checking
Robert Varga [Wed, 25 Mar 2020 14:34:22 +0000 (15:34 +0100)]
Simplify empty checking

Use a simple negation instead of an equality check -- not that it
makes much difference in generated code.

Change-Id: If7c73a3884544c5acb5590b8154df712d4af2c55
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRefactor "value" property access
Robert Varga [Tue, 24 Mar 2020 15:15:19 +0000 (16:15 +0100)]
Refactor "value" property access

There are a number of callers open-coding the way to acquire 'value'
property. Centralize them.

JIRA: MDSAL-530
Change-Id: I6fdf17b204c7f491eb667747a68d6d80daf55b78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoAdd ScalarTypeObject
Robert Varga [Tue, 24 Mar 2020 13:55:09 +0000 (14:55 +0100)]
Add ScalarTypeObject

TypeObjects are used for encapsulated values, which expose a getValue()
method, which is guaranteed to be non-null and can have additional
validation implied.

JIRA: MDSAL-530
Change-Id: I3ec4a5b4d7e04ff0c220144c9d1796fb44b2a80b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoFix import order
Robert Varga [Wed, 25 Mar 2020 11:35:13 +0000 (12:35 +0100)]
Fix import order

xtend plugin does not automatically order imports, fix a misorder.

Change-Id: I099bbe07debe6a37b1f94fd6f39ec42d6d87f917
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoJavaFileTemplate.findProperty() should be static
Robert Varga [Tue, 24 Mar 2020 14:15:11 +0000 (15:15 +0100)]
JavaFileTemplate.findProperty() should be static

This method does not touch any local state -- hence it is truly
a static utility that can be moved to a properly-bound state.

Change-Id: Iad3b70d129e758a24aaa0558a1549728f529f236
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRefactor OSGi ModuleInfoSnapshot/BindingRuntimeContext
Robert Varga [Mon, 2 Mar 2020 07:18:31 +0000 (08:18 +0100)]
Refactor OSGi ModuleInfoSnapshot/BindingRuntimeContext

All components acting on EffectiveModel should end up reacting
to new generation by publishing components based on it before
tearing down the previous instance.

Refactor lifecycle by introducing this into both mdsal-dom-schema-osgi
and mdsal-binding-runtime-osgi -- providing the infrastructure for
mdsal-binding-dom-codec doing the same.

This leads to mdsal-binding-dom-codec-osgi to provide atomic updates
of BindingDOMCodecServices (and its constituent services), hence we
no longer want binding-dom-adapter to publish
BindingNormalizedNodeSerializer from its internal service.

JIRA: MDSAL-525
Change-Id: Ia6757b3db8068d585638bd8e2d3d17aaadb08955
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoFix YANG snippet escaping
Robert Varga [Mon, 2 Mar 2020 12:58:50 +0000 (13:58 +0100)]
Fix YANG snippet escaping

This is the non-javadoc path for module generation, where we are
failing to escape potential unicode references. Add the proper
callout and also optimize it to be a faster no-op when not
applicable, properly documenting what is going on.

JIRA: MDSAL-529
Change-Id: Ib21ed4f15555d49aaa7eb3dac61043c4b2e90451
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoCentralize BindingCodecContext services
Robert Varga [Sun, 1 Mar 2020 18:46:28 +0000 (19:46 +0100)]
Centralize BindingCodecContext services

BindingCodecContext provides an immutable class providing a number
of services. It really should provide all services, so that
downstreams can make a proper decision around lifecycle.

We do not want to expose BindingCodecContext itself, as it provides
other, implementation-internal, services -- hence create
BindingDOMCodecServices to hold the interface specification.

Missing methods come from BindingNormalizedNodeSerializer, which
can perhaps be re-formulated externally, but including it here
makes this more obvious for BindingNormalizedNodeCodecRegistry.

JIRA: MDSAL-825
Change-Id: I2a37f9c36b25bf4ef43c76bf81a170edfe75b60c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump odlparent to 7.0.0-SNAPSHOT
Robert Varga [Wed, 4 Mar 2020 12:14:43 +0000 (13:14 +0100)]
Bump odlparent to 7.0.0-SNAPSHOT

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

Change-Id: Icaab7aaab204e0959dc6606d319f947779040688
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBindingCodecContext implements BindingNormalizedNodeWriterFactory
Robert Varga [Sun, 1 Mar 2020 13:34:45 +0000 (14:34 +0100)]
BindingCodecContext implements BindingNormalizedNodeWriterFactory

There is slight confusion between BindingCodecContext and
BindingNormalizedNodeCodecRegistry -- the registry implements this
interface and uses internal methods with exact signatures for most
of them. There's a few methods missing, leading to confusion as to
what is what.

Move the two methods and make BindingCodecContext be the Immutable
reference implementation. This also shows that we have a lifecycle
issue, where we can end up reading codecContext twice.

Fix that race by properly encapsulating state before referring to
the (now static) common method. This has the nice side-effect of
removing state capture of 'this', leading to the indirection lambda
being stateless.

JIRA: MDSAL-825
Change-Id: I81e26ad6865c48035b64d1973bae1bb396d584f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoMove AbstractLazyActionContainerNode to SPI
Robert Varga [Sun, 1 Mar 2020 12:22:00 +0000 (13:22 +0100)]
Move AbstractLazyActionContainerNode to SPI

While this is an implementation detail, it can be shared between
implementations quite reasonably. Pull it out of
binding-dom-codec-impl.

JIRA: MDSAL-825
Change-Id: I21b79bee5b73583a406d17665dfd9aff1376c3c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoUpdate BindingInstanceIdentifierCodec documentation
Robert Varga [Sun, 1 Mar 2020 12:05:40 +0000 (13:05 +0100)]
Update BindingInstanceIdentifierCodec documentation

Document IllegalArgumentException being thrown and add FIXMEs.

Change-Id: I44e8a8c86b2dd180dc09f23a8a930b23f01b3c75
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoReduce BindingNormalizedNodeCodecRegistry proliferation
Robert Varga [Sat, 29 Feb 2020 15:36:35 +0000 (16:36 +0100)]
Reduce BindingNormalizedNodeCodecRegistry proliferation

Most functional blocks require only a
BindingNormalizedNodeSerializer implementation, not the concrete
implementation. This allows us to disconnect component lifecycle
from BindingCodecContext updates without relying on magic class.

BindingNormalizedNodeCodecRegistry provides a globally updated
holder for these implementations, so that they end up refreshing
their codec based on latest global state.

A follow-up patch will introduce an explicit component, which can
be used in these contexts.

JIRA: MDSAL-525
Change-Id: I6938e23e30656b9dbc960bd6b2ca17c068b67b35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoAdd type parameter documentation
Robert Varga [Sat, 29 Feb 2020 15:16:49 +0000 (16:16 +0100)]
Add type parameter documentation

'C' here is undocumented, add at least a single line.

Change-Id: I06f4471983c0ea1fcbff49f45f6e263661030db4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoExpose BindingInstanceIdentifierCodec from BindingCodecTree
Robert Varga [Sat, 29 Feb 2020 14:38:05 +0000 (15:38 +0100)]
Expose BindingInstanceIdentifierCodec from BindingCodecTree

This codec is in similar class as IdentityCodec -- make sure it is
available to users.

JIRA: MDSAL-522
JIRA: MDSAL-525
Change-Id: I08371dfbbb264991d6d5840838c0736b35921b8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoHide BindingCodecContext methods
Robert Varga [Fri, 28 Feb 2020 17:29:10 +0000 (18:29 +0100)]
Hide BindingCodecContext methods

BindingCodecContext is package-private, so should be its methods.

Change-Id: Ic371d8f63597d0e00f0287903be81cf3e5e49e45
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoMake OSGiModuleInfoSnapshot generation unsigned
Robert Varga [Fri, 28 Feb 2020 15:02:58 +0000 (16:02 +0100)]
Make OSGiModuleInfoSnapshot generation unsigned

The intent is to have this an unsigned counter, expose it as such.

JIRA: MDSAL-392
Change-Id: I7d240933ae35288be0ba6a5f8a047587ab179803
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoDo not expose DataObjectSerializerRegistry outside of codec
Robert Varga [Fri, 28 Feb 2020 14:25:18 +0000 (15:25 +0100)]
Do not expose DataObjectSerializerRegistry outside of codec

BindingNormalizedNodeCodecRegistry should not implement this
interface directly, as it is only used internally.

Change-Id: I02956b6ae399eabb27634a2048c837f05f6ab3ea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRework binding component instantiation
Robert Varga [Mon, 24 Feb 2020 11:40:56 +0000 (12:40 +0100)]
Rework binding component instantiation

This reshuffles how DOM and Binding interoperate where schema is
concerned. Since Binding requires Classloader information available
at scanning time, we refactor mdsal-dom-schema-service-osgi to
actually perform Binding-aware scanning, so that this information
is available in ModuleInfoSnapshot.

These are published as OSGiModuleInfoSnapshot along with generation
number for easier reference by a new component, OSGiModelRuntime.

DOMSchemaService is realized on top of ServiceRegistry, where it
listens for OSGiModelRuntime and for SchemaContextListeners, driving
an OSGi whiteboard pattern.

This renders mdsal-binding-dom-codec-osgi completely superfluous,
as there is not enough magic going on to justify it.

mdsal-binding-runtime-osgi is also hooked onto OSGiModuleInfoSnapshot,
providing BindingRuntimeContexts as needed and retaining generation
inforation.

JIRA: MDSAL-392
Change-Id: I083caf3abbc3d7e2212d1df14e45d2745096b5f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBindingReflections.getModuleInfo() returns @NonNull
Robert Varga [Thu, 27 Feb 2020 15:38:47 +0000 (16:38 +0100)]
BindingReflections.getModuleInfo() returns @NonNull

A null return here would be an API violation, make sure we catch
these in BindingReflections and do not bother users with potential
nulls.

Change-Id: I1670a46d1de4aeac0730538822157ec6ae216011
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoUntangle BindingCodecContext/BindingNormalizedNodeCodecRegistry
Robert Varga [Tue, 25 Feb 2020 11:15:01 +0000 (12:15 +0100)]
Untangle BindingCodecContext/BindingNormalizedNodeCodecRegistry

The relationship here should be clear -- a BindingCodecContext is
self-contained and should not be subject to dynamism. The registry
maintains a 'current' codec.

Achieving this is very simple -- just do not perform upcalls to
Registry when we are looking for a streamer, it would just loop
back to BindingCodecContext and we want to be consistent, i.e. do
not try to upcall to a different BindingCodecContext.

JIRA: MDSAL-392
Change-Id: I720738f122ba89974e32c91ed8c7f3a059c21690
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSplit off DefaultBindingCodecTreeFactory
Robert Varga [Tue, 25 Feb 2020 11:07:34 +0000 (12:07 +0100)]
Split off DefaultBindingCodecTreeFactory

BindingCodecTreeFactory is a simple interface which should be backed
by a simple implementation, rather than munging it with the codec
itself. Split it out of BindingNormalizedNodeCodecRegistry and back
it by the corresponding context.

JIRA: MDSAL-392
Change-Id: I1c35d39ab1b7d3b40a6cc3eacd69d3677306c081
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoUse only BundleContext in BindingClassLoadingStrategy
Robert Varga [Mon, 24 Feb 2020 12:23:16 +0000 (13:23 +0100)]
Use only BundleContext in BindingClassLoadingStrategy

OSGi DS allows us to inject BundleContext directly, do not bother
with ComponentContext.

JIRA: MDSAL-392
Change-Id: I679d981d36a2e9e8d7df09bc79f87b4e803b1e8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoMigrate assertThat() imports
Robert Varga [Mon, 24 Feb 2020 13:28:09 +0000 (14:28 +0100)]
Migrate assertThat() imports

Assert.assertThat() has been deprecated, with MatcherAssert.assertThat()
being its replacement.

Change-Id: Ifd0f0243756e78f0788f39867514958109d1ab24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump yangtools to 5.0.0-SNAPSHOT
Robert Varga [Thu, 23 Jan 2020 07:01:07 +0000 (08:01 +0100)]
Bump yangtools to 5.0.0-SNAPSHOT

This adopts yangtools-5.0.0 at snapshots, so we can shake out
integation issues and base our development on yt-5.0.0 changes.

This forces us to refactor mdsal-binding-dom-codec-osgi, which
is done in this patch. We adopt OSGi DS for tracking services.

JIRA: MDSAL-392
Change-Id: Ib5f7cb9817869ca5fc9053af4620d9536a27dcbf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove BindingRuntimeContext{Listener,Service}
Robert Varga [Sun, 23 Feb 2020 21:26:25 +0000 (22:26 +0100)]
Remove BindingRuntimeContext{Listener,Service}

These are not used anywhere and we'll be publishing the context
to the SR anyway. Remove the code while preparing to have it
refactored with DS.

Change-Id: I7639a7ae64edbbc52789eaa0ce388ce7698ff2d7
JIRA: MDSAL-392
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSplit up BindingRuntimeContext
Robert Varga [Thu, 20 Feb 2020 10:24:15 +0000 (11:24 +0100)]
Split up BindingRuntimeContext

We need to disconnect API and implementation here, so that we can
publish BindingRuntimeTypes as a service. The split is done within
runtime-api, though the code is still subject to movement.

JIRA: MDSAL-392
Change-Id: Ied64b89018312daef61d9eb9da3e77a0314eca9d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoruntime-api does not depend on spec-util
Robert Varga [Wed, 19 Feb 2020 16:50:33 +0000 (17:50 +0100)]
runtime-api does not depend on spec-util

This is a bad dependency -- nothing in the API should depend on
details of the binding spec.

JIRA: MDSAL-392
Change-Id: I0fd60b7f4531656b8b82cdabd3e1c8777ac92eb7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSpecialize ModuleInfoBackedContext for no fallback
Robert Varga [Wed, 19 Feb 2020 15:08:34 +0000 (16:08 +0100)]
Specialize ModuleInfoBackedContext for no fallback

We expect BindingRuntimeContext to accurately access classes in
most scenarios. Make sure we ditch TCCL in those scenarios.

JIRA: MDSAL-392
Change-Id: I4a712a65732b98678f555e31dc9400a588a70d1c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSplit out mdsal-binding-runtime-{api,spi}
Robert Varga [Wed, 19 Feb 2020 11:29:37 +0000 (12:29 +0100)]
Split out mdsal-binding-runtime-{api,spi}

There are a number of runtime details being carried in generator-api
which are pure runtime details.

Split these out, so that we can properly separate the concerns
and cleanup lifecycle. That in turn allows us to create more focused
users and eliminate code duplication.

JIRA: MDSAL-392
Change-Id: I7fe59a3b5f43516d2fcee7344efa97731ebb7215
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove version declaration
Robert Varga [Wed, 19 Feb 2020 11:44:54 +0000 (12:44 +0100)]
Remove version declaration

We are inheriting project version, let's not re-declare it.

Change-Id: Ibb00161b6c26a9334efbbc6ffdd5a57af9611db0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSeparate out mdsal-binding-dom-codec-spi
Robert Varga [Tue, 18 Feb 2020 21:08:48 +0000 (22:08 +0100)]
Separate out mdsal-binding-dom-codec-spi

We have a couple of classes which are appropriate in an SPI package,
make sure they are not part of reference implementaiton.

JIRA: MDSAL-392
Change-Id: I2bf6cac4cc5a128bb954d31b9985238271c1a73c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove AugmentationReader
Robert Varga [Tue, 18 Feb 2020 21:35:56 +0000 (22:35 +0100)]
Remove AugmentationReader

This interface is not useful now that we have AugmentationHolder
in yang-binding. Remove it and any references to it.

JIRA: MDSAL-392
Change-Id: I0c3eeead7cb43eb46b3938b33cb49e94a831dc1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoDeprecate AugmentationReader for removal
Robert Varga [Tue, 18 Feb 2020 21:23:52 +0000 (22:23 +0100)]
Deprecate AugmentationReader for removal

AugmentationHolder provides the equivalent functionality in-line
in the DataObject itself. Deprecate AugmentationHolder for removal.

JIRA: MDSAL-392
Change-Id: I51044365a38e26f57792bb2036a2775f3b92d711
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove BindingDataAware
Robert Varga [Tue, 18 Feb 2020 21:01:10 +0000 (22:01 +0100)]
Remove BindingDataAware

We have an equivalent interface in BindingLazyContainerNode,
hence there is no point in keeping an adapter-specific interface
around.

JIRA: MDSAL-392
Change-Id: I1beb3dc8f709bbce80aee5a9d64ef11f75926a41
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRehost BaseYangTypes
Robert Varga [Tue, 18 Feb 2020 19:55:42 +0000 (20:55 +0100)]
Rehost BaseYangTypes

These types are closely related to Types and as such are part of
the same API group as binding.model.util. Relocating them allows
us to lower dependencies on mdsal-binding-generator-impl.

JIRA: MDSAL-392
Change-Id: I3ba9097c3194c42d3c8f3f1b3fac521934e7d1cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoDo not depend on generator impl in binding-dom-codec-api
Robert Varga [Tue, 18 Feb 2020 16:54:24 +0000 (17:54 +0100)]
Do not depend on generator impl in binding-dom-codec-api

The API itself does not depend on a particular generator
implementation, make sure that is reflected in pom.xml.

JIRA: YANGTOOLS-392
Change-Id: Ia35d16df7bc43ac43560a98d387518af2d9fe040
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoPromote BindingRuntimeContext to binding-generator-api
Robert Varga [Mon, 17 Feb 2020 21:50:45 +0000 (22:50 +0100)]
Promote BindingRuntimeContext to binding-generator-api

BindingRuntimeContext only requires BindingRuntimeTypes, make
them required in factory method and have users take care of
implementation binding. This allows us to promote it to an API
utility, reducing cross-implementation clutter.

This refactor also shows that BindingCodecTreeFactory is mixing
apples and oranges, forcing users to deal with things that should
readily come from BindingRuntimeContext -- we refactor that support
code so that it is hosted in ModuleInfoBackedContext instead.

JIRA: MDSAL-392
Change-Id: I6381c889c7a1911f9e524aadf1c06c61e99fd75f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoMove mdsal-binding-dom-codec tests
Robert Varga [Tue, 18 Feb 2020 09:00:52 +0000 (10:00 +0100)]
Move mdsal-binding-dom-codec tests

Keeping the tests in a separate package is not useful, make sure
we match the implementation package.

JIRA: MDSAL-392
Change-Id: Id5f8c1af72203a64f03c681c52ca791f282b678d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoPromote codec exceptions to binding.codec.api
Robert Varga [Mon, 17 Feb 2020 23:53:20 +0000 (00:53 +0100)]
Promote codec exceptions to binding.codec.api

This exception should be part of documented API contract, promote
it.

JIRA: MDSAL-392
Change-Id: Ia0985e0399468ee3f57a4a50f65b38085245edeb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoPromote ReferencedTypeImpl to model.api.DefaultType
Robert Varga [Mon, 17 Feb 2020 23:00:43 +0000 (00:00 +0100)]
Promote ReferencedTypeImpl to model.api.DefaultType

This is simple bare type, taking advantage of only AbstractType,
hence we cen provide it in API and allows users to share.

JIRA: MDSAL-392
Change-Id: I67a4b7d16ba9a80637d3d9454e76fd01ef3fe428
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoMake Binding(Runtime)Generator a proper service
Robert Varga [Tue, 18 Feb 2020 11:16:43 +0000 (12:16 +0100)]
Make Binding(Runtime)Generator a proper service

We want to expose proper services which implement generator APIs,
not force users to instantiate an implementation by themselves.

This allows us to hide BindingGeneratorImpl and refactor it.

JIRA: MDSAL-392
Change-Id: Id41f8562e87165e8509b9c5076804244d0b342b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSplit ound mdsal-binding-dom-codec-api
Robert Varga [Mon, 17 Feb 2020 21:04:13 +0000 (22:04 +0100)]
Split ound mdsal-binding-dom-codec-api

The codec has a well-defined API surface, make sure we publish it
as a separate bundle.

Change-Id: Iea7511d7d076320b54dcb719a49767085765a408
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove DispatchSerializers
Robert Varga [Mon, 17 Feb 2020 17:14:25 +0000 (18:14 +0100)]
Remove DispatchSerializers

These classes are not used anywhere, remove them.

Change-Id: I701c276f6036c7a7a50588d6a18de46831daecfd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoDeprecate DispatchSerializers for removal
Robert Varga [Mon, 17 Feb 2020 17:13:40 +0000 (18:13 +0100)]
Deprecate DispatchSerializers for removal

These classes are not used anywhere, deprecate them for removal.

Change-Id: I4538b1c794cd21fd0f21921c0838db620af5eff2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoUse SchemaNodeIdentifier instead of a SchemaPath
Robert Varga [Mon, 17 Feb 2020 16:57:07 +0000 (17:57 +0100)]
Use SchemaNodeIdentifier instead of a SchemaPath

This method is not implemented but is going to be needed for RPC
dispatch. Make sure to update it to take SchemaNodeIdentifier,
which is well-defined in terms of lookup.

JIRA: MDSAL-86
Change-Id: I7d188c6912a29cff94f9a4e0b8b0b609bc7c6cae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoFix checkstyle a bit
Robert Varga [Mon, 17 Feb 2020 16:55:45 +0000 (17:55 +0100)]
Fix checkstyle a bit

We have a misaligned method here, fix that up.

Change-Id: Iff4ad3e9a5c2da1e64f73f8b3dfaf78d77b1db85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoEnable spotbugs in mdsal-binding-java-api-generator
Robert Varga [Thu, 11 Oct 2018 23:22:07 +0000 (01:22 +0200)]
Enable spotbugs in mdsal-binding-java-api-generator

This fixes up the issues reported and flips enforcement to on.

Change-Id: I205b07535f42f6a3f3c5ae4e14167de4982e9338
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump to odlparent-6.0.5/yangtools-4.0.7
Robert Varga [Mon, 10 Feb 2020 14:18:45 +0000 (15:18 +0100)]
Bump to odlparent-6.0.5/yangtools-4.0.7

This picks up latest updates from both yangtools and odlparent.

Change-Id: I5ad354f87e65c4ea2141d3bc13c414e89869f833
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoLower reliance on SchemaNode collection types
Robert Varga [Thu, 23 Jan 2020 09:41:31 +0000 (10:41 +0100)]
Lower reliance on SchemaNode collection types

As YANG Tools is moving to lazily-constructed views of various
SchemaNode collections, code gets in the way by using Sets and
invariants and similar. This patch migrates the users, so that
we can seamlessly migrate.

JIRA: YANGTOOLS-1068
Change-Id: I5affc1bd93695aef17d8e961fcfc1e3305d1888d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump byte-buddy to 1.10.7
Robert Varga [Tue, 21 Jan 2020 11:58:48 +0000 (12:58 +0100)]
Bump byte-buddy to 1.10.7

There are a number of improvements, including Java compatibility,
update our repackaged version to current latest.

Change-Id: I8b54a1b20e510e2738d6f61f62d7b088db534e78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump to odlparent-6.0.4 and yangtools-4.0.6
Robert Varga [Thu, 16 Jan 2020 14:35:00 +0000 (15:35 +0100)]
Bump to odlparent-6.0.4 and yangtools-4.0.6

Pick up latest updates and fix for SFT.

Change-Id: Ia95f9aa740d77407043d7a59823c0c71cad0e681
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump to yangtools-4.0.5
Robert Varga [Tue, 14 Jan 2020 16:02:29 +0000 (17:02 +0100)]
Bump to yangtools-4.0.5

This picks up the latest improvements.

Change-Id: If88980b7f1e38e1ee3c736a7bd04ddecd4d0f74e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRevert "Revert "Do not emit empty lists to NormalizedNodes""
Robert Varga [Thu, 19 Dec 2019 12:40:10 +0000 (13:40 +0100)]
Revert "Revert "Do not emit empty lists to NormalizedNodes""

This reverts commit a9669f2f177c89d3816b21fc0a021d05dac50ea8,
reinstating the changes done in 672a3adc4378ec5228b15bcdafc4dec2ea066dbd
as part of MDSAL-456.

JIRA: MDSAL-450
Change-Id: Ib9ee71194ab06eb873b9257b4e7eed450162f816
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoDTOs for anydata/anyxml are not generated within a list
wusandi [Wed, 25 Dec 2019 12:04:16 +0000 (20:04 +0800)]
DTOs for anydata/anyxml are not generated within a list

Code generation for container and list statements follows different
code paths and we have missed a hook in the latter to generate
opaque objects.

JIRA: MDSAL-506
Change-Id: I25a54362ceb09937ffe796081660afe7fa1d6bb2
Signed-off-by: wusandi <wusandi@163.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump yangtools to 4.0.4
Robert Varga [Mon, 23 Dec 2019 17:00:18 +0000 (18:00 +0100)]
Bump yangtools to 4.0.4

This picks up the latest version, adjusting for API changes made
therein.

Change-Id: I0eba45f69ebdbe44d2688a800c1006df5898180a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSpeed up AbstractBuilderTemplate.removeProperty()
Robert Varga [Thu, 19 Dec 2019 14:51:20 +0000 (15:51 +0100)]
Speed up AbstractBuilderTemplate.removeProperty()

Rather than performing a linear unbounded search followed by a
conditional remove, use an interator and remove the first matching
property, bailing out.

Change-Id: Ia5de2175628c9730d7c76df58e15540f3cbb4fa3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSpeed up check for list
Robert Varga [Thu, 19 Dec 2019 14:42:41 +0000 (15:42 +0100)]
Speed up check for list

This speeds up the check for list by first checking if key is not
null and searching for interface afterwards.

Change-Id: Id35da9d5dfc76f243fd7c800115c26a2d181558b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoPropagate EffectiveModelContext for codegen plugins
Robert Varga [Sun, 22 Dec 2019 13:07:51 +0000 (14:07 +0100)]
Propagate EffectiveModelContext for codegen plugins

yang-maven-plugin infra is giving us EffectiveModelContext, which
allows us to eventually switch code generation to work on
EffectiveStatements rather than on SchemaNodes. This propagates
EffectiveModelContext closer to actual users.

Change-Id: I90dd2aa983e05748c0ac838731580adbe5055003
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoUse BindingTypes.identifiable()
Robert Varga [Thu, 19 Dec 2019 12:51:04 +0000 (13:51 +0100)]
Use BindingTypes.identifiable()

Instead of looking up Identifiable type each time we use it, use
the convenience method exposed through BindingTypes, improving
efficiency a bit.

Change-Id: Ib8e7bf0385a51ee687484a2667905e284a90ab3a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove deprecated Types methods
Robert Varga [Wed, 18 Dec 2019 10:25:02 +0000 (11:25 +0100)]
Remove deprecated Types methods

Types methods dealing with binding concepts have been migrated
to BindingTypes, remove their residence.

Change-Id: Idb1710ba888dd40f630389028702c209904d443a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoFix RPC method name conflict with JLS
miroslav.kovac [Mon, 16 Dec 2019 16:28:41 +0000 (17:28 +0100)]
Fix RPC method name conflict with JLS

When we are constructing the method name for use with the RPC
provider interface we need to pay attention to conflicts with
JLS reserved words.

If such a conflict occurs, append a single '$' to the name, so
that we have a valid method name.

JIRA: MDSAL-500
Change-Id: Ifb533e2daa71bc9d1780a5d8eb48da6ce3b2d209
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoMap system-ordered keyed lists to Map
Robert Varga [Mon, 18 Nov 2019 11:30:08 +0000 (12:30 +0100)]
Map system-ordered keyed lists to Map

The type mapping for YANG lists which have a key and do not have
a user-specified order should point to java.util.Map, as that
provides the correct semantics.

This patch changes that mapping, resulting in better ergonomics,
as it is now possible to acquire specific items based on their
keys.

JIRA: MDSAL-434
Change-Id: If2f8980fde1c419bbc0b7c414d7deab329362b47
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoHandle java.util.Map return type
Robert Varga [Mon, 18 Nov 2019 10:48:18 +0000 (11:48 +0100)]
Handle java.util.Map return type

BindingReflections needs to be aware of the fact that return
type may be a Map, not only List. This adds the logic to take
care of that.

JIRA: MDSAL-434
Change-Id: I9e0dd170c03b7849e3d1d307ba03e6dd931663e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoAdd CodeHelpers.nonnull(Map)
Robert Varga [Mon, 18 Nov 2019 12:03:54 +0000 (13:03 +0100)]
Add CodeHelpers.nonnull(Map)

This allows to generate nonnull getters for Maps, as used by mapping.

JIRA: MDSAL-434
Change-Id: I46d59156037ee035eaba0a50ce682fdea22e3661
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove deprecated uint migration elements
Robert Varga [Mon, 18 Nov 2019 14:43:07 +0000 (15:43 +0100)]
Remove deprecated uint migration elements

This removes code generated to support uint8/16/32/64 mapping
transition, so that users are forced to interface with proper types.

JIRA: MDSAL-490
Change-Id: I83c074ebe2dd9bfeea3fea1e12befb01a3fb435d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump versions to 6.0.0-SNAPSHOT
Robert Varga [Tue, 17 Dec 2019 01:16:57 +0000 (02:16 +0100)]
Bump versions to 6.0.0-SNAPSHOT

This starts the next major version development. Artifacts with stable
API are realigned at 6.0.0-SNAPSHOT.

Change-Id: I529702bede7166cf611996af10ac8bcab31349b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoMove Bug5224/Bug5845 tests
Robert Varga [Thu, 12 Dec 2019 22:12:39 +0000 (23:12 +0100)]
Move Bug5224/Bug5845 tests

These tests are in reality testing BindingNormalizedNodeCodecRegistry,
move them to mdsal-binding-dom-codec, eliminating their dependency
on AbstractDataBrokerTest.

JIRA: MDSAL-393
Change-Id: I05fd3129efffeac5564096c34f7170a578caa380
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump versions to 5.0.7-SNAPSHOT
Robert Varga [Thu, 12 Dec 2019 17:45:09 +0000 (18:45 +0100)]
Bump versions to 5.0.7-SNAPSHOT

This starts the next development iteration.

Change-Id: I127ab18a7d932e186fc7acebb1bbe9b5ea963816
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSwitch DataContainerCodecPrototype to VarHandles
Robert Varga [Tue, 26 Nov 2019 22:24:59 +0000 (23:24 +0100)]
Switch DataContainerCodecPrototype to VarHandles

With Java 9+ we can improve memory access through
DataContainerCodecPrototype by lowering the double-checked
load from being based on volatile (hence globally-ordered)
to being based acquire/release, providing more freedom to JIT.

JIRA: MDSAL-498
Change-Id: I1b366916332f7918d8f8c517a1e7b255215493b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSwitch streamer instantiation to VarHandles
Robert Varga [Tue, 26 Nov 2019 22:09:49 +0000 (23:09 +0100)]
Switch streamer instantiation to VarHandles

Streamers are based on immutable data, hence we can safely drop
their cache to release/acquire instead of the globally-ordered
volatile semantics.

JIRA: MDSAL-498
Change-Id: I36036908b0ae35dccc2b9016057ca1014373510d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoUse VarHandle for CodecDataObject hashCode cache
Robert Varga [Tue, 26 Nov 2019 21:49:18 +0000 (22:49 +0100)]
Use VarHandle for CodecDataObject hashCode cache

Since DataObjects are effectively-final and so are NormalizedNodes,
we can rely on them being invariant and thread-safe. This allows us
to lower synchronization of the hash code cache, so that it does not
force a full volatile barrier, but only a simple acquire/release
interaction.

JIRA: MDSAL-498
Change-Id: I201aa8de447222da5dcc0e5c29d6375743ec9083
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump versions to 5.0.6-SNAPSHOT
Robert Varga [Wed, 11 Dec 2019 11:28:14 +0000 (12:28 +0100)]
Bump versions to 5.0.6-SNAPSHOT

This starts the next development iteration.

Change-Id: I5f3f6fb0fa79a2346405c214a72d0bd7d13fd6fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump odlparent/yangtools to 6.0.3/4.0.3
Robert Varga [Wed, 11 Dec 2019 02:51:50 +0000 (03:51 +0100)]
Bump odlparent/yangtools to 6.0.3/4.0.3

This picks up the latest fixes and features.

Change-Id: I84053689e66ea3dabf934f98e72249d8f1bba859
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSprinkle BindingReflections with @NonNull annotations
Robert Varga [Wed, 11 Dec 2019 01:44:46 +0000 (02:44 +0100)]
Sprinkle BindingReflections with @NonNull annotations

This adds a few obvious annotations, so that callers do not get
warnings.

Change-Id: Icf1574b8d6a90c959ce6580a3f7e675f46fa0837
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoAdd codegen support for nested notifications
Robert Varga [Mon, 9 Dec 2019 15:44:30 +0000 (16:44 +0100)]
Add codegen support for nested notifications

We do not have a concept of instance notification, which is similar
in many respects to an action. Add the baseline interface marker
and teach mdsal-binding-generator-impl to emit interface definitions
for them.

JIRA: MDSAL-493
Change-Id: I6af84b50f3083a8e1046ee0521b126aae1ffafe5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoUpdate CodecDataObjectGenerator documentation
Robert Varga [Tue, 26 Nov 2019 22:59:58 +0000 (23:59 +0100)]
Update CodecDataObjectGenerator documentation

The documentation is not quite accurate, as its initial paragraph
references constant folding which is not actually implemented.

Fix wording and drop a new FIXME for implementation follow-up.

Change-Id: I090ff203cdd28aafc43dce27c186098941c0e6b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoCorrect @NonNull CodeHelpers.compilePatterns()
Robert Varga [Thu, 21 Nov 2019 13:27:12 +0000 (14:27 +0100)]
Correct @NonNull CodeHelpers.compilePatterns()

Arrays and type-use annotations have weird way of being written,
this adds the correct form.

JIRA: MDSAL-487
Change-Id: I2e31c90eca5b59250f0a9e33444fa8b3b8ae5e4c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoFix CodeHelper.nonnull() nullness annotation
Robert Varga [Thu, 21 Nov 2019 13:25:53 +0000 (14:25 +0100)]
Fix CodeHelper.nonnull() nullness annotation

We do not correctly propagate the fact the return is @NonNull,
leading to Eclipse issuing warnings. Fix that.

JIRA: MDSAL-487
Change-Id: I24360192d105423a19165855521bb24bb0bd0678
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoCorrect YangModuleInfo.getInstance() nullness warning
Robert Varga [Thu, 21 Nov 2019 13:25:04 +0000 (14:25 +0100)]
Correct YangModuleInfo.getInstance() nullness warning

This method is missing a @NonNull, which means we end up issuing
a warning. Fix that up.

JIRA: MDSAL-487
Change-Id: I0870880bceb727b6a820bcdc0fd4177002fb4119
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoImport types being checked
Robert Varga [Mon, 18 Nov 2019 12:44:39 +0000 (13:44 +0100)]
Import types being checked

When we are checking individual component types, we should not
be needing to reference them via the full name. Use imported name
instead.

Change-Id: I728d4790929cb548ef022c3b3b34e6cddc2f5aa3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoAdd Types.isListType(ParameterizedType)
Robert Varga [Mon, 18 Nov 2019 12:16:37 +0000 (13:16 +0100)]
Add Types.isListType(ParameterizedType)

Performing duplicate checks is not efficient, if the caller already
knows the type is parameterized.

Change-Id: I164291490602959d1f5bdd83eb35be7f2b0d0428
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSpeed up ListsBindingUtils
Robert Varga [Mon, 18 Nov 2019 12:54:42 +0000 (13:54 +0100)]
Speed up ListsBindingUtils

This just uses proper fluent builder pattern instead of a
temporary variable.

Change-Id: I8cdf2cff7c910f5518eb999949f315740fe7c1ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove unneeded checkstyle supressions
Robert Varga [Mon, 18 Nov 2019 10:44:11 +0000 (11:44 +0100)]
Remove unneeded checkstyle supressions

Treading carefully and using Class.asSubclass() allows us to
remove raw types/unchecked casts.

Change-Id: Ib7554cc40f0b4f41495405db3b7715e0f4e21cc7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump versions to 5.0.5-SNAPSHOT
Robert Varga [Mon, 4 Nov 2019 09:57:52 +0000 (10:57 +0100)]
Bump versions to 5.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: Ie74fd03ed815844bf0e74b693f101b6884973172
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoPropagate @NonNull around JavaFileTemplate
Robert Varga [Mon, 21 Oct 2019 20:55:03 +0000 (22:55 +0200)]
Propagate @NonNull around JavaFileTemplate

We really do not tolerate nulls here, add appropriate annotations
to silence Eclipse warnings.

Change-Id: If48ba86523e61ea30874a979a03874f17dc877e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove JavaFileTemplate.addImport()
Robert Varga [Mon, 21 Oct 2019 20:49:56 +0000 (22:49 +0200)]
Remove JavaFileTemplate.addImport()

This method is unused, remove it.

Change-Id: Ib8192127845e607a29ed68d8cbc8d9da68757897
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove support for multiple annotations
Robert Varga [Mon, 21 Oct 2019 20:43:43 +0000 (22:43 +0200)]
Remove support for multiple annotations

We are only using a single annotation, hence we can collapse
a for loop into a straight append. Also reduces the need to allocate
arrays (even if JIT will handle that).

Change-Id: I5d226b115c16a91636045031c1ae3870a119e81a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoCache most common importedName(Class) references
Robert Varga [Mon, 21 Oct 2019 18:44:10 +0000 (20:44 +0200)]
Cache most common importedName(Class) references

Going through importedName(Class) incurs some cost to look up
the JavaTypeName in the global cache. There is a number of common
classes we end up using very frequently.

We express these references as JavaTypeName constants, hence
reducing the need for cache lookups in the hot path.

Change-Id: I7f0430f529e82a7d4838ebe2200520d20a5a44a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoUse SUPPRESS_WARNINGS reference
Robert Varga [Mon, 21 Oct 2019 19:15:07 +0000 (21:15 +0200)]
Use SUPPRESS_WARNINGS reference

When suppressing warnings, we should use the JavaTypeName constant
available in JavaFileTemplate.

Change-Id: I9b6a46403b67f4411356e2aaf16c758b15430273
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoSpecialize JavaFileTemplate.importedName(Type)
Robert Varga [Mon, 21 Oct 2019 18:46:29 +0000 (20:46 +0200)]
Specialize JavaFileTemplate.importedName(Type)

95% of call sites do not use annotations, hence we specialize
this method and support it through specialized
AbstractJavaGeneratedType.getReferenceString(Type).

This clearly separates the two codepaths and removes superfluous
checks and indirections in both paths.

Change-Id: I17bfef631d446d71147b17146d5b2cf71a8be623
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove an unused import
Robert Varga [Mon, 21 Oct 2019 18:27:24 +0000 (20:27 +0200)]
Remove an unused import

This import was left unused after the previous patch, remove it.

JIRA: MDSAL-487
Change-Id: Ie3fe896c64a1cae5c86095dd98386111dcf17959
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoAdd @NonNull annotation to $YangModuleInfoImpl.qnameOf()
Robert Varga [Mon, 21 Oct 2019 12:44:33 +0000 (14:44 +0200)]
Add @NonNull annotation to $YangModuleInfoImpl.qnameOf()

YangModuleInfoTemplate has a lot of ceremony when we statically
know the types being used by the template. Concentrate imports
into two sets, instantiate them as strings and be done with it.

Since this takes care of most dynamics, making things much easier
and predictable, we can easily add @NonNull annotations as needed.

JIRA: MDSAL-487
Change-Id: Ic9cd4da1002f3edea6f3fb18f9d49e4a377e145b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoUse ImmutableSet in YangModuleInfo
Robert Varga [Mon, 21 Oct 2019 15:23:01 +0000 (17:23 +0200)]
Use ImmutableSet in YangModuleInfo

This allows us to bind to a concrete implementation, improving
performance very slightly.

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