yangtools.git
2 weeks agoDo not use RevisionSourceIdentifier
Robert Varga [Wed, 11 May 2022 13:42:38 +0000 (15:42 +0200)]
Do not use RevisionSourceIdentifier

We only have SourceIdentifier now, adjust codebase to reflect this.

Change-Id: I52ab8d0d9bf9ee920df33d40c467acb5e1223185
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdjust for ModuleImport type change
Robert Varga [Wed, 11 May 2022 13:38:03 +0000 (15:38 +0200)]
Adjust for ModuleImport type change

We are using Unqualified, not String, hence we need to unpack it.

Change-Id: I1227a66256351acbd534701506230c8c7147972a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse HexFormat to print out byte[] properties
ivan.martiniak [Tue, 3 May 2022 11:32:21 +0000 (13:32 +0200)]
Use HexFormat to print out byte[] properties

HexFormat.of().formatHex(byte[] arr)
 - transform byte array to hex formated string,

For comparison array formated with Arrays.toString()
[-32,79,-48,32,-22,58,105,16,-94,-40,8,0,43,48,48,-99],
with formatHex() it is string "e04fd020ea3a6910a2d808002b30309d".

The main difference is that array formatted with formatHex()
does not contain signed values, what was a condition
in the task description.

The test was required to be changed as well because it was
dependent on Arrays.toString() method.

JIRA: MDSAL-692
Change-Id: Ica9e399d61d54ac19369d3b2a9f60c9690b44128
Signed-off-by: ivan.martiniak <ivan.martiniak@pantheon.tech>
2 weeks agoUse instanceof pattern match in fieldsFrom()
Robert Varga [Wed, 27 Apr 2022 16:56:13 +0000 (18:56 +0200)]
Use instanceof pattern match in fieldsFrom()

With JD17 we can use a pattern match to cast the argument only once,
simplifying the generated code and the codegen a bit.

Change-Id: I14c61480eee3d0214d43af2337c5fd0cf9b7d3ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse 'var' for augmentation variable
Robert Varga [Wed, 27 Apr 2022 16:43:08 +0000 (18:43 +0200)]
Use 'var' for augmentation variable

Simplify the variable declaration and corresponding codegen bit
by relying on local variable type inference.

Change-Id: I3976b20ce5acbce66b1057bb3e374e18aaef3155
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoGenerate documentation for builder getters
Robert Varga [Wed, 27 Apr 2022 16:36:39 +0000 (18:36 +0200)]
Generate documentation for builder getters

Javadoc rightfully complains about Builders not documenting its getFoo()
methods. Add the javadocs pointing to their interface counterparts.

JIRA: MDSAL-755
Change-Id: Iacb5480b3bc0490d7c088add9e681076d067635d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoGenerate javadoc for builder setters
Robert Varga [Wed, 27 Apr 2022 16:23:30 +0000 (18:23 +0200)]
Generate javadoc for builder setters

Setters are utterly undocumented. Add javadocs which point to the
corresponding interface method.

JIRA: MDSAL-755
Change-Id: I1d51ea8499d430ed231197e6448a1122d7ac0f27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImport exception references
Robert Varga [Wed, 27 Apr 2022 15:39:42 +0000 (17:39 +0200)]
Import exception references

We may be generating a competing construct, hence need to use
importedName for {IllegalArgument,NullPointer}Exception.

Change-Id: I3fe59a745bc17b292d8d50e6c55ef8669b0ee35a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDocument Builder.augmentation()
Robert Varga [Wed, 27 Apr 2022 15:32:38 +0000 (17:32 +0200)]
Document Builder.augmentation()

Builder's augmentation() method needs some javadoc to fix linting
warnings.

JIRA: MDSAL-755
Change-Id: I1bc62ea6753411159a9d21eca95eaf40b799d2b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAnnotate non-null build() return
Robert Varga [Wed, 27 Apr 2022 15:22:10 +0000 (17:22 +0200)]
Annotate non-null build() return

Builder.build() always returns a non-null value, make sure we annotate
it properly.

Change-Id: I88df931e4d98481354d8e418909248f2d23d2b68
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse Map.of() instead of Collections.emptyMap() in builders
Robert Varga [Wed, 27 Apr 2022 15:02:43 +0000 (17:02 +0200)]
Use Map.of() instead of Collections.emptyMap() in builders

Augmentation field is not used by the builder-internal implementation,
hence we can inline the codegen. Also use Map.of() instead of
emptyMap().

Change-Id: I62e9b92b31355abd917a05a01c94f46230f449ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix a minor typo
Robert Varga [Wed, 27 Apr 2022 14:57:16 +0000 (16:57 +0200)]
Fix a minor typo

'wich' should be 'which'.

Change-Id: I20295881f28c139b0ec7a04678272e762969efe5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDocument builder constructors
Robert Varga [Wed, 27 Apr 2022 14:49:58 +0000 (16:49 +0200)]
Document builder constructors

Javadoc is not entirely happy with us not generating any documentation
for various Builder constructors. Fix this by adding some rudimentary
javadoc.

JIRA: MDSAL-755
Change-Id: Icaec59bb86d21f372e341ea93d9d89cbb2599951
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImprove Builder's fieldsFrom() javadoc
Robert Varga [Wed, 27 Apr 2022 14:47:45 +0000 (16:47 +0200)]
Improve Builder's fieldsFrom() javadoc

We are listing out types, but do not link them. Fix this by making
each item a {@link}.

JIRA: MDSAL-755
Change-Id: I3bf6f8a97bd004cb88bee3fbc6b6b0ef373a36d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDocument QNAME constant
Robert Varga [Wed, 27 Apr 2022 14:30:52 +0000 (16:30 +0200)]
Document QNAME constant

