mdsal.git
3 years agoBe more defensive around List types 78/94478/3
Robert Varga [Thu, 7 Jan 2021 16:00:14 +0000 (17:00 +0100)]
Be more defensive around List types

We can end up generating a windcard type, in which case the arguments
will be empty. Use Types.objectType() in that case.

JIRA: MDSAL-651
Change-Id: I5fe15a1cd0eb4f10154c268fea2092dd52cd390a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix javadoc formatting in interfaces 83/94483/1
Robert Varga [Thu, 7 Jan 2021 17:37:55 +0000 (18:37 +0100)]
Fix javadoc formatting in interfaces

We end up generating two periods, fix that.

Change-Id: Ib270c8838ecca1b51b86be6e49633858fbf8af82
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate getDataChildByName() users 99/94299/3
Robert Varga [Thu, 24 Dec 2020 13:21:02 +0000 (14:21 +0100)]
Migrate getDataChildByName() users

This method has been deprecated, move to its nullable replacement.

Change-Id: I0c4353701cf423b5c6ae0b52ca5dd96945ceecec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump to odlparent-8.0.3/yangtools-6.0.3 77/94477/1
Robert Varga [Thu, 7 Jan 2021 14:03:40 +0000 (15:03 +0100)]
Bump to odlparent-8.0.3/yangtools-6.0.3

Pick up latest fixes from upstream.

Change-Id: Ia1da11a6d64ee4f12e65e0863057a40f5919973d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix module name reference 23/94323/1
Robert Varga [Thu, 31 Dec 2020 15:14:10 +0000 (16:14 +0100)]
Fix module name reference

Modules use UnqualifiedQName, which borks the javadoc by leaking
its 'toString()' representation. Fix that.

Change-Id: Iad120ff9fdf7e073f079ef8bf9c354fc04d04560
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUpdate mdsal-binding-dom-codec-spi JPMS 07/94307/1
Robert Varga [Thu, 24 Dec 2020 13:40:07 +0000 (14:40 +0100)]
Update mdsal-binding-dom-codec-spi JPMS

We are using checker annotations, mark that in module-info.

Change-Id: Ief86f6f09f07f9ca06a9a62536815682651b94c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDeprecate Producer/Consumer/Sharding APIs 89/94289/1
Robert Varga [Sun, 20 Dec 2020 22:16:25 +0000 (23:16 +0100)]
Deprecate Producer/Consumer/Sharding APIs

These APIs never saw adoption due to their complexity and lack of
applicability in real-world applications. Deprecate them for removal,
as they will be replaced with proper NMDA replacement.

Change-Id: I5c2eb21bde4b5c6b83cb8a0579307bf851a4f5fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUpdate mdsal-dom-api JPMS definition 88/94288/1
Robert Varga [Sun, 20 Dec 2020 21:52:44 +0000 (22:52 +0100)]
Update mdsal-dom-api JPMS definition

We are missing a few references here, fix them up.

Change-Id: I5a43649867883c2301da2eb7482fb4537f7dffc7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump versions to 7.0.4-SNAPSHOT 84/94284/1
Robert Varga [Sat, 19 Dec 2020 12:11:59 +0000 (13:11 +0100)]
Bump versions to 7.0.4-SNAPSHOT

This starts the next development iteraration.

Change-Id: Iee95c3ba478b52df34ecd9350ca926113cb9c86f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoTag generated classes with Generated annotation 00/94000/9
Iaroslav [Wed, 2 Dec 2020 09:18:34 +0000 (11:18 +0200)]
Tag generated classes with Generated annotation

After this patch @javax.annotation.processing.Generated will be added
to Generated source Java files.

JIRA: MDSAL-597
Change-Id: I377b0be5e4815e428d53a99f9528e46c67e352aa
Signed-off-by: Iaroslav <iaroslav.kholiavko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoSpecialize relative leafref types during instantiation 01/88401/86
miroslav.kovac [Wed, 11 Mar 2020 15:42:29 +0000 (16:42 +0100)]
Specialize relative leafref types during instantiation

leaf of relative leafref type declared in grouping could reference
node outside of it. In such case target node of leafref depends on
location where its origin grouping used. Before property from
relative leafref was calculated from its origin grouping and this
property were used at all GeneratedTypes produced from the
grouping users.

When leafref pointed outside of its origin grouping, Object for leaves,
List<?> for leaf-list were used as property type. Now type resolving is
running from locations, where relative leafref is added by uses and its
ancestors grouping do not add a node at the leafref path.

JIRA: MDSAL-426
JIRA: MDSAL-533
Change-Id: I5004f0579778527511b4b028e00f7ab9c3051731
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
Signed-off-by: Ilya Igushev <illia.ihushev@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoChange `is` to `get` in generated classes 48/94148/11
Robert Varga [Fri, 18 Dec 2020 17:08:16 +0000 (18:08 +0100)]
Change `is` to `get` in generated classes

In generated classes for Boolean types getters should be as in other
types. e.g.: `isBoolData` should be `getBoolData`.

We generate compatibility methods, so users have some time to migrate.

JIRA: MDSAL-426
Change-Id: Id7386520484dbedf2b7772ab586b476983ca33f2
Signed-off-by: Iaroslav <iaroslav.kholiavko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix replicate's parent version 43/94243/2
Robert Varga [Tue, 15 Dec 2020 08:25:51 +0000 (09:25 +0100)]
Fix replicate's parent version

We are referencing odlparent at wrong version here, fix that up.

