mdsal.git
4 years agoUse osgi-core constants 74/88074/1
Robert Varga [Wed, 26 Feb 2020 10:38:07 +0000 (11:38 +0100)]
Use osgi-core constants

Just to keep things consistent, use OSGi's Constants class to get
the bundle id for framework (i.e. SYSTEM_BUNDLE_ID).

Change-Id: I18dae474c944f29ebb32203a12db1c96c2e1483f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove commented-out dependency 44/88044/1
Robert Varga [Tue, 25 Feb 2020 13:53:01 +0000 (14:53 +0100)]
Remove commented-out dependency

We do not need a dependency on javax.annotation, remove it.

Change-Id: I5f71224827f2e4c106820e9859988df5d5d12893
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse BindingCodecTreeFactory in yanglib 43/88043/1
Robert Varga [Tue, 25 Feb 2020 13:49:17 +0000 (14:49 +0100)]
Use BindingCodecTreeFactory in yanglib

Since BindingCodecTreeFactory is a proper component now, we can
use in our yanglib implementations, severing explicit dependency
on binding-dom-codec implementation.

JIRA: MDSAL-392
Change-Id: I76b3ce49a2b25ef7e2f9ff357f98c843659ad181
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove BindingToNormalizedNodeCodec.getDefaultNodeFor() 42/88042/1
Robert Varga [Tue, 25 Feb 2020 11:42:50 +0000 (12:42 +0100)]
Remove BindingToNormalizedNodeCodec.getDefaultNodeFor()

This method is used only in controller compat layer, which is going
away anyway. Remove it from our proper.

Change-Id: I61b73754e08c3b36ce6043e19b1cf25d554888d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUntangle BindingCodecContext/BindingNormalizedNodeCodecRegistry 39/88039/1
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>
4 years agoSplit off DefaultBindingCodecTreeFactory 38/88038/2
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>
4 years agoUse only BundleContext in BindingClassLoadingStrategy 27/88027/2
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>
4 years agoMigrate assertThat() imports 36/88036/1
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>
4 years agoUse OSGi DS instead of Activator/blueprint 16/87916/8
Robert Varga [Wed, 19 Feb 2020 17:18:52 +0000 (18:18 +0100)]
Use OSGi DS instead of Activator/blueprint

This saves us some hassle, making the intent more obvious.

JIRA: MDSAL-392
Change-Id: I76a42e206857b1c59d0080c788b157ecf40ba829
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump yangtools to 5.0.0-SNAPSHOT 92/87092/22
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>
4 years agoRemove BindingRuntimeContext{Listener,Service} 17/88017/2
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>
4 years agoSplit up BindingRuntimeContext 27/87927/4
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>
4 years agoRemove blueprint component 99/87999/1
Robert Varga [Fri, 21 Feb 2020 19:15:14 +0000 (20:15 +0100)]
Remove blueprint component

A thorough review of MD-SAL lifecycle has shown we bend over
backwards to maintain immutable service view for blueprint
containers.

The basic mindset behind blueprint goes directly against MD-SAL's
view of immutable objects. Specifically, hides all dynamic services
behind proxies, isolating us from the Service Registry. Hence we
cannot use the registry to exchange state -- which defeats the point
of having the service registry.

OSGi Declarative Services use static binding (by default) and allow
us to expose component lifecycle, so that it can be correctly
responded to.

We therefore remove any pretense we are endorsing blueprint -- because
we are not. Everybody should decompose their application properly
and use DS for OSGi.

JIRA: MDSAL-413
Change-Id: I6a53e2f9da80a52d4d53371669158e9db7452c1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoruntime-api does not depend on spec-util 15/87915/1
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>
4 years agoRemove BindingSchemaContextUtils 14/87914/1
Robert Varga [Wed, 19 Feb 2020 16:41:07 +0000 (17:41 +0100)]
Remove BindingSchemaContextUtils

This class is not referenced anywhere, remove it.