Javadoc does not like the constant not being documented. Make sure
we attach a bit of documentation.

JIRA: MDSAL-755
Change-Id: Ib56879225ea7653f22770d5e097d350e931ece13
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDocument YangModuleInfo(Provider)
Robert Varga [Wed, 27 Apr 2022 14:19:24 +0000 (16:19 +0200)]
Document YangModuleInfo(Provider)

New javadoc is rather more noisy about missing documentation. Improve
the situation for module info and its ServiceLoader provider.

JIRA: MDSAL-755
Change-Id: I9d008a737b4db992664b24babfe206219b975e90
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRepair version declarations
Robert Varga [Wed, 27 Apr 2022 06:50:22 +0000 (08:50 +0200)]
Repair version declarations

Previous search and replace has bumped our versions to an illegal
string, fix that up.

Change-Id: Ic1f0204ea78384e0c1f542c902ef9ce46bcb8d89
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSeal more Binding contracts
Robert Varga [Tue, 26 Apr 2022 10:03:56 +0000 (12:03 +0200)]
Seal more Binding contracts

DataContainer/BindingObject/BindingContract provide structural
hierarchy which is fixed with codegen attaching to specific endpoints.
Make sure we express this invariant by sealing the interior of the
hierarchy.

Change-Id: I5121b5afe9a880600e7ee12700fc954352afa82d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSeal YangSourceDefinition
Robert Varga [Tue, 26 Apr 2022 10:11:21 +0000 (12:11 +0200)]
Seal YangSourceDefinition

YangSourceDefinition cannot be subclassed externally, make it a sealed
class.

Change-Id: Ibebd2c13dc4fac4e2def7f0924b2558b728e2f96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSeal JavaTypeName
Robert Varga [Tue, 26 Apr 2022 10:10:41 +0000 (12:10 +0200)]
Seal JavaTypeName

JavaTypeName cannot be externally subclassed, make it a sealed class.

Change-Id: I2f79f8cf3d4ff060ebb269a1d2fc0f57a3cda604
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClean up mdsal-binding-java-api-generator dependencies
Robert Varga [Tue, 26 Apr 2022 14:52:50 +0000 (16:52 +0200)]
Clean up mdsal-binding-java-api-generator dependencies

We have a number of used dependencies which are not declared, clean them
up.

Change-Id: Iaaa3c808ff8f8c89b3c0bb67ad169eedefeade77
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix mdsal-binding-model-api dependencies
Robert Varga [Tue, 26 Apr 2022 10:13:15 +0000 (12:13 +0200)]
Fix mdsal-binding-model-api dependencies

We have a few warnings about used dependencies, fix that up.

Change-Id: I3ab19de156c637cc97ad06ef8d98a9284601b44a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFixup mdsal-binding-model-api module definition
Robert Varga [Tue, 26 Apr 2022 10:08:44 +0000 (12:08 +0200)]
Fixup mdsal-binding-model-api module definition

We require SLF4J, make sure to mention that.

Change-Id: Ibbdb5438ef60f4c5fc70c590e3fdfdbe2c0c4b8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoGenerate a switch expression in forName()/forIntValue()
Robert Varga [Tue, 26 Apr 2022 12:53:38 +0000 (14:53 +0200)]
Generate a switch expression in forName()/forIntValue()

JDK17 allows us to use switch expressions, which are nice and concise
way of matching values. Use them instead of ImmutableMaps for value
lookups.

JIRA: MDSAL-753
Change-Id: I1f12eb7469ce08ee66024abfb2bef5305f1cee63
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoCleanup enumeration static factory methods
Robert Varga [Tue, 26 Apr 2022 12:47:23 +0000 (14:47 +0200)]
Cleanup enumeration static factory methods

We have some amount of inconsistency around enumeration returns. Improve
the situation by making forName() return a nullable value and add
ofName()/ofValue() methods which throw IAE.

While we are modifying the template, also add proper @Nullable and
@NonNull annotations.

JIRA: MDSAL-754
Change-Id: I07fe4b408174ba830bcc1369ed70597ea2538a85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix mdsal-binding-test-model maven warning
Robert Varga [Tue, 26 Apr 2022 12:57:19 +0000 (14:57 +0200)]
Fix mdsal-binding-test-model maven warning

We are using two dependencies without declaring them, fix that up.

Change-Id: Ifd71d0b5c7768107e004d3c851369d404fc8cbba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSeal BaseNotification
Robert Varga [Mon, 25 Apr 2022 19:26:06 +0000 (21:26 +0200)]
Seal BaseNotification

BaseNotification should never be used directly, only through
Notification and InstanceNotification.

Change-Id: Ib3fd70aeb364523d7f630eb6e882f2308e427884
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoPick up odlparent/yangtools snapshots
Robert Varga [Mon, 25 Apr 2022 19:09:37 +0000 (21:09 +0200)]
Pick up odlparent/yangtools snapshots

Use snapshots for upstreams in order to get updates and JDK17 support.

Change-Id: Ie9dc7e34084b86cbb7e1c931ca884458d92c185c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoConvert mdsal-binding-dom-codec-osgi to a JPMS module
Robert Varga [Wed, 20 Apr 2022 05:13:58 +0000 (07:13 +0200)]
Convert mdsal-binding-dom-codec-osgi to a JPMS module

This is a simple implementation, convert it to JPMS module, fixing up
warnings in the process of doing so.