Change-Id: I4506d216d251757e0208dc9abe5629c05ee510cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove getter @Nullable annotations for non-List/Map types 24/94024/4
Iaroslav [Fri, 4 Dec 2020 10:36:44 +0000 (12:36 +0200)]
Remove getter @Nullable annotations for non-List/Map types

In generated types getter will no longer be marked @Nullable annotation
for non List and Map types.

Jira: MDSAL-603
Change-Id: I2ad00e625f652399e184fca1a7a00d3ed36d3dff
Signed-off-by: Iaroslav <iaroslav.kholiavko@pantheon.tech>
3 years agoBump upstream versions 23/94223/1
Robert Varga [Mon, 14 Dec 2020 12:04:20 +0000 (13:04 +0100)]
Bump upstream versions

Adopt odlparent-8.0.2 and yangtools-6.0.2 for the fixes they
contain.

Change-Id: I916bdb3a122f3a368245df2446bb3673b52b1d00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoEliminate blueprint from replicate-netty 83/93983/9
tadei.bilan [Tue, 1 Dec 2020 12:30:21 +0000 (14:30 +0200)]
Eliminate blueprint from replicate-netty

Replace blueprint with OSGI DS

JIRA: MDSAL-588
Change-Id: Idc9053adac0a7f137727f47297d920878916d6ae
Signed-off-by: tadei.bilan <tadei.bilan@pantheon.tech>
3 years agoFix checkstyle 08/94208/2
Robert Varga [Fri, 11 Dec 2020 10:56:56 +0000 (11:56 +0100)]
Fix checkstyle

Upgraded checkstyle is a bit touchier about anonymous classes,
fix reported violations.

Change-Id: I98d060ed9c44d49ae57f1b9fce33527fa6bcd48d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUpdate ChoiceNodeCodecContext 83/94183/3
Robert Varga [Fri, 11 Dec 2020 02:03:43 +0000 (03:03 +0100)]
Update ChoiceNodeCodecContext

Sonar does not like code in comments, promote them to class
javadoc, which will silence Sonar and is overall a Good Thing(tm).

Change-Id: I0a8150cfbcd9a82abf5e94a2a56c7444634ee9da
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix a sonar complaint 88/94188/2
Robert Varga [Fri, 11 Dec 2020 02:41:24 +0000 (03:41 +0100)]
Fix a sonar complaint

Sonar wants us to merge the two if statements, which makes sense.
Also use a method reference instead of a full lambda.

Change-Id: I465ab536ab9b5bedde870b741a47becbc271ca8b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd private ServiceLoaderState constructors 87/94187/4
Robert Varga [Fri, 11 Dec 2020 02:24:43 +0000 (03:24 +0100)]
Add private ServiceLoaderState constructors

These three classes are pure field holders, hence they should have
private constructors.

Change-Id: I02818541a7a20808d3fc6f35b56e40c993a9ca94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoShortcut StringBuilder.append(boolean) 86/94186/4
Robert Varga [Fri, 11 Dec 2020 02:19:36 +0000 (03:19 +0100)]
Shortcut StringBuilder.append(boolean)

We are using an if/else statement for a simple boolean append,
refactor it so we pass an expression.

Change-Id: I4924db1276bec0a1e3d2e16e37a8bfe181086422
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix a Sonar logic complaint 85/94185/3
Robert Varga [Fri, 11 Dec 2020 02:14:20 +0000 (03:14 +0100)]
Fix a Sonar logic complaint

Invert the condition so that we can use a simple expression instead
of a if/else.

Change-Id: I8e1662e82706a8c6b6c7884258fe9e6010e4f2b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup DataObjectCodecContext 84/94184/3
Robert Varga [Fri, 11 Dec 2020 02:10:02 +0000 (03:10 +0100)]
Cleanup DataObjectCodecContext

We have an unneeded if/else here, merge it together for better
expresiveness. Also clean up comments a bit and log exceptions
encountered.

Change-Id: Ie8e1eca4b2019906fe653f07659aafd85bd88c3d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove QueryStructureException throws declaration 82/94182/1
Robert Varga [Fri, 11 Dec 2020 01:49:56 +0000 (02:49 +0100)]
Remove QueryStructureException throws declaration

QueryStructureException is a runtime exception, hence does not need
to be declared.

Change-Id: I36e617d9c917e44caea05e0898b8bc0318d6ba9b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove TransformerGeneratorException 81/94181/1
Robert Varga [Fri, 11 Dec 2020 01:45:36 +0000 (02:45 +0100)]
Remove TransformerGeneratorException

This exception is not used anywhere and is package-private, remove
it.

Change-Id: I11378d5e94b276c331ede10d23bf333152ed6e2f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoImprove DataObjectBuilder augmentation handling 30/93830/2
Tadei Bilan [Fri, 13 Nov 2020 14:50:04 +0000 (16:50 +0200)]
Improve DataObjectBuilder augmentation handling

Remove unnecessary "@SuppressWarnings("unchecked")" line.

JIRA: MDSAL-642
Signed-off-by: tadei.bilan <tadei.bilan@pantheon.tech>
Change-Id: Ia457867e9d2da31ddb76f8bfb465cdfb07f18e6a

3 years agoBump versions to 7.0.3-SNAPSHOT 38/93838/1
Robert Varga [Sun, 15 Nov 2020 21:48:15 +0000 (22:48 +0100)]
Bump versions to 7.0.3-SNAPSHOT

This starts the next development iteration.