JIRA: MDSAL-392
Change-Id: Ic82e0b4cd3f119f24753014c77da5e37f26794e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSpecialize ModuleInfoBackedContext for no fallback 11/87911/2
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>
4 years agoSplit out mdsal-binding-runtime-{api,spi} 09/87909/5
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>
4 years agoRemove version declaration 08/87908/1
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>
4 years agoSeparate out mdsal-binding-dom-codec-spi 75/87875/2
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>
4 years agoRemove AugmentationReader 77/87877/2
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>
4 years agoDeprecate AugmentationReader for removal 76/87876/2
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>
4 years agoRemove BindingDataAware 74/87874/1
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>
4 years agoRehost BaseYangTypes 73/87873/3
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>
4 years agoYangSchemaUtils is not used anywhere, remove it 72/87872/1
Robert Varga [Tue, 18 Feb 2020 19:49:49 +0000 (20:49 +0100)]
YangSchemaUtils is not used anywhere, remove it

This is the last class in mdsal.binding.generator.util as known
to mdsal-binding-generator-impl, freeing up the package for
relocation.

JIRA: MDSAL-392
Change-Id: I9e6f6839f0950ba3600ef3e49139757f8e7e44d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDo not depend on generator impl in binding-dom-codec-api 68/87868/3
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>
4 years agoPromote BindingRuntimeContext to binding-generator-api 28/87828/25
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>
4 years agoMake sure docs depend on codec-api 67/87867/2
Robert Varga [Tue, 18 Feb 2020 16:50:13 +0000 (17:50 +0100)]
Make sure docs depend on codec-api

We want to keep it properly documented, make sure to include
mdsal-binding-dom-codec-api.

JIRA: MDSAL-392
Change-Id: Ic0889bb8c73ebc6019dbbfdb5f0029a4754615c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove mdsal-binding-dom-codec tests 60/87860/16
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>
4 years agoPromote codec exceptions to binding.codec.api 54/87854/20
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>
4 years agoPromote ReferencedTypeImpl to model.api.DefaultType 53/87853/13
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>
4 years agoRefactor GeneratedClassLoadingStrategy 59/87859/11
Robert Varga [Tue, 18 Feb 2020 08:58:07 +0000 (09:58 +0100)]
Refactor GeneratedClassLoadingStrategy

This class holds two implementations, each of which is a singleton.
Make sure we lazy-load implementation classes so that the CHA can
be more effective.

JIRA: MDSAL-392
Change-Id: Ia31f63d877ec1025e1a06bf8676d918857e6fd1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove BindingRuntimeContext.getEnumMapping() 32/87832/10
Robert Varga [Mon, 17 Feb 2020 22:42:21 +0000 (23:42 +0100)]
Remove BindingRuntimeContext.getEnumMapping()

These methods are inexact and unused, remove them to prevent any
confusion as to what goes on w.r.t. enums: their class-to-YANG
mapping is captured in the classes themselves, so go fetch it as
appropriate: either enumerate the class, or if you have an instance,
just call getName().

JIRA: MDSAL-392
Change-Id: I0034004e92ae4444efab2401dc16b859047d677a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate BindingRuntimeContext.getEnumMapping() 31/87831/9
Robert Varga [Mon, 17 Feb 2020 22:36:15 +0000 (23:36 +0100)]
Deprecate BindingRuntimeContext.getEnumMapping()

Generated enumerations capture their YANG-declared name and expose
it as their method.

JIRA: MDSAL-392
Change-Id: Iac16b6b3599565f059332ed079c432c0603ac500
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoPromote AbstractBaseType to binding.model.api 30/87830/9
Robert Varga [Mon, 17 Feb 2020 22:17:52 +0000 (23:17 +0100)]
Promote AbstractBaseType to binding.model.api

This base class forms an obvious connection between two API concepts,
it should live in the API package as well.

JIRA: MDSAL-392
Change-Id: I5d1209563d2b18f818e3b1c3853b7d7c88fea7a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove BindingSchemaContextUtils.findInstantiatedCase() 29/87829/9
Robert Varga [Mon, 17 Feb 2020 21:58:39 +0000 (22:58 +0100)]
Move BindingSchemaContextUtils.findInstantiatedCase()

The only user is BindingRuntimeContext, move the method there
and sever its dependence in binding.generator.impl.

JIRA: MDSAL-392
Change-Id: I4cc349f5d99a4f9ee0c35b01c553e1ddda263e6e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake Binding(Runtime)Generator a proper service 65/87865/3
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>
4 years agoUse default createParser() only 61/87861/1
Robert Varga [Tue, 18 Feb 2020 09:42:02 +0000 (10:42 +0100)]
Use default createParser() only

Blueprint should be fixed up completely now, use default method
to construct parser.