JIRA: MDSAL-641
Change-Id: I03f71512580ae9c6b48d5acd0d0c6e77a02f3e82
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoConvert mdsal-binding-dom-codec to a JPMS module
tadei.bilan [Mon, 19 Jul 2021 14:19:52 +0000 (17:19 +0300)]
Convert mdsal-binding-dom-codec to a JPMS module

Convert mdsal-binding-dom-codec to a properly-injected JPMS module,
available through @Singleton, @Component and @MetaInfServices.

Also update NonCachingCodecTest to expose its mock fields and
UnionValueOptionContextTest to use test-model's classes.

This also necessitates relocating the loeader package, as otherwise
maven-javadoc-plugin ends up being confused passes down invalid
@packages to javadoc.

JIRA: MDSAL-641
Change-Id: I3cbe8da4fc4905a1246a5e94a7e208e1bccfa1d8
Signed-off-by: tadei.bilan <tadei.bilan@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdd odl-mdsal-bytebuddy
Robert Varga [Mon, 18 Apr 2022 17:48:21 +0000 (19:48 +0200)]
Add odl-mdsal-bytebuddy

Rather than shading byte-buddy, provide it in a separate feature.
This will allow packagers better control of the runtime we link to
and allow it to be reused.

JIRA: MDSAL-747
Change-Id: Id25acfdb24cce9ce2529b0ac8706b8f00671ed7b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoMap identities to proper objects
Robert Varga [Mon, 14 Mar 2022 09:31:49 +0000 (10:31 +0100)]
Map identities to proper objects

Change the binding type mapping from Class<? extends BaseIdetity>
to proper objects. While this imposes some runtime footprint in terms of
loaded classes (there is an anonymous implementation of each identity)
and objects (that implementation is an eager singleton), it removes a
metric ton of irregularities. This this change, all mapped objects
objects can be checked via 'instanceof' and most of them have
implementedInterface() for exact contract matches.

JIRA: MDSAL-733
Change-Id: Iab7dfb7656db87850613f567dfe40ef31494f6c4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse StringBuilder fluently
Robert Varga [Thu, 14 Apr 2022 20:00:51 +0000 (22:00 +0200)]
Use StringBuilder fluently

This is just a bunch of appends, use the return value to chain them.

Change-Id: I7db1a134387ae6ac0b756886d06264cbb8ffa43b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDo not generate union builders
Robert Varga [Fri, 8 Apr 2022 21:00:37 +0000 (23:00 +0200)]
Do not generate union builders

Union builds are not referenced by generated code anymore and have a
number of issues which need to be addressed separately. Just do not
generate them at all, pending a proper factory replacement.

JIRA: MDSAL-49
Change-Id: I6b769ca4d82da16b9f48720e8a17d7c4e1b4e8ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump versions to 10.0.0-SNAPSHOT
Robert Varga [Thu, 14 Apr 2022 12:34:13 +0000 (14:34 +0200)]
Bump versions to 10.0.0-SNAPSHOT

This starts the next major development iteration.

Change-Id: Id30b892ae437fc78f930b372ddf69c85d8724f05
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSpecialize CompositeValueCodec
Robert Varga [Thu, 14 Apr 2022 11:34:59 +0000 (13:34 +0200)]
Specialize CompositeValueCodec

We have only two codec interactions, both of which have dom-codec-api
not tied to IllegalArgumentCodec. Specialize the class and use our codec
API.

JIRA: MDSAL-704
Change-Id: Ic4b219f3e328fe3244811a57037fe1d1780e141f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove ValueTypeCodec
Robert Varga [Thu, 14 Apr 2022 11:15:20 +0000 (13:15 +0200)]
Remove ValueTypeCodec

CompositeValueCodec is null-hostile, hence it can directly subclass
AbstractIllegalArgumentCodec. This leaves UnionTypeCodec as the only
ValueTypeCodec -- hence we can remove the indirection, making the type
hierachy crisper.

JIRA: MDSAL-704
Change-Id: I7661263f5dd7684cebcff7af82d76a1fe0d9b1eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSimplify CompositeValueCodec instantiation
Robert Varga [Thu, 14 Apr 2022 10:51:11 +0000 (12:51 +0200)]
Simplify CompositeValueCodec instantiation

We have some long-winded instantiation here, which amounts to getting an
EncapsulatedValueCodec. Specialize two constructors for
identityref/instance-identifier to make things a bit more clear and
direct.

JIRA: MDSAL-704
Change-Id: I766d4437ff51a8c32c872f6a3bfe66aec68caa14
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump versions to 9.0.3-SNAPSHOT
Robert Varga [Thu, 14 Apr 2022 06:54:11 +0000 (08:54 +0200)]
Bump versions to 9.0.3-SNAPSHOT

This starts the next development iteration.

Change-Id: I84fc11be536df45edcc531964969ce0bc202e212
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump yangtools to 8.0.3
Robert Varga [Thu, 14 Apr 2022 06:53:33 +0000 (08:53 +0200)]
Bump yangtools to 8.0.3

Pick up fixes from upstream.

Change-Id: I1bb83612ef0c9ad474c2ec4e893c90e2455d62dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSchemaUnawareCodec is AbstractIllegalArgumentCodec
Robert Varga [Tue, 12 Apr 2022 09:45:28 +0000 (11:45 +0200)]
SchemaUnawareCodec is AbstractIllegalArgumentCodec

AbstractIllegalArgumentCodec is null-hostile, just as really all
SchemaUnawareCodecs are. Express this in a the type hierarchy,
coalescing things to a place where we can do a like-for like
replacement.

JIRA: MDSAL-704
Change-Id: I44cc2a0d0e5abcb7ea696eeba65dfe892c5daafb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSwitch SchemaUnawareCodec to an abstract class
Robert Varga [Tue, 12 Apr 2022 09:32:00 +0000 (11:32 +0200)]
Switch SchemaUnawareCodec to an abstract class