Change-Id: I9a49f856b1128bb83f3987fea72081f353074ca2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDereference namespace 84/93784/2
Robert Varga [Wed, 11 Nov 2020 17:10:56 +0000 (18:10 +0100)]
Dereference namespace

Module.getNamespace() is deprecated, use indirection through
QNameModule to get the namespace.

Change-Id: I93b4083800c235bd75d53ec328311de60b99cd7a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMerge codec contexts caches 66/91366/11
illia.ihushev [Fri, 17 Jul 2020 09:50:33 +0000 (12:50 +0300)]
Merge codec contexts caches

Probably performance wise RPC, Data and Notification loading cache
should be merge. Needs microbenchmark to determine which is
faster(keeping them separate or in same cache).

Change-Id: I0bdb4a67a0d77b0b9e905caebf6b5e7381cb3bf7
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup SchemaRootCodecContext formatting 87/93787/2
Robert Varga [Wed, 11 Nov 2020 18:53:20 +0000 (19:53 +0100)]
Cleanup SchemaRootCodecContext formatting

Java 11 gives us <> on anonymous subclasses, hence we can clean up
quite a bit here.

Change-Id: I8c768a07535a6dde7c08d361b98349eb97d62774
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCache BindingDOMCodecServices in tests 85/93785/2
Robert Varga [Wed, 11 Nov 2020 17:35:43 +0000 (18:35 +0100)]
Cache BindingDOMCodecServices in tests

When we are testing we can end up with a multitude of tests
reusing the same BindingRuntimeContext (due to
AbstractSchemaAwareTest caching). Since BindingCodecContext contains
non-trivial amount of state which is derived from it, including
loaded classes, let's attempt to reuse it as much as possible.

Change-Id: Ib41a7f4060c62bd53c2346bae51f055768dce0db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd a missing annotation requires 83/93783/1
Robert Varga [Wed, 11 Nov 2020 15:31:31 +0000 (16:31 +0100)]
Add a missing annotation requires

We are using @SuppressFBWarnings, add them.

Change-Id: I34f5b1f8335702f5ddae9b989ade5503a9f0af42
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup SchemaNode mocks 40/93740/1
Robert Varga [Tue, 10 Nov 2020 15:26:34 +0000 (16:26 +0100)]
Cleanup SchemaNode mocks

We have a few testing SchemaNodes, clean up warnings and unneeded
methods.

Change-Id: I4ad599805ac4f9754cb80d523702ed522e6ccfb3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-binding-generator-impl to a JPMS module 14/93714/2
Robert Varga [Mon, 9 Nov 2020 17:10:44 +0000 (18:10 +0100)]
Convert mdsal-binding-generator-impl to a JPMS module

The implementation here is quite simple, convert it to a JPMS module.
Since we are breaking encapsulation the now-defunct YangTextTemplateTest
is removed. Also src/test/resources/ietf is renamed to ietf-models
to make it an unencapsulated resource.

JIRA: MDSAL-644
Change-Id: I9db57ed04b8188cefa91b644d434e2b1619e4d4b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-binding-generator-util to a JPMS module 13/93713/2
Robert Varga [Mon, 9 Nov 2020 16:41:03 +0000 (17:41 +0100)]
Convert mdsal-binding-generator-util to a JPMS module

This is a simple utility artifact, convert it to a module.

JIRA: MDSAL-643
Change-Id: I0b5428b5e53fd4fe58d0ffc9ad0b99328d23129f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-binding-util to a JPMS module 82/93682/2
Robert Varga [Sun, 8 Nov 2020 11:56:07 +0000 (12:56 +0100)]
Convert mdsal-binding-util to a JPMS module

This is a widely used utility artifact. Convert it to JPMS.

Change-Id: Ic636b6f513d79ec495abb7d1d83a899712126f8e
JIRA: MDSAL-634
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-singleton-dom-impl to a JPMS module 81/93681/3
Robert Varga [Sun, 8 Nov 2020 11:24:04 +0000 (12:24 +0100)]
Convert mdsal-singleton-dom-impl to a JPMS module

This is a simple implementation, convert it to JPMS, providing
integration with various DI frameworks. We also minimize dependencies

JIRA: MDSAL-640
Change-Id: I00724709bd557dbbd814942fe0968390317073dd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-singleton-common-api to a JPMS module 80/93680/3
Robert Varga [Sun, 8 Nov 2020 11:02:29 +0000 (12:02 +0100)]
Convert mdsal-singleton-common-api to a JPMS module

This is a very simple API component, convert it to a JPMS module,
also adjusting its dependencies.

JIRA: MDSAL-639
Change-Id: I68364c2b3e008cb4954d6693152c2a6bffc14373
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove unneeded mdsal-eos-binding-api dependencies 79/93679/3
Robert Varga [Sun, 8 Nov 2020 10:55:17 +0000 (11:55 +0100)]
Remove unneeded mdsal-eos-binding-api dependencies

There are a number of dependencies we are not using, remove them.

Change-Id: I9b823c766eb9f7f1305f1a2d9aebe00c85cf4501
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-eos-dom-simple to a JPMS module 78/93678/4
Robert Varga [Sun, 8 Nov 2020 09:55:26 +0000 (10:55 +0100)]
Convert mdsal-eos-dom-simple to a JPMS module

This is a simple implementation of the DOMEntityOwnershipService
contract. Turn it into a JPMS module, removing the internal package
visibility and exposing DI class from a separate package.

Since we are in the area, also clean up UT, eliminating unneeded
mocking.

