yangtools.git
2 weeks agoBump versions to 7.0.4-SNAPSHOT
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>
2 weeks agoTag generated classes with Generated annotation
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>
2 weeks agoSpecialize relative leafref types during instantiation
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>
2 weeks agoChange `is` to `get` in generated classes
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>
2 weeks agoRemove getter @Nullable annotations for non-List/Map types
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>
2 weeks agoBump upstream versions
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>
2 weeks agoFix checkstyle
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>
2 weeks agoUpdate ChoiceNodeCodecContext
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>
2 weeks agoAdd private ServiceLoaderState constructors
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>
2 weeks agoFix a Sonar logic complaint
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>
2 weeks agoCleanup DataObjectCodecContext
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>
2 weeks agoImprove DataObjectBuilder augmentation handling
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

2 weeks agoBump versions to 7.0.3-SNAPSHOT
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>
2 weeks agoDereference namespace
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>
2 weeks agoMerge codec contexts caches
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>
2 weeks agoCleanup SchemaRootCodecContext formatting
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>
2 weeks agoConvert mdsal-binding-dom-codec-spi to JPMS
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>
2 weeks agoConvert mdsal-binding-dom-codec-api to JPMS
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>
2 weeks agoConvert mdsal-binding-runtime-spi to a JPMS module
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>
2 weeks agoConvert mdsal-binding-spec-util to a JPMS module
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>
2 weeks agoConvert mdsal-binding-runtime-api to a JPMS module
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>
2 weeks agoConvert yang-binding to a JPMS module
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>
2 weeks agoRemove mdsal-binding-generator-api's dependency on yang-binding
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>
2 weeks agoRefactor FileSearchUtil
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>
2 weeks agoBump odlparent/yangtools to 8.0.1/6.0.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>
2 weeks agoSkip pmd/cpd/spotbugs
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>
2 weeks agoPropagate notification status to generated listener methods
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>
2 weeks agoExpose property name when checking key components
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>
2 weeks agoUse powermock's Whitebox for reflection
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>
2 weeks agoBump versions to 7.0.2-SNAPSHOT
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>
2 weeks agoFix nullness errors reported by Eclipse
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>
2 weeks agoRemove trailing comments
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>
2 weeks agoProperly cache caseType class
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>
2 weeks agoFix failure to generate runtime types with duplicate schema
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>
2 weeks agoAdd a FIXME for getModuleInfo
Robert Varga [Thu, 15 Oct 2020 05:57:01 +0000 (07:57 +0200)]
Add a FIXME for getModuleInfo

We do not want to throw Exception here, mark for improvement.

Change-Id: I67e4ba4e9ca7b6076eb78acb08bbcdb5c13c7d44
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUpdate ModuleInfoSnapshotBuilder a bit
Robert Varga [Thu, 15 Oct 2020 05:49:31 +0000 (07:49 +0200)]
Update ModuleInfoSnapshotBuilder a bit

While we are dealing with YangModuleInfo, users should not really
be mucking with that -- it is a binding-internal thing after all.

Expose a j.l.Class-based add() method, which performs proper
introspection to find the appropriate info -- thus allowing us to
simplify users a bit.

Change-Id: I2b00b40ffee2be977fba8b7c7fb80ea28dfd073b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump versions to 7.0.1-SNAPSHOT
Robert Varga [Fri, 9 Oct 2020 14:37:30 +0000 (16:37 +0200)]
Bump versions to 7.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: I0e31c365683e8a7ac15d961e2b96f67f921662ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoGenerate @param for RPC invocation methods
illia.ihushev [Wed, 20 May 2020 11:47:31 +0000 (14:47 +0300)]
Generate @param for RPC invocation methods

Make codegen correctly format javadoc comments with @return, @param,
@throws. This is accomplished by splitting the member comment into
three distinct pieces in TypeMemberComment:
 - a common header: 'Invoke {@code rpc_name_here} RPC.'
 - a description-based block
 - a common footer, describing param/return/throws declarations