We have four implementations here, three of which are indirected via
ValueTypeCodec. Switch the type hierarchy a bit, which leaves only
two codecs still using ValueTypeCodec.

JIRA: MDSAL-704
Change-Id: I4c92f15f7de2678a51792e60431947e4c6acbd6f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDo not indirect UnionLoading through Callable
Robert Varga [Mon, 11 Apr 2022 17:58:59 +0000 (19:58 +0200)]
Do not indirect UnionLoading through Callable

Let's just declare Exception to be thrown, forcing the caller to deal
with it -- which it already does.

JIRA: MDSAL-704
Change-Id: I21e26b4f40814bb62a03b5e4a46eed3c29f27882
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove ReflectionBaseCodec
Robert Varga [Mon, 11 Apr 2022 15:06:18 +0000 (17:06 +0200)]
Remove ReflectionBaseCodec

This base class has no real function, remove it.

JIRA: MDSAL-704
Change-Id: I1c79e861bc55133ed16745d4744b29588326eee5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDisconnect BitsCodec from ReflectionBasedCodec
Robert Varga [Mon, 11 Apr 2022 14:51:01 +0000 (16:51 +0200)]
Disconnect BitsCodec from ReflectionBasedCodec

There is just no need to retain the target class here, as we'll never
access it.

JIRA: MDSAL-704
Change-Id: I1d01af3a16d2a4de5d8bd899428960875280493a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoEliminate ValueTypeCodec.encapsulatedValueCodecFor()
Robert Varga [Mon, 11 Apr 2022 14:29:53 +0000 (16:29 +0200)]
Eliminate ValueTypeCodec.encapsulatedValueCodecFor()

There are only two call sites in the same method, inline it and remove
the unnecessary indirection through ValueTypeCodec -- which any reason
for existence except binding IllegalArgumentCodec vtable.

JIRA: MDSAL-704
Change-Id: I11cd0b4f08a1cb8dacd1f66fec9070102ba47889
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDisconnect EncapsulatedValueCodec from ReflectionBasedCodec
Robert Varga [Mon, 11 Apr 2022 14:23:18 +0000 (16:23 +0200)]
Disconnect EncapsulatedValueCodec from ReflectionBasedCodec

While are not looking at the class after we have created our
MethodHandles, hence retaining the Class reference and the baggage
from ReflectionBasedCodec is completely unnecessary. This also
simplifies the class hierarchy a bit.

JIRA: MDSAL-704
Change-Id: Ifc0a9d98d892ab6fa72fd8c91ee3d4a61b1740a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoEncapsulatedValueCodec does not use TypeDefinition
Robert Varga [Mon, 11 Apr 2022 14:18:06 +0000 (16:18 +0200)]
EncapsulatedValueCodec does not use TypeDefinition

The class does not use the definition at all, hence we can neatly
switch to using a LoadingCache, making things a lot clearer.

JIRA: MDSAL-704
Change-Id: I6563e7f97c168fc9a06bcddc0668060104ea0f0a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoPromote SchemaUnawareCodec to a top-level construct
Robert Varga [Mon, 11 Apr 2022 14:09:15 +0000 (16:09 +0200)]
Promote SchemaUnawareCodec to a top-level construct

The encapsulation in ValueTypeCodec seems to be rather unfortunate,
as it is obscuring what codec classes there are.

Change-Id: I25a3cf02b952da9293ad6c4937646c3198fbd6e6
JIRA: MDSAL-704
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSplit STATIC_CODECS into per-type caches
Robert Varga [Mon, 11 Apr 2022 13:57:28 +0000 (15:57 +0200)]
Split STATIC_CODECS into per-type caches

We have a rather sorry tangle of call sites due to the fact we one
instance of a cache with multiple loaders. Split the cache up separately
for each type, co-locating the cache and the loader. This makes it a tad
clearer as to what the type hierarchy looks like: ValueTypeCodec really
is just a useless holder.

JIRA: MDSAL-704
Change-Id: Ia334d373090a119297e7b9c92bccb166e80bcac6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDisconnect IdentifiableItemCodec from IllegalArgumentCodec
Robert Varga [Mon, 11 Apr 2022 11:57:24 +0000 (13:57 +0200)]
Disconnect IdentifiableItemCodec from IllegalArgumentCodec

IdentifiableItemCodec is only used by KeyedListNodeCodecContext
and it is used directly. Detach it from IllegalArgumentCodec, making
peeling off one possibility from the class tree.

JIRA: MDSAL-704
Change-Id: I25a818eabe80d5bb3f6b4ff2d152e7ca002a93a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdd InstanceNotification(Publish)ServiceAdapter
Robert Varga [Wed, 6 Apr 2022 14:58:07 +0000 (16:58 +0200)]
Add InstanceNotification(Publish)ServiceAdapter

Add the binding/dom adapter to route requests towards the DOM service.
This necessitates a bit of work on the codec side to allow generic
notification translation service.

JIRA: MDSAL-494
Change-Id: I6f98304aa475717ae4a0fb0e8fb2fb5b5a659336
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove superfluous @NonNull
Robert Varga [Sun, 10 Apr 2022 22:51:29 +0000 (00:51 +0200)]
Remove superfluous @NonNull

Nullness is specified by the contract, no need to repeat it.

Change-Id: I27d846125faea0b5cd083f342b61f269cefec257
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRequire yang.binding
Robert Varga [Sun, 10 Apr 2022 22:48:53 +0000 (00:48 +0200)]
Require yang.binding

We are referencing yang.binding constructs, make sure we require them
transitively.