JIRA: MDSAL-638
Change-Id: Ifd0b0a6575e39b619868b251abfce6d2a2a340d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-eos-dom-api to a JPMS module 77/93677/2
Robert Varga [Sun, 8 Nov 2020 09:35:16 +0000 (10:35 +0100)]
Convert mdsal-eos-dom-api to a JPMS module

This is a very simple API, convert it to a JPMS module.

JIRA: MDSAL-637
Change-Id: If430e831d4254b20e6f3bf7cbfd2da354a47caf3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-eos-common-spi to a JPMS module 76/93676/1
Robert Varga [Sun, 8 Nov 2020 09:14:25 +0000 (10:14 +0100)]
Convert mdsal-eos-common-spi to a JPMS module

This is really simple SPI, convert it to a JPMS module.

JIRA: MDSAL-636
Change-Id: I452b4bf5599550b1e76a63fce133cfeba1544230
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-eos-common-api to a JPMS module 75/93675/1
Robert Varga [Sun, 8 Nov 2020 09:10:46 +0000 (10:10 +0100)]
Convert mdsal-eos-common-api to a JPMS module

This is really simple API, convert it to a JPMS module.

JIRA: MDSAL-635
Change-Id: Ia4afd9ccb9c3743994cc1687c14974189d046086
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-yanglib-api to a JPMS module 70/93670/1
Robert Varga [Sat, 7 Nov 2020 09:55:26 +0000 (10:55 +0100)]
Convert mdsal-yanglib-api to a JPMS module

This is a very simple API component, convert it to JPMS.

JIRA: MDSAL-628
Change-Id: Ic9c69ef5332f9617a953521ac511e58e98044f68
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-binding-dom-codec-spi to JPMS 69/93669/1
Robert Varga [Sat, 7 Nov 2020 09:47:25 +0000 (10:47 +0100)]
Convert mdsal-binding-dom-codec-spi to JPMS

This is a very simplistic SPI component, convert it to JPMS.

JIRA: MDSAL-633
Change-Id: I2ef9e3f262ef70d1dd6e221ba69199207626245e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-binding-dom-codec-api to JPMS 68/93668/1
Robert Varga [Sat, 7 Nov 2020 09:35:54 +0000 (10:35 +0100)]
Convert mdsal-binding-dom-codec-api to JPMS

This is a very simplistic API component, convert it to JPMS.

JIRA: MDSAL-632
Change-Id: Ie3d7e264f750d9d0f373e334f18cb6294cced9d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-binding-spi to a JPMS module 67/93667/1
Robert Varga [Sat, 7 Nov 2020 09:23:16 +0000 (10:23 +0100)]
Convert mdsal-binding-spi to a JPMS module

This is a simple component, convert it to a JPMS module.

JIRA: MDSAL-631
Change-Id: Ia539cdac1ae672929357bccd5637418932a9a01b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix warnings in unified.doc.generator 66/93666/1
Robert Varga [Fri, 6 Nov 2020 23:51:01 +0000 (00:51 +0100)]
Fix warnings in unified.doc.generator

We are getting an Xtend warning from unused imports and unnecessary
casts. Fix them up.

Change-Id: Ic28a24616909e6f5d0bbee7076fdc57743f2af51
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-binding-api to a JPMS module 65/93665/1
Robert Varga [Fri, 6 Nov 2020 23:44:49 +0000 (00:44 +0100)]
Convert mdsal-binding-api to a JPMS module

This is a simple API, convert it to a module.

JIRA: MDSAL-630
Change-Id: Id41e513b26f0a58e85534b91533af70568db4a6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-binding-runtime-spi to a JPMS module 43/93643/1
Robert Varga [Fri, 6 Nov 2020 22:38:45 +0000 (23:38 +0100)]
Convert mdsal-binding-runtime-spi to a JPMS module

This is a bit involved, as we are using the parser and a couple of
services. Nevertheless convert the artifact.

JIRA: MDSAL-627
Change-Id: I16bbbe77e2500125512ed57fa22c396e2f662ade
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-binding-spec-util to a JPMS module 42/93642/2
Robert Varga [Fri, 6 Nov 2020 22:25:32 +0000 (23:25 +0100)]
Convert mdsal-binding-spec-util to a JPMS module

We have a number of utilities, let's make sure they are properly
encapsulated.

JIRA: MDSAL-629
Change-Id: I06183508f52b7e5ec023e88b4ac1c983d2f4a26c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-binding-runtime-api to a JPMS module 40/93640/1
Robert Varga [Fri, 6 Nov 2020 20:36:42 +0000 (21:36 +0100)]
Convert mdsal-binding-runtime-api to a JPMS module

This is a very simple artifact, convert it to a JPMS module.

JIRA: MDSAL-625
Change-Id: I6a24724580c26509fb58fb3d5962cb8613ddec3a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert yang-binding to a JPMS module 39/93639/1
Robert Varga [Fri, 6 Nov 2020 19:01:32 +0000 (20:01 +0100)]
Convert yang-binding to a JPMS module

The code itself is simple, just export it. UTs need an override
to allow use of Whitebox.

JIRA: MDSAL-624
Change-Id: I1d1114473563fe9237df5855ef95c45318cd2ec9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd build of odl-mdsal-model-rfc8795-non-nmda 35/93635/4
Robert Varga [Fri, 6 Nov 2020 18:28:35 +0000 (19:28 +0100)]
Add build of odl-mdsal-model-rfc8795-non-nmda

We have forgotten to build this feature, make sure it is published.