Change-Id: Ibd452bf36ff22a767d48711a2ba1fe57b217005e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBindingRuntimeTypes should expose SchemaContext 27/87827/1
Robert Varga [Mon, 17 Feb 2020 21:28:38 +0000 (22:28 +0100)]
BindingRuntimeTypes should expose SchemaContext

This is an invariant which is useful to users, make sure we expose
it so that they do not have to track it separately.

Change-Id: If4ddb0915eb433a9f8f857bde473a5de798192ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSplit ound mdsal-binding-dom-codec-api 26/87826/1
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>
4 years agoRemove DispatchSerializers 22/87822/1
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>
4 years agoDeprecate DispatchSerializers for removal 21/87821/1
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>
4 years agoUse SchemaNodeIdentifier instead of a SchemaPath 19/87819/1
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>
4 years agoFix checkstyle a bit 18/87818/1
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>
4 years agoDo not use org.junit.rules.ExpectedException redux 11/87811/1
Robert Varga [Mon, 17 Feb 2020 13:01:11 +0000 (14:01 +0100)]
Do not use org.junit.rules.ExpectedException redux

We have assertThrows() which is much more useful, refactor the test
to be more explicit and eliminate use of deprecated elements.

Change-Id: I27d567a2d146451143505756cb47c02a027e779e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove duplicate version declaration 10/87810/1
Robert Varga [Mon, 17 Feb 2020 12:55:21 +0000 (13:55 +0100)]
Remove duplicate version declaration

mdsal-binding-generator-impl matches our project version, hence
it can inherit version from parent.

Change-Id: I1bf665166b6883a47360a20066f6c54cd291b690
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDo not use org.junit.rules.ExpectedException 64/87664/1
Robert Varga [Thu, 13 Feb 2020 09:50:34 +0000 (10:50 +0100)]
Do not use org.junit.rules.ExpectedException

We have assertThrows() which is much more useful, refactor the test
to be more explicit and eliminate use of deprecated elements.

Change-Id: I8613afbd3028d602a17f9ea7024e8abde6b8cf48
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEnable spotbugs in mdsal-binding-java-api-generator 16/76916/22
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>
4 years agoBump to odlparent-6.0.5/yangtools-4.0.7 44/87544/1
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>
4 years agoUse EqualityQueuedNotificationManager 50/86350/5
Robert Varga [Wed, 11 Dec 2019 11:26:26 +0000 (12:26 +0100)]
Use EqualityQueuedNotificationManager

Since we are using Registrations as the key into notification
manager, there is no point it the manager using identity wrappers
-- registrations already perform that role.

Clean things up by using EqualityQueuedNotificationManager.

JIRA: MDSAL-514
Change-Id: Ief05a302169d205ed167e7fb88418910d029f9dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoLower reliance on SchemaNode collection types 96/87096/4
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>
4 years agoRemove use of org.junit.rules.ExpectedException 99/87099/1
Robert Varga [Thu, 23 Jan 2020 11:02:46 +0000 (12:02 +0100)]
Remove use of org.junit.rules.ExpectedException

We can use assertThrows() instead.

Change-Id: I8d752851d11496c74388f625067e41582447a8c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump byte-buddy to 1.10.7 65/87065/1
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>
4 years agoFix path namespace resolution 32/86432/10
miroslav.kovac [Mon, 16 Dec 2019 15:57:22 +0000 (16:57 +0100)]
Fix path namespace resolution

If a path is defined in terms of a submodule-local import,
SchemaContextUtil.findDataSchemaNode() breaks down because
it's reparse attempt fails to find the import in the actual
module.

SchemaContextUtil is providing findDataTreeSchemaNode() which
works properly on parsed PathExpression, use that instead.

JIRA: MDSAL-499
Change-Id: Ifa8a8958d7118d851d27fcc2c70c6d8382e3e3c0
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump to odlparent-6.0.4 and yangtools-4.0.6 81/86981/1
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>
4 years agoMigrate away from DataNodeIterator 96/86896/3
Robert Varga [Tue, 14 Jan 2020 16:09:05 +0000 (17:09 +0100)]
Migrate away from DataNodeIterator

We do not need to collect the entire analysis, just typedefs
(and containers in a test). Migrate to new SchemaUtils methods which
provide exactly that functionality more efficiently.