Change-Id: I84ab5f4e585f469fea05fa91298a035921c79322
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoCentralize MoreObjects import
Robert Varga [Fri, 8 Apr 2022 14:31:57 +0000 (16:31 +0200)]
Centralize MoreObjects import

We are importing MoreObjects through Class, let's go through
JavaTypeName, centralized in JavaFileTemplate. Also use 'var' to elide
the need to refer to it twice.

Change-Id: Id7fa0625e8d939195654b710e5f9847303c33861
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImport java.lang.reflect.Type
Robert Varga [Fri, 8 Apr 2022 15:05:15 +0000 (17:05 +0200)]
Import java.lang.reflect.Type

Simplify references to make things a tad easier.

Change-Id: I920b633b48b496156eaca2e90ed388adeba41d7e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove unused lines
Robert Varga [Fri, 8 Apr 2022 14:04:19 +0000 (16:04 +0200)]
Remove unused lines

We have commented-out imports and a superfluous empty line. Remove them.

Change-Id: I91b8dca0041b50baefa032ccff2e4d02a781605a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImport yang-binding
Robert Varga [Fri, 8 Apr 2022 13:18:50 +0000 (15:18 +0200)]
Import yang-binding

We are referencing a number of constructs here, make sure we also
import the module.

Change-Id: I8b1823046c762e33cc99e1471ee5965ab57e233b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSplit out isBitsType()
Robert Varga [Fri, 8 Apr 2022 10:38:44 +0000 (12:38 +0200)]
Split out isBitsType()

Simplify dispatch of checking to a separate method.

Change-Id: I59e3baf22bf99ead66f43c7df0fd62ab2b030894
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix Automatic-Module-Name declarations
Robert Varga [Wed, 6 Apr 2022 14:57:27 +0000 (16:57 +0200)]
Fix Automatic-Module-Name declarations

The declaration should be in <instructions/>, otherwise it is not
effective.

Change-Id: I82aeeaf9c68791ea171853f238afc6a9bafe9661
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFixup BindingStreamEventWriter javadoc
Robert Varga [Tue, 5 Apr 2022 15:31:10 +0000 (17:31 +0200)]
Fixup BindingStreamEventWriter javadoc

JDK17 is picky and the class documentation is a mess anyway. Fix it up.

Change-Id: If7e656b9f3336b9a0cffcc9f64c17eb9853fc919
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSuppress warning around pathArgument
Robert Varga [Tue, 5 Apr 2022 15:05:15 +0000 (17:05 +0200)]
Suppress warning around pathArgument

For some strange reason SE_BAD_FIELD is triggered with JDK17. The
warning is a false positive, as we are handling serialization via
Externalizable proxy.

Change-Id: I4035194852f6b0a914d76929124d92ca8d3039fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix union stringValue() with Decimal64
Robert Varga [Thu, 31 Mar 2022 20:25:15 +0000 (22:25 +0200)]
Fix union stringValue() with Decimal64

UnionTemplate still things decimal64 maps to java.math.BigInteger,
resulting in string conversion which does not compile. Fix the template
to recognize Decimal64 as a proper CanonicalValue.

JIRA: MDSAL-738
Change-Id: I0f161b62887f4aea6e0c625d105e48a20c8dc048
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix a typo in UnionTemplate
Robert Varga [Fri, 1 Apr 2022 08:45:57 +0000 (10:45 +0200)]
Fix a typo in UnionTemplate

We have an extra empty line and mis-spelled 'assigned'.

Change-Id: I058213a3408780ea13249679c0cca4ba21e8a9e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump versions to 9.0.2-SNAPSHOT
Robert Varga [Fri, 25 Mar 2022 13:40:17 +0000 (14:40 +0100)]
Bump versions to 9.0.2-SNAPSHOT

This starts the next development iteration.

Change-Id: I93eac4d2cf3607265434359543ba5d8808815446
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump yangtools to 8.0.2
Robert Varga [Thu, 24 Mar 2022 15:42:10 +0000 (16:42 +0100)]
Bump yangtools to 8.0.2

Pick up bugfixes and features from upstream.

Change-Id: I714d308d6a602c075aa59000650296d8b5cfd2d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump versions to 9.0.1-SNAPSHOT
Robert Varga [Sat, 19 Mar 2022 12:38:01 +0000 (13:38 +0100)]
Bump versions to 9.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: I7fed52e8ddd7348e1e0aac90e2af7ac792ca5226
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoIgnore empty augmentations at runtime
Robert Varga [Sun, 20 Mar 2022 11:11:34 +0000 (12:11 +0100)]
Ignore empty augmentations at runtime

We may end up generating an augmentation for a semantically-empty
construct, which in turn will not have a valid AugmentationIdentifier.
Ignore sure augmentations in codec.

JIRA: MDSAL-735
Change-Id: Ibb279a6b554c49857d0ee2ae0108d4d424939d02
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUpdate mdsal-binding-dom-codec-api modele-info
Robert Varga [Sat, 19 Mar 2022 10:43:38 +0000 (11:43 +0100)]
Update mdsal-binding-dom-codec-api modele-info

We are exposing yang.model.api to users, make sure we require it
transitively.

Change-Id: I97e28c4f080ca3e40869b532ad2cf9b6ff96d07f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse declared statements to resolve augments
Robert Varga [Fri, 18 Mar 2022 18:37:28 +0000 (19:37 +0100)]
Use declared statements to resolve augments

When trying to map effective instantiated model back to our Generator
hierarchy we need to not get confused by namespaces. The simplest way
to do that is to pick out augmentations first -- as those are the only
ones what can actually differ in namespace. The rest can be taken care
of just based on localName, as we are dealing with
SchemaTreeEffectiveStatements.