JIRA: MDSAL-626
Change-Id: I635e61116758009da3a319529238c267366d460c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-binding-generator-api to a JPMS module 34/93634/3
Robert Varga [Fri, 6 Nov 2020 17:33:29 +0000 (18:33 +0100)]
Convert mdsal-binding-generator-api to a JPMS module

This is a very simple artifact, convert it to a JPMS module. We
will need to split it the next release.

Change-Id: I28e42a8b1662f5a33721c54341d5b050d88b291d
JIRA: MDSAL-623
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove mdsal-binding-generator-api's dependency on yang-binding 33/93633/3
Robert Varga [Fri, 6 Nov 2020 17:25:42 +0000 (18:25 +0100)]
Remove mdsal-binding-generator-api's dependency on yang-binding

mdsal-binding-generator-api is a standalone API with no requirement
on yang-binding. Remove the dependency.

Change-Id: If05da0b14fd65ba0aa34dcc024401d175df88652
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-dom-spi to a JPMS module 32/93632/2
Robert Varga [Fri, 6 Nov 2020 16:33:11 +0000 (17:33 +0100)]
Convert mdsal-dom-spi to a JPMS module

This is a very simple artifact, convert it to a JPMS module. Since
this forces us to clean up our encapsulation, also deal with migrating
tests to MockitoJUnitRunner.StrictStubs.

JIRA: MDSAL-622
Change-Id: I538f720c65c13986e240a499faba99f16698c3cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-dom-api to a JPMS module 31/93631/2
Robert Varga [Fri, 6 Nov 2020 16:22:10 +0000 (17:22 +0100)]
Convert mdsal-dom-api to a JPMS module

This is a very simple artifact, convert it to a JPMS module.

JIRA: MDSAL-621
Change-Id: I2bb4083010bb3bdb4dfa61f18ebf7b0db5299a92
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert mdsal-common-api to a JPMS module 30/93630/2
Robert Varga [Fri, 6 Nov 2020 16:15:21 +0000 (17:15 +0100)]
Convert mdsal-common-api to a JPMS module

This is a very simple artifact, convert it to a JPMS module.

JIRA: MDSAL-620
Change-Id: I20a73390bd4ccee8bfff74fe08a0be038ccea811
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor FileSearchUtil 84/93584/9
Illia [Wed, 4 Nov 2020 15:05:15 +0000 (17:05 +0200)]
Refactor FileSearchUtil

Migrate to Java 11.
Add method for verifying containment of consecutive lines.
Add methods which add different level indentation.

Change-Id: I54fff1d1f840375102eed479a3cb338085e03762
Signed-off-by: Illia <illia.ihushev@pantheon.tech>
3 years agoBump odlparent/yangtools to 8.0.1/6.0.1 21/93621/1
Robert Varga [Fri, 6 Nov 2020 12:24:56 +0000 (13:24 +0100)]
Bump odlparent/yangtools to 8.0.1/6.0.1

Pick up latest fixes from upstream.

Change-Id: I818d72880f2da4491cd0daa1d856360c9cd59d45
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix GeneratorImpl checkstyle 20/92820/17
Illia [Wed, 30 Sep 2020 23:38:53 +0000 (02:38 +0300)]
Fix GeneratorImpl checkstyle

Move resources closing to finally block, verify folder creation.
Eliminate Xtend "dispatch" usage. Rewrite to its Java implementation.

Change-Id: I1d709d3a9007d2ee69512f4293771dcc06e1a4eb
Signed-off-by: Illia <illia.ihushev@pantheon.tech>
3 years agoRemove unneeded constants 07/93607/1
Robert Varga [Thu, 5 Nov 2020 14:56:55 +0000 (15:56 +0100)]
Remove unneeded constants

This have slipped through review, remove them.

JIRA: MDSAL-596
Change-Id: Icb0483ff2f78dbb0613dc21ffc4fb45f805be32e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd support for formatting EffectiveModelContext 84/93084/12
Robert Varga [Thu, 15 Oct 2020 18:40:35 +0000 (20:40 +0200)]
Add support for formatting EffectiveModelContext

Introduce a fluent-builder like pattern so we have the
option to override various options of the resulting output.

JIRA: MDSAL-596
Change-Id: I1929664db4262b0428e078b4712844b4bc2679b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
3 years agoSkip pmd/cpd/spotbugs 46/93546/2
Robert Varga [Sun, 1 Nov 2020 17:13:06 +0000 (18:13 +0100)]
Skip pmd/cpd/spotbugs

This is just generated code, there is no point in running these.

Change-Id: I0ef79c800cd76debc9f328930220715715cef6f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor DOMQueryPredicate 58/93458/5
Robert Varga [Wed, 28 Oct 2020 16:50:24 +0000 (17:50 +0100)]
Refactor DOMQueryPredicate

Refactor aimed at allowing composite predicates without multiple
lookups. While the DOM language allows this use case, the binding
layer does not take advantage of it.

JIRA: MDSAL-617
Change-Id: Ib8a3f77ee660a8c2881d0a18bd0238c6ddce5ade
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse Map.entry() instead of SimpleImmutableEntry 35/93435/3
Robert Varga [Wed, 28 Oct 2020 00:03:12 +0000 (01:03 +0100)]
Use Map.entry() instead of SimpleImmutableEntry

We are using these a dumb DTOs, hence using a value-based
non-serializable implementation is more appropriate.