These are communicated from type generator and composed into javadoc
by the templating code.

JIRA: MDSAL-402
Change-Id: Ia6b7537cbeb28f9e7ff68479e887ab32e92a1c4b
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump byte-buddy to 1.10.17
Robert Varga [Thu, 8 Oct 2020 13:56:51 +0000 (15:56 +0200)]
Bump byte-buddy to 1.10.17

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.14
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.15
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.16
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.17

Change-Id: Id6e36110773baae89824591e5cfd0cb9e344d84c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump yangtools to 6.0.0
Robert Varga [Thu, 8 Oct 2020 14:39:32 +0000 (16:39 +0200)]
Bump yangtools to 6.0.0

Switch to using released version of yangtools-6.

Change-Id: I2c3ca9d7bd7bdd24104dd8ab8d3d8a6106dc1734
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove org.opendaylight.yangtools.yang.binding.RpcImplementation
Robert Varga [Wed, 7 Oct 2020 21:41:11 +0000 (23:41 +0200)]
Remove org.opendaylight.yangtools.yang.binding.RpcImplementation

We do not use this interface anywhere, remove it.

Change-Id: Ia838e7a45616b8fba6d94cfb5c25c7f14b974910
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRefactor AbstractDataBrokerTestCustomizer
Robert Varga [Wed, 7 Oct 2020 20:41:32 +0000 (22:41 +0200)]
Refactor AbstractDataBrokerTestCustomizer

Since we are dealing with binding classes and their translation,
make sure we operate on BindingRuntimeContext as the primary
entrypoint for tests and other harness.

This allows us to eliminate a few testing-only classes, which
were dealing with EffectiveModelContext -> BindingRuntimeContext
translation.

JIRA: MDSAL-578
Change-Id: I2539ea427cdc6d8a76699bb59fcad1f9e02f60dd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdjust for ModuleEffectiveStatement argument
Robert Varga [Tue, 6 Oct 2020 11:41:48 +0000 (13:41 +0200)]
Adjust for ModuleEffectiveStatement argument

The argument has changed, extract the local name.

Change-Id: I7a6f3cad95b32e3f60c1719b36a95c5f91847557
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdjust to {Container,Input,Output}SchemaNode split
Robert Varga [Mon, 5 Oct 2020 11:13:34 +0000 (13:13 +0200)]
Adjust to {Container,Input,Output}SchemaNode split

We no longer represent all cases using ContainerSchemaNode, hence
we need to adjust users to the new realities.

Change-Id: Ie7c6670d368cdea1220115ae93dd03c16945f75f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdjust for Module/Submodule statement separation
Robert Varga [Mon, 5 Oct 2020 08:30:49 +0000 (10:30 +0200)]
Adjust for Module/Submodule statement separation

Yangtools is providing dedicated classes for Submodule, adjust
for the API change.

Change-Id: I04242bcc1c753d331cdfd16f4632b2ba288ac78d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSimplify ModuleInfoSnapshotBuilder
Robert Varga [Sat, 3 Oct 2020 07:31:39 +0000 (09:31 +0200)]
Simplify ModuleInfoSnapshotBuilder

There is no need to allocate a full resolver, as the things we want
to achieve here are easily done through a simple parser.

Change-Id: I03a7255bc2b6f50171cc6b353ab15409e08ab747
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoEliminate SchemaPath references in codec infrastructure
Robert Varga [Thu, 1 Oct 2020 10:01:02 +0000 (12:01 +0200)]
Eliminate SchemaPath references in codec infrastructure

We have switched to SchemaNodeIdentifier across the board, this patch
makes the finishing touches.

JIRA: MDSAL-570
Change-Id: I8b54143e71ebbd4aef03cb00704e2b4f5311174f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove unthrown exceptions
Robert Varga [Thu, 1 Oct 2020 09:48:55 +0000 (11:48 +0200)]
Remove unthrown exceptions

IOException is not thrown here, remove the declarations.