Change-Id: Idfbe19c785351f3280eae33c476d533055cb16e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump to yangtools-4.0.5 95/86895/3
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>
4 years agoUse parallelStream() to generate files 94/86894/2
Robert Varga [Tue, 7 Jan 2020 20:35:22 +0000 (21:35 +0100)]
Use parallelStream() to generate files

This is a follow-up cleanup, reducing complexity of parallel dispatch
by taking advantage of parallel streams.

Change-Id: I7f5edd1444f171fba9b7118531678875a8692223
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoGenerate binding files in parallel 95/86795/3
Robert Varga [Tue, 7 Jan 2020 20:35:22 +0000 (21:35 +0100)]
Generate binding files in parallel

Binding-generated files are standalone in that the process of
generating its source does not have any other side effects.

Improve the performance by generating these files in parallel
using the common ForkJoin pool -- thus taking advantage of all
available cores.

Change-Id: I4ee9efea0371fe9574721701ea9674793209cf24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReturn Ipv{4,6}AddressNoZone when formatting from binary 89/86789/1
Robert Varga [Tue, 7 Jan 2020 12:57:43 +0000 (13:57 +0100)]
Return Ipv{4,6}AddressNoZone when formatting from binary

Ever since MDSAL-440 was implemented, there is no point in our
utilities returning Ipv4Address objects as they never contain a zone
and therefore are equivalent to Ipv4AddressNoZone.

Ipv4AddressNoZone has the additional benefit that the lack of a zone
is contained in the type definition -- hence it can be propagated
through Java interfaces in a type-safe manner. Futhermore, given
the relationship between the two classes, the non-presence of zone
can be ascertained via a simple instanceof check rather than
searching the string.

JIRA: MDSAL-511
Change-Id: I7e0ed85bad7a63af9e9a6f8838609c0e53776ab0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd utility methods to strip zone from Ipv{4,6}Address 88/86788/1
Robert Varga [Tue, 7 Jan 2020 11:25:33 +0000 (12:25 +0100)]
Add utility methods to strip zone from Ipv{4,6}Address

Most callers really want to operate of Ipv4AddressNoZone, as a zone
does not make sense. Some amount of translation may be needed when
dealing with models which we have no control over, hence ensuring
no zone is present needs to be done quickly.

This adds ipv4AddressNoZoneFor(Ipv4Address), which does an efficient
check (for the case where the source is already a NoZone) and strips
the zone.

Change-Id: Ieada4625637d0216983b515324bb5d33f5d33a99
JIRA: MDSAL-510
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove mdsal-uint24-netty 71/86771/2
Robert Varga [Mon, 6 Jan 2020 23:21:50 +0000 (00:21 +0100)]
Move mdsal-uint24-netty

We can expect to have more Netty integrations, this creates a
top-level directory to hold those artifacts.

Change-Id: Ied1645b64b71ddfe9e090f129dc68e8fc785a9c4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCentralize Inet4Address enforcement 82/86782/1
Robert Varga [Tue, 7 Jan 2020 10:23:35 +0000 (11:23 +0100)]
Centralize Inet4Address enforcement

We have four call sites doing the same thing. centralize enforcement
by introducing a dedicated method.

Change-Id: I8129d7bf74b6360b12181fe3c9bf8d61c10e7678
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoParse IPv4-mapped IPv6 address as an IPv6 address 57/86757/3
Ajay Lele [Mon, 6 Jan 2020 18:49:50 +0000 (10:49 -0800)]
Parse IPv4-mapped IPv6 address as an IPv6 address

Inet6Address.getByAddress(byte[]) does not explicitly exist, and is
really InetAddress.getByAddress(byte[]). That method ends up returning
an Inet4Address for IPv4-mapped IPv6 addresses.

This in turn causes addressStringV6() to do the wrong thing and format
the address as an Ipv4. This is not caught by validation, as we are
skipping it by default -- and ends up causing problems way later when
such an address meets an enforcement point -- such as DOM->Binding
translation.

Fix this by using Inet6Address.getByAddress(String. byte[], NetworkInterface),
which is guaranteed to result in an Inet6Address.

Also add proper defences to addressStringV6(InetAddress), so that any
attempt to mis-use it is caught.

JIRA: BGPCEP-891
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
Change-Id: Ife4cc9e57bd49b45f2beb73462a865ad84483d8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEliminate shift variable 65/86765/1
Robert Varga [Mon, 6 Jan 2020 22:36:21 +0000 (23:36 +0100)]
Eliminate shift variable