JIRA: MDSAL-605
Change-Id: Ie36c397a6e265328f31b70dce05b8c72b8756584
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRename LazyDOMQueryResultIterator 33/93433/3
Robert Varga [Tue, 27 Oct 2020 22:55:47 +0000 (23:55 +0100)]
Rename LazyDOMQueryResultIterator

This is an implementation-internal class, shorten its name to
DOMQueryIterator. It is shorter and matches naming of others.

JIRA: MDSAL-605
Change-Id: I8413a20c4ba533c62bf6c5c3013b4d1bf8f841e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd support for keyed entries 98/93398/7
Robert Varga [Mon, 26 Oct 2020 22:54:40 +0000 (23:54 +0100)]
Add support for keyed entries

When we enter a NodeIdentifierWithPredicates for a Map, we can
service that with a direct map lookup instead of iteration. As we
now have the tools to access this step, add a unit test and fix
the implementation.

These predicates add another dimension to matching, where we have
to deal with Maps, something that NormalizedNodes does not help
with.

Predicate matching is split into its own class with a clear entry
point, so as to separate it from other complex pieces. This also
solves the tension between Evaluator and Iterator by shifting
ownership to a third class.

Since a predicate now be matching multiple nodes, we have to also
introduce an explicit DOMQueryPredicate.Not, so that its effects
can be properly accounted for.

JIRA: MDSAL-612
Change-Id: I34511517c5746efc5d245a56da89083c44100752
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd support for selecting exact items from lists 27/93427/2
Robert Varga [Tue, 27 Oct 2020 19:53:23 +0000 (20:53 +0100)]
Add support for selecting exact items from lists

The query language prototype was centered around wildcard matches,
while it ignored exact matches in building up the query. Add support
for specifying a list key, as one would in normal InstanceIdentifier.

JIRA: MDSAL-612
Change-Id: I0c63d6d4990a31888f33a86c9d798b09bb10c734
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor LazyDOMQueryResultIterator 92/93392/7
Robert Varga [Mon, 26 Oct 2020 18:29:11 +0000 (19:29 +0100)]
Refactor LazyDOMQueryResultIterator

Rework the logic to keep minimum stack allocations. Whereas we used
stack for keeping the decision state and traverse all entries, here
we keep an explicit stack with state.

We mutate the state using a "simple" sstateful dispatch, where we
are are carefully peeling the various possibilities. This logic is
one large method due to 'current' being manipulated and non-local
returns.

This improves test case performance by more than a factor-of-two,
easily beating linear search by a wide margin.

For clarity we have two classes of Frames, one dealing with MapNode's
children and the other one taking care of all the other nodes. While
this might cause bimorphic invocation of Frame.hasNext(), the overall
effect on clarity is immense.

We also change match() a bit, to take predicates, as it is all that
it should be interested in.

JIRA: MDSAL-610
Change-Id: I7136c6297cc66832539d1bb3d9f653968eb7bdb1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd LazyDOMQueryResult 68/93368/5
Robert Varga [Mon, 26 Oct 2020 14:17:55 +0000 (15:17 +0100)]
Add LazyDOMQueryResult

Rehost the evaluation logic into a dedicated iterator class. This
does not make iteration lazy, but sets the stage by giving the state
being passed around a place to live.

JIRA: MDSAL-610
Change-Id: Ic23eb38d7e5a6bd1cf1b7637dec88eff552520d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBetter encapsulate search state 89/93389/1
Robert Varga [Mon, 26 Oct 2020 14:05:25 +0000 (15:05 +0100)]
Better encapsulate search state

'remaining' is a bit unclear, make sure to push down initialization
down a bit.

JIRA: MDSAL-610
Change-Id: Id607bd444e58eaaa288e8f0fc505d20ec31bed75
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoPropagate notification status to generated listener methods 57/93257/14
Vladyslav Marchenko [Thu, 22 Oct 2020 12:51:40 +0000 (15:51 +0300)]
Propagate notification status to generated listener methods

When we are generating listener interface for notifications:
- deprecated notification methods are marked as @deprecated;
- obsolete notification methods are marked as @deprecated and
  additionally are "default no-op" (so that users are not forced
  to implement them);

JIRA: MDSAL-554
Change-Id: I298b4dff44bd74715d9e1ebac277ac4d7918ffe6
Signed-off-by: Vladyslav Marchenko <vladyslav.marchenko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoHide EagerDOMQueryResult behind DOMQueryResult.of() 67/93367/1
Robert Varga [Mon, 26 Oct 2020 02:54:40 +0000 (03:54 +0100)]
Hide EagerDOMQueryResult behind DOMQueryResult.of()

Most users might not want to depend on dom.spi just for an immutable
holder. Add DOMQueryResult.of() methods and use them as replacements
for EagerDOMQueryResult.of().

JIRA: MDSAL-605
Change-Id: I96f81cc105b9890638769b2f2185e961c0fd1885
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoQueryResults should be Iterable, Immutable 65/93365/2
Robert Varga [Mon, 26 Oct 2020 01:51:43 +0000 (02:51 +0100)]
QueryResults should be Iterable, Immutable

Each query result really is a holder of result items, in some
iteration order. Expose this by implementing Iterable, so that
we end up correctly implementing stream() et al.

JIRA: MDSAL-605
Change-Id: I4cf1cd29e74e8c640ee62126e4f1cb9efa956cce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCache leaf lookups 64/93364/1
Robert Varga [Mon, 26 Oct 2020 01:28:00 +0000 (02:28 +0100)]
Cache leaf lookups

When we are binding a method name to its schema, we are performing
the inverse lookup. Instantiate a cache for these, so we end up
searching only once in DefaultQueryFactory's life.