In general we can make the connection by tracing back the path we have
taken towards the instantiation site when seeing an
AugmentEffectiveStatement and match it to the corresponding
AbstractAugmentGenerator. Normally we could do this via straight
comparison of AugmentEffectiveStatements, but unfortunately their
equality contract does not give us that.

The reason for that is that we reuse things across groupings, whereas
YANG parser creates separate instantiations -- hence this breaks down
with UsesAugmentGenerator. We deal with that by comparing the declared
view of the two statements -- and those are guaranteed to be unique.

JIRA: MDSAL-735
Change-Id: I4d8f0e50541b53620cc5b0a2170484e85e9cf717
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoOptimize AbstractCompositeRuntimeType storage
Robert Varga [Thu, 17 Mar 2022 22:01:26 +0000 (23:01 +0100)]
Optimize AbstractCompositeRuntimeType storage

Storage on schema tree does not allow for duplicates. Rather than
allocating a full Map, let's use arrays and associated binary search.
This allows us to drop the storage requirements, especially for choices,
which would end up allocating an object to contain Map.values()
representation.

This results in O(log2(N)) lookups instead of O(1), plus some additional
code, but the lookups are one-off and so well worth the reduced
footprint. A further improvement is that we relax type safety down to
Object, which allows us to not allocate singleton arrays.

Change-Id: Ice6f07a7f853bd68c614a42eda6cc1d3fd2c184e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRework AugmentRuntimeType and Choice/Case linkage
Robert Varga [Mon, 14 Mar 2022 19:36:49 +0000 (20:36 +0100)]
Rework AugmentRuntimeType and Choice/Case linkage

Augmentations and their interactions with runtime linkage are a strange
beast. Not through YANG semantics, which is very simple. The
complication is Binding Specification reusing statement interfaces
across 'grouping'/'uses' boundaries. This poses distinct challenges as
for a particular GeneratedType we may have multiple augmentations,
which:
- may be completely unrelated. Binding Spec does not provide its usual
  compile-time safety guarantees because it basically says transporting
  anything across grouping boundaries is mostly okay as long as you
  augment all instantiations of the grouping the same way. That is a
  very sensible trade-off, as it allows, for example, no-frills movement
  of data from RPC 'input'/'output' and 'notification' structures to
  and from the datastore. More importantly it allows transportation
  across datastore subtrees, which enables very easy derivation
  pipelines
- but they have to obey YANG namespacing rules, which means that when we
  are interfacing towards yang.data.api (or any YANG-conforming
  projection), we have to make sure the constructs are aligned and also
  perform automated repair & recovery based on Binding Spec assumptions.

Current code behaves incorrectly in this respect, as it does not perform
correct expanstion of 'uses/augments' in one part, and then considers
all augments in when trying to look up a statement -- easily wandering
off into augments which are not appropriate through the YANG scope.

Fix this by correctly tracking with augments are valid in a particular
scope and carefully resolving them.

As a further side-effect of this, the choice/case relationship is
reworked to prevent potential recursion problems and rather expose the
ambiguos linkages in BindingRuntimeTypes.

We also separate CompositeRuntimeType from AugmentableRuntimeType, so
there is a clear distinction which types can be targeted by Augmentable
interfaces and which cannot.

JIRA: MDSAL-731
Change-Id: I027bbfa4ea8315b11b9348f5e0928626de3103a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove AbstractExplicitGenerator.recursiveRuntimeType()
Robert Varga [Sun, 13 Mar 2022 23:05:02 +0000 (00:05 +0100)]
Remove AbstractExplicitGenerator.recursiveRuntimeType()

A potential identified in the bug report is repetitive creation
of the same runtime type, when it clearly should be reused.
Make sure we recognize when we are dealing with the same statement
and eliminate one Optional.map() indirection.

JIRA: MDSAL-735
Change-Id: Iaa97a04f58465b302666ca082a887fde9616282a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImprove Decimal64 range support
Robert Varga [Sun, 13 Mar 2022 23:55:26 +0000 (00:55 +0100)]
Improve Decimal64 range support

We have classImporter available during generation, hence we can neatly
import Decimal64, reducing boiler plate in range and value declarations.

Decimal64 also exposes a fast instantiation type with scale and unscaled
value -- use those instead of parsing strings.

Change-Id: Ieba07af36fa3d03e20fda0c65754ec2dbfeee451
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump yangtools to 8.0.1
Robert Varga [Sun, 13 Mar 2022 15:19:47 +0000 (16:19 +0100)]
Bump yangtools to 8.0.1

There is a YANGTOOLS release for the snapshots we are using, adopt it
in preparation for our release.

Change-Id: I81cc41ed615541c44efc256290167518d89b16a4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSplit out BindingDataObjectCodecTreeNode.streamChild()
Robert Varga [Sat, 12 Mar 2022 13:17:40 +0000 (14:17 +0100)]
Split out BindingDataObjectCodecTreeNode.streamChild()

BindingCodecTree does not have a way of entering the tree without
specifying an InstanceIdentifier construct. This is a mistake, as we
need more powerful addressing capabilities to be able to deal with
Notifications and other constructs.

SchemaRootCodecContext is then taught to handle Notifications specially,
now that they cannot legally come from InstanceIdentifier.

JIRA: MDSAL-730
Change-Id: I970cab36d2794472ef801cd0e0d67c264bd169f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRefactor InstanceIdentifier.create(Iterable)
Robert Varga [Sat, 12 Mar 2022 12:41:25 +0000 (13:41 +0100)]
Refactor InstanceIdentifier.create(Iterable)