We do not need to track shift amount, as we can can just shift
the entire previous result, leading to more invariants in the loop.

JIRA: MDSAL-509
Change-Id: I13a108be27cac2fe4498952f3f05437927c999c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd DottedQuad/int interface 62/86762/1
Robert Varga [Mon, 6 Jan 2020 22:17:05 +0000 (23:17 +0100)]
Add DottedQuad/int interface

DottedQuad is essentially an Ipv4Address, hence we should have
the same level of support. Add interface to create DottedQuad from
bits and serialize it to bits.

JIRA: MDSAL-509
Change-Id: I9cee4afa1993a0090f10b3969152344e03e9adc0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse string concatenation for addressString(int) 52/86752/5
Robert Varga [Mon, 6 Jan 2020 17:55:13 +0000 (18:55 +0100)]
Use string concatenation for addressString(int)

Java 11 has cool concatenation, use that instead of a StringBuilder.

JIRA: MDSAL-509
Change-Id: I3d8bd227e85ad611997cbfd7224ff3c31a5bf725
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd IPv4 address bridges to primitive int 51/86751/3
Robert Varga [Mon, 6 Jan 2020 17:41:24 +0000 (18:41 +0100)]
Add IPv4 address bridges to primitive int

Interfacing Ipv4Address(NoZone) with plain int is useful when
we we want to interface with byte streams, such as DataInput
or Netty's ByteBuf. This adds the methods to do so.

JIRA: MDSAL-509
Change-Id: Icce95e4a94ae41be4fc2aee352f83655ea55e89f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd HexString/DottedQuad/Uuid support to IetfYangUtil 16/86716/3
Robert Varga [Sun, 5 Jan 2020 12:33:34 +0000 (13:33 +0100)]
Add HexString/DottedQuad/Uuid support to IetfYangUtil

HexString is similar to a MacAddress and PhysAddress, hence it is
very simple to support it.

DottedQuad is essentially an Ipv4Address, hence it is almost as
simple to support it, too.

Uuid can be created from java.util.UUID, so that is the input
we are expecting.

JIRA: MDSAL-508
Change-Id: I82abd68b23bf857deeb9a64eefb69164fe6c8b24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd uint24.yang 97/86697/4
Robert Varga [Sat, 4 Jan 2020 10:40:52 +0000 (11:40 +0100)]
Add uint24.yang

uint24 is used in a variety of binary protocols (rsvp,lisp,bgp),
this adds a common definition of this type and the corresponding
netty utilities.

JIRA: MDSAL-507
Change-Id: I5170c2bb9ed65d25bada3a85aca6c22f9ba4696b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoLower provideTypeForLeafref() visibility 35/86635/1
Robert Varga [Mon, 30 Dec 2019 19:30:04 +0000 (20:30 +0100)]
Lower provideTypeForLeafref() visibility

This method is only used internally and in tests, make sure we
hide it.

Change-Id: Ic911c4fe70ddd6ac96d539d195c80e5ece4b54ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCleanup AbstractTypeProvider.isLeafRefSelfReference() 28/86628/1
Robert Varga [Mon, 30 Dec 2019 12:45:01 +0000 (13:45 +0100)]
Cleanup AbstractTypeProvider.isLeafRefSelfReference()

This method's logic eagerly strips the xpath, even when we may
end up not needing it. Refactor implementation to initialize
later (and bail quicker).

Change-Id: I7a54d14dcc3def1cc01f65523c5cf6e1277a0fce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRevert "Revert "Do not emit empty lists to NormalizedNodes"" 02/86502/7
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 73b85db4f60f2fb003af6cfdffaaef51b2ac2df2,
reinstating the changes done in cbe6a8cafaec862f2a918ecc9af99720090d3c8a
as part of MDSAL-456.

JIRA: MDSAL-450
Change-Id: Ib9ee71194ab06eb873b9257b4e7eed450162f816
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDTOs for anydata/anyxml are not generated within a list 69/86569/7
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>
4 years agoBump yangtools to 4.0.4 51/86551/3
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>
4 years agoSpeed up AbstractBuilderTemplate.removeProperty() 08/86508/2
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>
4 years agoSpeed up check for list 07/86507/2
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>
4 years agoPropagate EffectiveModelContext for codegen plugins 46/86546/2
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>
4 years agoCleanup model naming 43/86543/1
Robert Varga [Sun, 22 Dec 2019 09:04:22 +0000 (10:04 +0100)]
Cleanup model naming