JIRA: MDSAL-611
Change-Id: Idf9f3de22d907036478dc289387746eeb5a719a7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd DOMDataTreeQueryOperations 48/93348/3
Robert Varga [Sun, 25 Oct 2020 17:17:42 +0000 (18:17 +0100)]
Add DOMDataTreeQueryOperations

DOMDataTreeQueryOperations exposes the ability to execute queries
on the backing datastore, much like one would execute a read.

mdsal-binding-dom-adapter is taught to recognize the interface and
use it to offload execution deeper. It still falls back to its
evaluation should the backing store not support this.

DOMStoreReadTransaction gained the ability to value expressions,
using a default implementation based om DOMQueryEvaluator.

Based on that capability, mdsal-dom-broker's transactions are
retrofitted to always provide evaluation locally.

JIRA: MDSAL-607
Change-Id: Ia20acf59870f47c8a84914e239dee82e2a56c1bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd QueryOperations 46/93346/9
Robert Varga [Sun, 25 Oct 2020 14:30:08 +0000 (15:30 +0100)]
Add QueryOperations

Introduce QueryOperations, which support execution of QueryExpressions.
We implement these in the binding/dom adapter in terms of a read/eval
supported by DOMQueryEvaluator.

This allows users to execute queries no matter what the underlying
storage engine supports. This has the upside of instantiating fewer
Binding objects, as the result set is usually a subset of the overall
tree.

TypedTransactions get these unconditionally, throwing
UnsupportedOperationException if the backend does not provide them
(which the default implementation does).

JIRA: MDSAL-606
Change-Id: If68fbb027aa72b1a4b5eef1437e92c30974a1e12
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd DOMQueryResult streaming interfaces 63/93363/1
Robert Varga [Sun, 25 Oct 2020 23:40:40 +0000 (00:40 +0100)]
Add DOMQueryResult streaming interfaces

Current definition is really an implementation-specific. The API
exposed from DOMQueryResult is eager, not allowing for eager
termination of searching.

Fix this by turning DOMQueryResult into an interface and add
an eager implementation to match current behavior.

Also update DefaultQueryResult to take advantage of lazy
transformations.

JIRA: MDSAL-605
Change-Id: I8375954e09ce6139aad0f83e883ed75771faceab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoPeel predicate identifiers 54/93354/1
Robert Varga [Sun, 25 Oct 2020 22:03:48 +0000 (23:03 +0100)]
Peel predicate identifiers

Most of the time we will be treated with simple predicates, peel
them off, so we do not end up iterating.

JIRA: MDSAL-605
Change-Id: I1864c33c5aa34cd3a58171f8cfbe729dd325fb35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCreate YangInstanceIdentifier only for a match 53/93353/1
Robert Varga [Sun, 25 Oct 2020 19:19:48 +0000 (20:19 +0100)]
Create YangInstanceIdentifier only for a match

This is a classic performance tune up: do not create
YangInstanceIdentifier until we need it.

JIRA: MDSAL-605
Change-Id: Idf9f391d5e7d8080795ce3f6d9b943b5240fe21e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd DOMQueryResult 47/93347/2
Robert Varga [Sun, 25 Oct 2020 16:35:02 +0000 (17:35 +0100)]
Add DOMQueryResult

Working with DOMQueryEvaluator is clunky, introduce a DOMQueryResult,
which reigns it in a bit.

JIRA: MDSAL-605
Change-Id: I83c29c56d184ff880c22154bbb8a3b2bc4f9ec3d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoExpose DefaultQuery class 44/93344/5
Robert Varga [Sun, 25 Oct 2020 14:43:54 +0000 (15:43 +0100)]
Expose DefaultQuery class

DefaultQuery captures the codec context, hence it is useful for
intra-implementation transforms. This includes the ability to
transform the result set from DOM.

JIRA: MDSAL-605
Change-Id: I565d1ec5070653d45bb6340e79799612fc06d61c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoClarify DOMQueryEvaluator API 45/93345/4
Robert Varga [Sun, 25 Oct 2020 15:17:08 +0000 (16:17 +0100)]
Clarify DOMQueryEvaluator API

DOMQueryEvaluator has two modes of operation, each useful on its
own. Separate the two and document them.

JIRA: MDSAL-605
Change-Id: I6bc93b7098a18dc8d5c5886234fc0cf90772d15b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd SimpleQueryExecutor 15/93315/16
Robert Varga [Fri, 23 Oct 2020 20:46:07 +0000 (22:46 +0200)]
Add SimpleQueryExecutor

This refactors the interace a bit and provides a basic evaluator.
The idea is that given a root object it will evaluate the query.

JIRA: MDSAL-605
Change-Id: Ifcf8880d502eed93fa243a2c1e2f50a116306fe5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix DOMQueryPredicate signature 34/93334/2
Robert Varga [Sat, 24 Oct 2020 20:34:01 +0000 (22:34 +0200)]
Fix DOMQueryPredicate signature

DOMQueryPredicates need to be operating on NormalizedNodes, not
plain objects. Internal implementations, which are value-based
need to check for appropriateness of the passed NormalizedNode
and dispatch to check its value.

JIRA: MDSAL-605
Change-Id: Id17400a799b6d14612d077113ba29be4f04a7b6e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd isNull() predicate to both DOM and Binding queries 33/93333/2
Robert Varga [Sat, 24 Oct 2020 20:24:23 +0000 (22:24 +0200)]
Add isNull() predicate to both DOM and Binding queries