This method is for things like binding/dom codec and similar users who
know what they are doing. Rename the method to 'unsafeOf()', so that the
compilation failures from the change in InstanceIdentifier.create(Class)'s
signature do not produce confusing guidance by pointing to this arcane
method.

Also document this method's purpose, with significant warning and update
it to take a List.

JIRA: MDSAL-730
Change-Id: I9def3750f16d87c11d12809e0f067daf0bf352b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix identityref wildcards
Robert Varga [Fri, 11 Mar 2022 19:09:22 +0000 (20:09 +0100)]
Fix identityref wildcards

Identityref use Class<? extends Target> for their return types, hence
we mask unmask the ParameterizedType to Target's JavaTypeName.

JIRA: MDSAL-732
Change-Id: I96fd0ffcffcd65aa7c658ab9d881a950ba41c6cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImprove CodeHelpers coverage
Robert Varga [Sat, 12 Mar 2022 07:25:59 +0000 (08:25 +0100)]
Improve CodeHelpers coverage

We have introduced a new helper, make sure it is covered by UT.

JIRA: MDSAL-722
Change-Id: I5b949c5aac60cf1b90ba98b38afdce09dd08fff4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoReuse ownGetterType
Robert Varga [Sat, 12 Mar 2022 01:30:15 +0000 (02:30 +0100)]
Reuse ownGetterType

There is no point in acquiring the type again, just use the local
variable.

Change-Id: If6ea83c6a0e4c0af4f4966a85abf9eff765abf18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoInclude namespace manipulations in error report
Robert Varga [Sat, 12 Mar 2022 03:41:11 +0000 (04:41 +0100)]
Include namespace manipulations in error report

We need squashing information to make sense of what the requirement
is attempting to do, include it in toString().

Change-Id: Ieeb913680990acb5ccd8690b28c55e4a72f5836e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoEnforce InstanceIdentifier creation
Robert Varga [Fri, 11 Mar 2022 06:48:14 +0000 (07:48 +0100)]
Enforce InstanceIdentifier creation

We currently allow an InstanceIdentifier to be created for any
DataObject, which is wrong, as that includes raw RpcInputs,
Notifications and the like.

Update create() method to require proper relationship with DataRoot
instances. Alternatives can be worked through instantiating a proper
builder.

Also enforce individual items to always have the proper type.

JIRA: MDSAL-370
Change-Id: I38e83760c0ec29613a9ded24c0783bef940c9b7e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoModernize ExceptionReportingTest
Robert Varga [Fri, 11 Mar 2022 08:05:22 +0000 (09:05 +0100)]
Modernize ExceptionReportingTest

Use assertThrows() instead of @Test(expected = ) and make sure we
do not perform active operations during class init.

Change-Id: I54b54ebe1f98d632878c9359e7dc42aa1d44d803
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImprove internal cast
Robert Varga [Fri, 11 Mar 2022 06:39:17 +0000 (07:39 +0100)]
Improve internal cast

Checking for ImmutableCollection before going to Iterable is not quite
obvious, use a cast to ImmutableCollection.

Change-Id: I3e06a81126ed24310f78e2dc97ceab23be537141
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAlways generate DataRoot interface
Robert Varga [Wed, 9 Mar 2022 15:17:45 +0000 (16:17 +0100)]
Always generate DataRoot interface

Having a reliable top-level interface is quite convenient for reasoning
about the modules generated. It also allows us to make further
assumption that a ModuleRuntimeType is always present, simplifying
things at runtime.

JIRA: MDSAL-729
Change-Id: Ia83e1910f80abb82ed32760afbd083b414033eb2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix StatementRepresentation javadoc
Robert Varga [Wed, 9 Mar 2022 04:53:17 +0000 (05:53 +0100)]
Fix StatementRepresentation javadoc

We have some outdated documentation, fix that up.

Change-Id: I305b58a92363830c473b1bb103dc1127de3bd3dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdopt odlparent-10.0.0/yangtools-8.0.0-SNAPSHOT
Robert Varga [Thu, 2 Sep 2021 19:23:37 +0000 (21:23 +0200)]
Adopt odlparent-10.0.0/yangtools-8.0.0-SNAPSHOT

Bump upstream versions to pick up dependency upgrades and major features
from yangtools. Also adjust code to package movements and fix test
models now that unique components are validated by YANG parser.

Change-Id: Id15dd16daea9fe80af030103069d999129b28cf6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRework BindingRuntimeTypes
Robert Varga [Fri, 29 Oct 2021 16:06:01 +0000 (18:06 +0200)]
Rework BindingRuntimeTypes

BindingRuntimeTypes serves to bring together GeneratedTypes and
SchemaNodes. We do this in a a number of different ways, but a lot of
the times this ends up looking a Type and then finding the SchemaNode
which generated it -- and then perhaps inquire children by SchemaNode
(which again is looked up in some way).

Once we have done these cross-lookups, we resolve the Type to a Class
through BindingRuntimeContext and instantiate a
DataContainerCodecPrototype, which holds these (and other) bits
together.

Current code relies on DerivableSchemaNode and SchemaNode-based lookups
to resolve these due to historical reasons. Our Generator infrastructure
already has AbstractExplicitGenerator.getOriginal() to perform the
equivalent operation.

This patch defines a RuntimeType base interface which holds together an
EffectiveStatement and a Generated type. We also define a
RuntimeTypeContainer to expose lookup methods for inquiring child
RuntimeTypes as appropriate.

BindingRuntimeTypes serves as the root of a tree hierarchy, where
RuntimeType is a leaf node and CompositeRuntimeType is an interior
node.