Change-Id: Ie112d79946b165283c900b420045aedf1b4d8673
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClean DataContainerCodecPrototype methods
Robert Varga [Wed, 30 Sep 2020 18:28:40 +0000 (20:28 +0200)]
Clean DataContainerCodecPrototype methods

We have a number of suppressions and needlessly-public methods,
clean that up.

Change-Id: Id317f9392678f5c91c46ee42eff044d5aa8d31df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoEliminate locking in DataObjectCodecContext
Robert Varga [Wed, 30 Sep 2020 18:14:32 +0000 (20:14 +0200)]
Eliminate locking in DataObjectCodecContext

Use normal getAcquire()/compareAndExchangeRelease() loading to
eliminate the use of locking when we are dealing with mismatched
augmentations. We also split processing into multiple staggered
method to help with inlining.

Change-Id: I2a35aea38c0ec502b27827af145cdad1a00312a4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRelax DataContainerCodecPrototype.instance locking
Robert Varga [Wed, 30 Sep 2020 15:55:36 +0000 (17:55 +0200)]
Relax DataContainerCodecPrototype.instance locking

All the objects we are creating in createInstance() do not have
unexpected side-effects nor should they require happens-before
semantics beyond what they can guarantee themselves.

Base on that we can make loadInstance() lockless and concurrent,
and reconcile purely via getAcquire()/compareAndExchangeRelease().

JIRA: MDSAL-579
Change-Id: I292024afafa41aecb65e547acc5c888ba7890ee1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDo not allocate HashMap for non-augmentations
Robert Varga [Wed, 30 Sep 2020 12:34:20 +0000 (14:34 +0200)]
Do not allocate HashMap for non-augmentations

Push state allocation into the conditional for better encapsulation.

Change-Id: Icf60a259634d263d920b60f3ab55bf162cf709d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImprove BindingRuntimeContext.getAugmentationDefinition()
Robert Varga [Wed, 30 Sep 2020 12:24:13 +0000 (14:24 +0200)]
Improve BindingRuntimeContext.getAugmentationDefinition()

All callers are already guarding the call site with a check, hence
we can also require them to perform an explicit reinterpret. This
pushes safety checks to compile-time.

Also remove duplicate javadocs, so that we have one text defining
semantics.

Change-Id: I3ce23440c725441e663331e94a931ad09d71634a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImprove ModuleInfoSnapshotBuilder API
Robert Varga [Wed, 30 Sep 2020 10:57:13 +0000 (12:57 +0200)]
Improve ModuleInfoSnapshotBuilder API

Add a fluent add(ModuleInfo) method and its siblings, so it is
much easier to use the builder. This also factors out
ModuleInfoSnapshotResolver which is a dynamic registry.

Change-Id: I886883d26f748e32f6d8c766926b4dbd00b75fa5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse only BindingRuntimeContext for augmentation loading
Robert Varga [Wed, 30 Sep 2020 11:26:55 +0000 (13:26 +0200)]
Use only BindingRuntimeContext for augmentation loading

BindingRuntimeContext is the only proper way of loading binding
classes. Do not attempt to go behind its back, but rather trust
it can load everything it references -- it is a bug for if it
cannot.

Eliminate opportunistic augmentation class loading, which allows
is to make augmentation prototypes properly constant.

JIRA: MDSAL-578
Change-Id: Ie99e57b29b437a7fee52be4eb5006d3d122cb383
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoEliminate ClassLoadingStrategy
Robert Varga [Wed, 30 Sep 2020 10:43:56 +0000 (12:43 +0200)]
Eliminate ClassLoadingStrategy

ClassLoadingStrategy as a separate concept is very confusing. The
reality is that ModuleInfoSnapshot needs to be able to load classes
based on their FQCN and BindingRuntimeContext needs to do the same
based on they binding.model.api.Type.

Split ClassLoadingStrategy's two methods appropriately and remove
it. Also adjust all users to not rely on it.