This is small cleanup to ensure we have consistent model naming.

JIRA: MDSAL-500
Change-Id: I39a65e9bec0778ecc9f5880cd9ef0d50a818c50e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse BindingTypes.identifiable() 03/86503/1
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>
4 years agoRemove deprecated Types methods 76/86476/2
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>
4 years agoAdd BindingTypes.augmentation() 75/86475/1
Robert Varga [Wed, 18 Dec 2019 10:23:33 +0000 (11:23 +0100)]
Add BindingTypes.augmentation()

This migrates Types.augmentationTypeFor() into BindingTypes, so we
have proper separation.

Change-Id: I6ff923be4b598714761ed60ca6a36037295b9ac5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd BindingTypes.QNAME 68/86468/1
Robert Varga [Wed, 18 Dec 2019 08:52:20 +0000 (09:52 +0100)]
Add BindingTypes.QNAME

We are looking this type for each constant, which is not entirely
efficient. Add a constant to BindingTypes and use it directly, providing
a slight performance benefit.

Change-Id: I56c33750b085728a80782da93e9ea4a250b988aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate Types.augmentableTypeFor() 67/86467/1
Robert Varga [Wed, 18 Dec 2019 08:48:31 +0000 (09:48 +0100)]
Deprecate Types.augmentableTypeFor()

This method has a mirror in BindingTypes, which is a more appropriate
place for the definition. Deprecate the method for removal and
redirect it to BindingTypes.augmentation().

Change-Id: I462a2fe25f0b53cca0619c72aac7a1e602718143
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix RPC method name conflict with JLS 34/86434/6
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>
4 years agoMap system-ordered keyed lists to Map 27/85827/21
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>
4 years agoHandle java.util.Map return type 25/85825/15
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>
4 years agoAdd CodeHelpers.nonnull(Map) 24/85824/12
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>
4 years agoRemove deprecated uint migration elements 33/85833/3
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>
4 years agoBump versions to 6.0.0-SNAPSHOT 51/86451/1
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>
4 years agoRevert "Make sure javax.inject is scope=provided" 18/86418/1
Robert Varga [Fri, 13 Dec 2019 14:24:45 +0000 (15:24 +0100)]
Revert "Make sure javax.inject is scope=provided"

This reverts commit ed39857808f10bb2641a19fdc66dc4fadcc62401.
scope=provided does not really help.

Change-Id: I9ba3cde2038b6b1d522b0b43408e08d13685fe91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove Bug5224/Bug5845 tests 09/86409/1
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>
4 years agoRemove overrides of maven.compiler.release 45/86345/3
Robert Varga [Wed, 11 Dec 2019 02:55:30 +0000 (03:55 +0100)]
Remove overrides of maven.compiler.release

We have adopted a fixed-up odlparent, which has the fixes needed
to suppress ARIES-1923. Remove the now-unneeded overrides.

Change-Id: Ibeed12dac7bb96c8b7d5b652233ce51e755bf1e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump versions to 5.0.7-SNAPSHOT 06/86406/2
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>
4 years agoMake sure javax.inject is scope=provided 05/86405/1
Robert Varga [Thu, 12 Dec 2019 16:02:20 +0000 (17:02 +0100)]
Make sure javax.inject is scope=provided

We do not want to lug this around, as it eventually breaks
downstream (which is probably a JDK11 bug, but anyway).

Change-Id: I58a0663a072b722f6207c21c5fdd07957bb28fbc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDepend only on immutables.org annotations 60/86360/1
Robert Varga [Wed, 11 Dec 2019 22:34:06 +0000 (23:34 +0100)]
Depend only on immutables.org annotations

We have a reworked integration with annotations processors, there
is no need to pull the the entire processor to dependencies.

Change-Id: Ic49ac41a333969dad694dd2b3140e7b6a838db96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSwitch DataContainerCodecPrototype to VarHandles 96/85996/3
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>
4 years agoSwitch streamer instantiation to VarHandles 95/85995/3
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>
4 years agoUse VarHandle for CodecDataObject hashCode cache 94/85994/3
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>
4 years agoBump versions to 5.0.6-SNAPSHOT 51/86351/1
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>
4 years agoBump odlparent/yangtools to 6.0.3/4.0.3 44/86344/1
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>