NodeCodecContext and its subclasses are modified to maintain a reference
to their backing RuntimeType and issue appropriate localized lookups.

JIRA: MDSAL-696
Change-Id: I45850d320e01fce0b227512b9f5f7b19331df60e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDo not use BindingReflections to acquire augmentations
Robert Varga [Mon, 7 Mar 2022 17:38:37 +0000 (18:38 +0100)]
Do not use BindingReflections to acquire augmentations

Augmentable interface exposes augmentations directly, hence we
can use it directly, without relying on reflection.

Change-Id: I21b86d581ff0a61db3975cf7655157e4e6678b1b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoTrack schema tree generator linkage
Robert Varga [Fri, 18 Feb 2022 10:49:16 +0000 (11:49 +0100)]
Track schema tree generator linkage

Runtime information requires looking up target generator for a schema
tree particant, which means that AbstractCompositeGenerator needs to
resolve QName to the original instantiation.

We already have that mechanics for the most part, as we need to perform
the lookup to resolve augment statements target.

Introduce SchemaTree{Child,Parent} decomposition of the addressing
problem, and retrofit generators to support them. This will allow us to
support lookups along the schema tree axis.

JIRA: MDSAL-696
Change-Id: I619fe9e7c0896d6d3f0f33b04d5200ca8ec30340
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImprove information provided on failed linkage progress
Robert Varga [Fri, 4 Mar 2022 18:53:05 +0000 (19:53 +0100)]
Improve information provided on failed linkage progress

Linkage algorithm seems to have a issue with a set of proprietary
models. Rather than throwing a simple exception, add debug logging
to track which items progress and report any remaining items as
suppressed exceptions.

Change-Id: Ia7f1efe498f1ac82de35facf0188d0a2972e2b09
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBindingRuntimeTypes should be an interface
Robert Varga [Fri, 25 Feb 2022 16:06:13 +0000 (17:06 +0100)]
BindingRuntimeTypes should be an interface

We do not want to expose the internals of how this interface is
realized, make sure we split it into an interface and an implementation.

JIRA: MDSAL-696
Change-Id: Icc01bc2c66cbf57c8cbb2ff9c32ac30c373b899d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImprove OriginalLink safety
Robert Varga [Thu, 24 Feb 2022 07:17:11 +0000 (08:17 +0100)]
Improve OriginalLink safety

The links to previous and original statement need to match our
statement, otherwise we are in trouble. While we do not verify this
at runtime (yet), improve type definitions to carry these around.

JIRA: MDSAL-696
Change-Id: I3bcc1c3b0d2e3f74a0727f8bfa6b2f1e1c578f67
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove is{List,Map}Type(Type) methods
Robert Varga [Fri, 11 Feb 2022 18:45:12 +0000 (19:45 +0100)]
Remove is{List,Map}Type(Type) methods

These methods are not used anywhere anymore remove them.

Change-Id: I993a2baf48b2603f28559688a907d1b7d7780307
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoMap system-ordered leaf-lists to Set<T>
Robert Varga [Fri, 11 Feb 2022 16:35:19 +0000 (17:35 +0100)]
Map system-ordered leaf-lists to Set<T>

System-ordered leaf-lists can get re-ordered and hence the binding
mapping to java.util.List is not appropriate. Make sure we map them
to java.util.Set.

JIRA: MDSAL-722
Change-Id: I4c82736b3ef25fd1197c446aca2c9d22a59a3d96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix an eclipse warning
Robert Varga [Thu, 3 Feb 2022 15:09:32 +0000 (16:09 +0100)]
Fix an eclipse warning

<T extends Optional<?>> is not liked because of Optional being final.
Fix the warning by changing the prototype a bit.

Change-Id: I8864b695e4affa01913df83721c63ff4fe6d5015
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4359b749c71d75f4b64e61dfe94822eb5406e0a2)

2 weeks agoImprove DtaContainerCodecProtype.loadInstance()
Robert Varga [Wed, 23 Feb 2022 13:04:54 +0000 (14:04 +0100)]
Improve DtaContainerCodecProtype.loadInstance()

We have a warning creeping here, fix it.

Change-Id: I94249f7cdc8f5fabdeee44084aaf0c325d62eb61
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoHide TypeBuilderFactory subclasses
Robert Varga [Wed, 23 Feb 2022 08:54:42 +0000 (09:54 +0100)]
Hide TypeBuilderFactory subclasses

TypeBuilderFactory subclasses are being checked for Codegen subclass,
so as to add (or not) documentation. Refactor addCodegenInformation()
by moving it to the factory, with Runtime ignoring doing nothing.

Change-Id: I724bd304de0ec1a51520e59e64b21d1060d7e013
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSeparate out notification handling
Robert Varga [Mon, 21 Feb 2022 13:34:38 +0000 (14:34 +0100)]
Separate out notification handling

This reverts another part of 073e62cf59225dbb11f80b50d59387f4830154b4
as well as 576ae2cd595f0ce17abd1f33150b068b7f0f801d, hence not allowing
Notifications to be entered through streamChild().

JIRA: MDSAL-724
Change-Id: I1b37139fcb8bd8aaf92465943a46e71069e87f3e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSeparate out RPC input/output codecs
Robert Varga [Tue, 22 Feb 2022 11:09:56 +0000 (12:09 +0100)]
Separate out RPC input/output codecs

This partially reverts 073e62cf59225dbb11f80b50d59387f4830154b4, as
leads to false sharing and corresponding problems with invalid
InstanceIdentifiers not being caught.

JIRA: MDSAL-724
Change-Id: I0ddf62efffb23e793b6727e0afcf50303f7aea74
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>