JIRA: MDSAL-578
Change-Id: Id4606efcd67d8ea7c42e78c48c48aa915cb11a52
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoReduce use of getSchemaContext
Robert Varga [Wed, 30 Sep 2020 11:05:14 +0000 (13:05 +0200)]
Reduce use of getSchemaContext

We are moving towards to EffectiveModelContext usage across all
components. Make sure we propagate it to more places, fixing
related deprecation warnings.

Change-Id: If8da2a8c7037dbc1966351acc7c63b5f2cd1db85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoCreate proper assertFileContains()
Robert Varga [Tue, 29 Sep 2020 22:45:37 +0000 (00:45 +0200)]
Create proper assertFileContains()

We want to have a proper assertion, not just assertTrue(). Change
findInFile() to assertFileContains().

Change-Id: I15d36db3423bc28df364dbed216adbdced8fc9a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix FileSearchUtil.getFiles()
Illia [Thu, 24 Sep 2020 11:18:25 +0000 (14:18 +0300)]
Fix FileSearchUtil.getFiles()

Do not skip files in the current folder after finding the first child
folder.

Change-Id: Ifba6071e431e18a0a4caa03c90d11b246ec2bc6b
Signed-off-by: Illia <illia.ihushev@pantheon.tech>
2 weeks agoMove common util methods to dedicated class
illia.ihushev [Tue, 11 Aug 2020 11:47:27 +0000 (14:47 +0300)]
Move common util methods to dedicated class

This will make it easier to reuse them.

Change-Id: I4ad75ba20da12936311bdb81c7b2e8e7a7a284d0
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdd BindingMap helper class
Robert Varga [Fri, 25 Sep 2020 16:20:22 +0000 (18:20 +0200)]
Add BindingMap helper class

Changing the mapping of keyed lists from List to Map made the baseline
generated builders hard to use, as there isn't an easy way to build
a map of entries in a fluent way.

BindingMap fills this role, providing both a direct way via
BindingMap.of(V...) as well as Builder-based interface via
BindingMap.Builder.

JIRA: MDSAL-553
Change-Id: Ieb3093c37b30f79666bffb50aa22a20922e41344
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Illia <illia.ihushev@pantheon.tech>
2 weeks agoBump to odlparent-8.0.0/yangtools-8.0.0-SNAPSHOT
Robert Varga [Tue, 29 Sep 2020 14:17:03 +0000 (16:17 +0200)]
Bump to odlparent-8.0.0/yangtools-8.0.0-SNAPSHOT

This patch starts integration for MRI window.

Change-Id: Ifa9780fbdfb411b4613df0ee18407d85e81bd517
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse QName.bindTo() instead of withModule()
Robert Varga [Tue, 29 Sep 2020 14:56:01 +0000 (16:56 +0200)]
Use QName.bindTo() instead of withModule()

QName.withModule() has been deprecated, migrate to using
AbstractQName.bindTo().

Change-Id: I95aa618ce0f8a0ad4844e99db03f373e9e4ea884
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks ago$YangModuleInfoImpl not generated for only extensions model
Michal Banik [Thu, 13 Aug 2020 18:09:04 +0000 (20:09 +0200)]
$YangModuleInfoImpl not generated for only extensions model

This adds a minimal test case, which flushes out the problem
in test harness, but production code is actually fine.

JIRA: MDSAL-589
Change-Id: I93404702551546585812f8d1b5be6690cc38e750
Signed-off-by: Michal Banik <michal.banik@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump odlparent/yangtools to 7.0.6/5.0.6
Robert Varga [Mon, 21 Sep 2020 12:17:50 +0000 (14:17 +0200)]
Bump odlparent/yangtools to 7.0.6/5.0.6

Pick up latest updates from upstream.

Change-Id: I22dae6f3cc21e115f349d568d6d3b9943a330027
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 69f8b01a7a376893461b68b1814510f1f8d856fd)

2 weeks agoFix wrong leafref path
illia.ihushev [Tue, 4 Aug 2020 19:22:13 +0000 (22:22 +0300)]
Fix wrong leafref path