We have a nonnull() predicate, this adds its counterpart.

JIRA: MDSAL-605
Change-Id: I76d8ac700c8844f71cfe6e24a6fab23d6212a145
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix DOMQueryEvaluator bugs 32/93332/2
Robert Varga [Sat, 24 Oct 2020 16:23:12 +0000 (18:23 +0200)]
Fix DOMQueryEvaluator bugs

In case we are matching through a list node, we need to make
sure to match against all its children.

Also when evaluating a predicate, make sure to first perform
a lookup for its relative path.

JIRA: MDSAL-605
Change-Id: Iabe0f26206212a356ebae05162452d61f7c781af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoExpose property name when checking key components 80/93180/3
Robert Varga [Mon, 19 Oct 2020 13:39:51 +0000 (15:39 +0200)]
Expose property name when checking key components

Experience with null enforcement of key components indicates we should
carry the name of the property in the exception message -- otherwise
the string is not really helpful.

This patch re-organizes the checking so that we do that, via
newly-introduced CodeHelpers.requireKeyProp() method.

Since we are in the area, also codegen methods' handling of arrays by
creating an explicit 'cloneCall()' utility method.

JIRA: MDSAL-599
Change-Id: If9a87b4976ecdcd09e1fdd83ddfaf03ab4d09a85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse powermock's Whitebox for reflection 68/93168/3
Robert Varga [Mon, 19 Oct 2020 10:59:29 +0000 (12:59 +0200)]
Use powermock's Whitebox for reflection

We have some reflection-based tests, migrate them to use Whitebox.

Change-Id: Ia272f004e32d3de5e58779359cd00a858f6a01ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDOMQueryEvaluator is @NonNullByDefault 21/93321/1
Robert Varga [Sat, 24 Oct 2020 16:23:12 +0000 (18:23 +0200)]
DOMQueryEvaluator is @NonNullByDefault

Clarify that we are not dealing with nullable types.

Change-Id: Ibd5d330ee7603b544b9b2033054cca900b810539
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUpdate QueryResult design 14/93314/4
Robert Varga [Fri, 23 Oct 2020 19:19:20 +0000 (21:19 +0200)]
Update QueryResult design

A query needs to result in a set of path/object tuples, as we really
need to discern matches. Having a concrete path of matches helps
getting identifiers of parent objects for subquent queries.

DOMQueryResult already contains this capability, we just need to
propagate it.

JIRA: MDSAL-604
Change-Id: Iec9ad34aac105eeb45c26a31a24611c9e0f2bb82
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix MatchBuilderPath documentation 16/93316/5
Robert Varga [Fri, 23 Oct 2020 21:58:58 +0000 (23:58 +0200)]
Fix MatchBuilderPath documentation

We have a sentence trailing off, fix it up. Since we are introducing
a new pointer, update LambdaDecoder documentation. QueryExpression
gets a free pass on whitespace.

Change-Id: Ib5f66a80b99f5be18b5b9f41be4fd850435465f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump maven-core dependency 10/93210/1
Robert Varga [Tue, 20 Oct 2020 00:27:01 +0000 (02:27 +0200)]
Bump maven-core dependency

yang-maven-plugin requires at least 3.5.2, there is no point in
using anything else.

Change-Id: I06dc094b87684b1f29b27d6042ed26e4dd0bbad5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump versions to 7.0.2-SNAPSHOT 60/93160/2
Robert Varga [Mon, 19 Oct 2020 10:44:00 +0000 (12:44 +0200)]
Bump versions to 7.0.2-SNAPSHOT

This starts the next development iteration.

Change-Id: I0528a0389fde5ef044a0a9ce2311c7895794ecb6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix nullness errors reported by Eclipse 30/92730/5
Robert Varga [Sat, 26 Sep 2020 22:01:07 +0000 (00:01 +0200)]
Fix nullness errors reported by Eclipse

Eclipse provides a lot of noise around builders where we pass
down classes. This fixes them up by losening the contracts and
adding Class<@NonNull T> where generics are involved. Since we are
at it, also fixup the suite to generate fewer warnings.

JIRA: MDSAL-601
Change-Id: I7b21d88584a18cc1bed6ea776b22e82584484339
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove trailing comments 58/93158/2
Robert Varga [Mon, 19 Oct 2020 09:41:43 +0000 (11:41 +0200)]
Remove trailing comments

Trailing comments are frowned upon, remove them.

Change-Id: I5897228a28e771551548e4c3c6d88b51ef6b32a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoProperly cache caseType class 52/93152/2
Robert Varga [Sun, 18 Oct 2020 20:21:01 +0000 (22:21 +0200)]
Properly cache caseType class

We lost this bit when we were switching annotations. Since we
require Java 11, we should no longer be exposed to the JDK issue.

Change-Id: I769686186f1b03a2bd7e00bbc9474d91278c8d91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix failure to generate runtime types with duplicate schema 37/93137/6
Robert Varga [Sat, 17 Oct 2020 22:21:51 +0000 (00:21 +0200)]
Fix failure to generate runtime types with duplicate schema

The equality contract for TypeDefinition has changed in yangtools-6,
so that TypeDefinitions compare as equal if they represent the same
*semantic* type.

In BindingRuntimeTimes we made the assumption that there is at most
a 1:1 mapping of schema-to-type and used a BiMap to track that
relationship.

Fix that assumption by keeping the maps separate, and teach
RuntimeTypeGenerator to be careful and use an IdentityHashMap to
build that for us.

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