leafref path points to nonexistent node, fix this path.

Change-Id: Ie6561743cf88d840598e3f2199fddff1c08029fa
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
2 weeks agoEliminate AugmentationHolder
Robert Varga [Mon, 3 Aug 2020 12:02:14 +0000 (14:02 +0200)]
Eliminate AugmentationHolder

This makes interacting with Augmentables a lot simpler at the expense
of not supporting weird Reflection-based tricks like 'we will load
the interpretation behind your back'.

JIRA: MDSAL-577
Change-Id: Ib97ed323cf8fbec55a06188691610a31a1267bea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix an Xtend warning
Robert Varga [Mon, 3 Aug 2020 11:59:12 +0000 (13:59 +0200)]
Fix an Xtend warning

There is a teensy warning, fix it up.

JIRA: MDSAL-491
Change-Id: I2a630ea42b27fd447e76a1ee567c61b21d74ace4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix list Key data object nullness guarantees
illia.ihushev [Tue, 28 Jul 2020 12:20:58 +0000 (15:20 +0300)]
Fix list Key data object nullness guarantees

Verify is values nonnull in the constructors. Annotate getters return
types, constructor parameters with @NonNull.

JIRA: MDSAL-491
Change-Id: Idd8adacd9f8b2916b92a171df8d7e5001b1557d3
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
2 weeks agoTeach BindingRuntimeContext how to lookup action paths
Robert Varga [Mon, 27 Jul 2020 11:19:41 +0000 (13:19 +0200)]
Teach BindingRuntimeContext how to lookup action paths

We do not want to rely on SchemaPath in binding-dom-adapter, so that
addressing is kept internal to BindingRuntimeTypes.

JIRA: MDSAL-581
Change-Id: I464582fa43b208de1ba347388cbde26161f3e304
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoReplace SchemaPath with SchemaNodeIdentifier.Absolute/QName
Robert Varga [Tue, 21 Jul 2020 11:42:54 +0000 (13:42 +0200)]
Replace SchemaPath with SchemaNodeIdentifier.Absolute/QName

SchemaNode.getPath() is going away, which also means we do not need
to tie ourselves down with SchemaPath.

RPCs embrace the fact they are really just a top-level construct
and use a plain QName.

Actions and notifications are required to use
SchemaNodeIdentifier.Absolute, which is the exact addressing
equivalent for them.

JIRA: MDSAL-569
Change-Id: I3a8f820c7b8f8a161881865bdac5a00d969cfc63
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdd @NonNull in DataObjects' default method signatures
illia.ihushev [Wed, 29 Jul 2020 10:41:34 +0000 (13:41 +0300)]
Add @NonNull in DataObjects' default method signatures

When specific DataObject is not Augmentable bindingToString parameter,
bindingEquals thisObj parameter, bindingHashCode parameter are not
annotated with @NonNull. Add these missing @NonNulls.

JIRA: MDSAL-582
Change-Id: I1ec4b500fd30cdf6b5006b8da2d91e035eff04ae
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
2 weeks agoSkip bindingHashCode() generation on properties' absence
Ilya Igushev [Tue, 21 Jul 2020 08:02:32 +0000 (11:02 +0300)]
Skip bindingHashCode() generation on properties' absence

When DataObject implementation has no properties, augmentations, its
hashcode() wouldn't be overridden, so bindingHashcode() remains unused.

JIRA: MDSAL-471
Change-Id: If2f7bbb65f9dccf2353ba22b49d530f2a1ab4a71
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
2 weeks agoAdd tests for generateBindingHashCode()
illia.ihushev [Mon, 20 Jul 2020 16:11:36 +0000 (19:11 +0300)]
Add tests for generateBindingHashCode()

Check bindingHashCode() declaration correctness.

JIRA: MDSAL-471
Change-Id: Iebf4963c1069b824ef97d07c9a81bff08cf3cabd
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
2 weeks agoBump byte-buddy to 2.10.13
Robert Varga [Mon, 27 Jul 2020 15:07:25 +0000 (17:07 +0200)]
Bump byte-buddy to 2.10.13

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.12
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.13

Change-Id: I0966260bd0488abd08e9db0025bb1fd28d01f7e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump odlparent/yangtools to 7.0.5/5.0.5
Robert Varga [Tue, 21 Jul 2020 19:40:36 +0000 (21:40 +0200)]
Bump odlparent/yangtools to 7.0.5/5.0.5

Pick up upgrades needed for netty and also further 7.0.0 development.

Change-Id: Ib80d5cfae5c5b93000ca3cf6fc907513d3901bdb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse soft values in ValueTypeCodec
Robert Varga [Tue, 21 Jul 2020 08:39:32 +0000 (10:39 +0200)]
Use soft values in ValueTypeCodec

Using strong value references in STATIC_CODECS cache leads to target
classes being strongly reachable through the codec itself -- hence
they will never be weakly reachable, hence they will not be GC'd.

Use soft values, which allows the classes to be GC'd as soon as the
JVM decides they have not been used for a while -- which is what
will happen when a class becomes almost-eligible for unloading.

JIRA: MDSAL-580
Change-Id: I7956d564c46a9a1d52ba85fbe61f3a19c507a902
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBinding DTOs: improve equals() implementation
Vladyslav Marchenko [Wed, 13 May 2020 10:09:03 +0000 (13:09 +0300)]
Binding DTOs: improve equals() implementation

DTO generator code recognize the types being compared and perform the following ordering:
1) numeric types (boolean, byte, short, int, long, biginteger, bigdecimal), identityrefs
2) string, binary, bits
3) instance identifier
4) all other (e.g. composite) types

JIRA: MDSAL-88
Change-Id: I8f64ad3cf234e4f0f16d608bd397b7f3fa96d785
Signed-off-by: Vladyslav Marchenko <vladyslav.marchenko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse bindingEquals() generated for interfaces
illia.ihushev [Wed, 8 Jul 2020 09:58:08 +0000 (12:58 +0300)]
Use bindingEquals() generated for interfaces

As we are generating a default implementation of equals(), we
can defer to that implementation from runtime-generated proxies.

This results in:
- consistent results between compile-time and runtime implementations
- faster startup time, as there is only one dispatch implementation
- lower memory overhead, as runtime-generated classes are smaller
- more maintainable code, as the implementation can be examined at
  compile-time

Since this is the last method that references properties, we also
get to clean up some of the knowledge of how these need to be ordered.

JIRA: MDSAL-474
Change-Id: I1a0ca93755e670b7d8fa0834f87ee7a828843aa6
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoGenerate bindingEquals() and use it in generated implementations
Ilya Igushev [Fri, 3 Jul 2020 08:07:22 +0000 (08:07 +0000)]
Generate bindingEquals() and use it in generated implementations

As we are gearing towards generating default methods in interfaces,
we need the ability to completely analyze all a target type from
a template, not from a generator.

This ability was previously available to Builder*Template, now it
is part of JavaFileTemplate and hence can be picked up by
InterfaceTemplate as needed.

JIRA: MDSAL-473
Change-Id: Ife60dadb9b66dc01df04ebeba11d82c8806f2236
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClean up AugmentationHolder's annotations
Robert Varga [Mon, 20 Jul 2020 12:41:17 +0000 (14:41 +0200)]
Clean up AugmentationHolder's annotations

We know AugmentationHolder must return a non-null, make sure we
have annotations documenting that.

Change-Id: Ie46791349c9ab0b3eb67fa8dd165d67702a993d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse bindingHashCode() generated for interfaces
Robert Varga [Wed, 4 Sep 2019 17:16:09 +0000 (19:16 +0200)]
Use bindingHashCode() generated for interfaces

As we are generating a default implementation of hashCode(), we
can defer to that implementation from runtime-generated proxies.

This results in:
- consistent results between compile-time and runtime implementations
- faster startup time, as there is only one dispatch implementation
- lower memory overhead, as runtime-generated classes are smaller
- more maintainable code, as the implementation can be examined at
  compile-time

JIRA: MDSAL-472
Change-Id: Ifc4d3b71a1c63508e01491a4bf57bc4b163b5816
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoGenerate bindingHashCode() and use it in generated implementations
Robert Varga [Wed, 4 Sep 2019 15:44:12 +0000 (17:44 +0200)]
Generate bindingHashCode() and use it in generated implementations

As we are gearing towards generating default methods in interfaces,
we need the ability to completely analyze all a target type from
a template, not from a generator.

This ability was previously available to Builder*Template, now it
is part of JavaFileTemplate and hence can be picked up by
InterfaceTemplate as needed.

JIRA: MDSAL-471
Change-Id: I278c085da195df8b4153b62381203b8ddc7bd073
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove ModuleInfoBackedContext
Robert Varga [Sun, 19 Jul 2020 22:01:39 +0000 (00:01 +0200)]
Remove ModuleInfoBackedContext

We have a replacement in ModuleInfoSnapshotBuilder, which is more
appropriate. Remove this badly leaking class and remove all the cruft
associated with its contract.

Change-Id: I185a57dc488a248bc8387e3f26603772116a48f2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse ModuleInfoSnapshot instead of ModuleInfoBackedContext
Robert Varga [Sun, 19 Jul 2020 21:52:36 +0000 (23:52 +0200)]
Use ModuleInfoSnapshot instead of ModuleInfoBackedContext

We do not need the entire dance around dynamic loading, use just
the bare minimum loader.

Change-Id: Ie04197083144fd24d11108edef013ec5941b2c90
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove GeneratedClassLoadingStrategy
Robert Varga [Sun, 19 Jul 2020 16:30:42 +0000 (18:30 +0200)]
Remove GeneratedClassLoadingStrategy

We do not need this particular class anymore, remove it and migrate
its final set of users.

Change-Id: Ifce3d2803e2c3864377f174c468e83ee3a14b210
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse bindingToString() generated for interfaces
illia.ihushev [Tue, 14 Jul 2020 08:21:49 +0000 (11:21 +0300)]
Use bindingToString() generated for interfaces

As we are generating a default implementation of toString(), we
can defer to that implementation from runtime-generated proxies.

This results in:
- consistent results between compile-time and runtime implementations
- faster startup time, as there is only one dispatch implementation
- lower memory overhead, as runtime-generated classes are smaller
- more maintainable code, as the implementation can be examined at
  compile-time

JIRA: MDSAL-480
Change-Id: I56aceeb70461f6d35fcd6487e924fdd127a1ba1c
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoGenerate bindingToString() and use it in generated implementations
Ilya Igushev [Thu, 9 Jul 2020 09:52:02 +0000 (09:52 +0000)]
Generate bindingToString() and use it in generated implementations

As we are gearing towards generating default methods in interfaces,
we need the ability to completely analyze all a target type from
a template, not from a generator.

This ability was previously available to Builder*Template, now it
is part of JavaFileTemplate and hence can be picked up by
InterfaceTemplate as needed.

JIRA: MDSAL-479
Change-Id: I1e939aca15f2f77b82a83ca454503522c96bcabe
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoCorrect mdsal-binding-runtime-{api,spi} packages
Robert Varga [Sun, 19 Jul 2020 15:35:56 +0000 (17:35 +0200)]
Correct mdsal-binding-runtime-{api,spi} packages

Previous iteration left these new interface in the wrong package,
correct that mistake.

JIRA: MDSAL-548
Change-Id: I65c51ff2c1fc6c66684325c1022f6dca79a9b837
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDeprecate binding.runtime.spi constructs
Robert Varga [Sun, 19 Jul 2020 15:23:37 +0000 (17:23 +0200)]
Deprecate binding.runtime.spi constructs

GeneratedClassLoadingStrategy is a relic, superseded by
ClassLoadingStrategy interface. Deprecate it for removal.

ModuleInfoBackedContext is an internal implementation detail, which
should not be used outside fo runtime-spi. Deprecate it for removal.

Change-Id: I520b7aa2bd60080e03c41f55087a5a9eca65ea8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove deprecated Builder.addAugmentation() variant
Robert Varga [Sun, 19 Jul 2020 11:53:46 +0000 (13:53 +0200)]
Remove deprecated Builder.addAugmentation() variant

We only support a single-argument variant, remove the deprecated
one.

JIRA: MDSAL-575
Change-Id: Ib2d256516f03a3e4be532378ac2dac6833acf489
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove uses of deprecated Builder.addAugmentation()
Robert Varga [Sun, 19 Jul 2020 15:04:18 +0000 (17:04 +0200)]
Remove uses of deprecated Builder.addAugmentation()

We have a few tests which are using the deprecated addAugmentation()
method, remove them.

Change-Id: I3207588958610ee35eb1de2542ee31181467294f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump versions to 7.0.0-SNAPSHOT
Robert Varga [Fri, 17 Jul 2020 21:14:42 +0000 (23:14 +0200)]
Bump versions to 7.0.0-SNAPSHOT

Open the next major release.

Change-Id: I85ddea18470708fbb4d4346b4476ca32198d4f55
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump versions to 6.0.4-SNAPSHOT
Robert Varga [Fri, 17 Jul 2020 21:13:30 +0000 (23:13 +0200)]
Bump versions to 6.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: Ie2e139ddea855c81f765e1b9b4dff02810230000
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump odlparent/yangtools to 7.0.4/5.0.4
Robert Varga [Wed, 15 Jul 2020 10:32:22 +0000 (12:32 +0200)]
Bump odlparent/yangtools to 7.0.4/5.0.4

Pick up latest fixes from upstream.

Change-Id: Ic6d8e45955d77401b0bbdc4535b0a9a5e3ca9732
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoMake full type information accessible from InterfaceTemplate
illia.ihushev [Wed, 15 Jul 2020 11:35:26 +0000 (14:35 +0300)]
Make full type information accessible from InterfaceTemplate

As we are gearing towards generating default methods in interfaces,
we need the ability to completely analyze all a target type from
a template, not from a generator.

This ability was previously available to Builder*Template, now it
is part of JavaFileTemplate and hence can be picked up by
InterfaceTemplate as needed.

JIRA: MDSAL-470
Change-Id: I5a9b35ae31bfa7ecbffa2b555587d70a97fab93e
Signed-off-by: illia.ihushev <illia.ihushev@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSpeed up BuilderGenerator matcher
Robert Varga [Wed, 15 Jul 2020 15:43:28 +0000 (17:43 +0200)]
Speed up BuilderGenerator matcher

We do not need to establish FQCN, as we can compare just JavaTypeNames,
which is faster.

Change-Id: I3c387e841fbf2d450195d864a928608bab8128ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoInline single-use locals
Robert Varga [Mon, 13 Jul 2020 20:11:22 +0000 (22:11 +0200)]
Inline single-use locals

We are storing instrumented type in a local, and use that local
only once. Just inline the getter to trim down some generator
bytecode.

Change-Id: Ibfac0c2dc1d294643cbe2619d14e1672314d8bdf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClean up CodecDataObjectGenerator documentation
Robert Varga [Mon, 13 Jul 2020 20:06:45 +0000 (22:06 +0200)]
Clean up CodecDataObjectGenerator documentation

We have a few typos and opportunities for cleanup.

Change-Id: Ibb9f5804ccc05c1b58c51d0ba1ac03fbaef7b223
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove GeneratorUtil.getTopParentTransportObject()
Robert Varga [Mon, 13 Jul 2020 11:12:34 +0000 (13:12 +0200)]
Remove GeneratorUtil.getTopParentTransportObject()

This method is not used anywhere and is quite inefficient, remove
it.

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