yangtools.git
2 weeks agoBump upstreams
Robert Varga [Thu, 19 Aug 2021 23:07:16 +0000 (01:07 +0200)]
Bump upstreams

Adops odlparent-9.0.3 and yangtools-7.0.5.

Change-Id: I22c5ae9be1e8b817b8bf47f82ac28eb10ba6e840
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoShorten JavaFileGeneratorFactory's name
Robert Varga [Tue, 17 Aug 2021 21:04:09 +0000 (23:04 +0200)]
Shorten JavaFileGeneratorFactory's name

The package name here is quite wasteful, hence use something shorter,
which should help with hitting file path limits.

Change-Id: Iade9a8e8a71a5cbfb0b7aef1de253e623c731920
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDo not guard utility class constructors
Robert Varga [Tue, 17 Aug 2021 19:59:51 +0000 (21:59 +0200)]
Do not guard utility class constructors

There is no point in having exception throwing here, just use a simple
comment.

Change-Id: If4e2c22bde3a2456e1aec77ef2a1e846c2732a7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove ByteBuddyUtils.{ifEq,markLabel}
Robert Varga [Mon, 16 Aug 2021 18:20:29 +0000 (20:20 +0200)]
Remove ByteBuddyUtils.{ifEq,markLabel}

Ever since we have moved DataObject.equals() implementations to
generated interfaces this code is no longer used. Remove it to reduce
overall footprint.

Since these are the only methods which require frame informantion, also
ditch the code to mark COMPUTE_FRAMES, providing even more
simplification.

Change-Id: I32f1868e3d82193702835938f54663fb2052ae71
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump versions to 8.0.2-SNAPSHOT
Robert Varga [Sat, 24 Jul 2021 21:02:12 +0000 (23:02 +0200)]
Bump versions to 8.0.2-SNAPSHOT

This starts the next development iteration.

Change-Id: I43dca6e2f7926a176c94d4cc5b08515e632b92cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump yangtools to 7.0.4
Robert Varga [Sat, 24 Jul 2021 18:06:05 +0000 (20:06 +0200)]
Bump yangtools to 7.0.4

Pick up latest fixes from upstream.

Change-Id: If5a2b590bb57cde510f3adaba29fc235f7a607a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRequire yang-common transitively
Robert Varga [Wed, 21 Jul 2021 17:09:57 +0000 (19:09 +0200)]
Require yang-common transitively

We have a number of utilities using yang-common, require it explicitly.

Change-Id: Ief3e652f053ddd1da7f94949f0bf52f20f273ecc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdd GeneratorTest
Robert Varga [Thu, 15 Jul 2021 12:34:29 +0000 (14:34 +0200)]
Add GeneratorTest

We have a few tests targeting low-level utility methods in Generator,
add a dedicated GeneratorTest to hold them.

Change-Id: I18ee7f1e66ed1b0519de0b1d61b4e63135f2c947
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSplit out Bug1862Test
Robert Varga [Thu, 15 Jul 2021 12:44:24 +0000 (14:44 +0200)]
Split out Bug1862Test

We have a disabled test here. Split it out and reactivate it.

Change-Id: I38b72751eb38bc492208fdd47af0534c8b6b6c4d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFurther cleanup of test classes
Robert Varga [Thu, 15 Jul 2021 12:23:00 +0000 (14:23 +0200)]
Further cleanup of test classes

We have no users of TestLeafSchemaNode and TypeProviderModel is only
used by TypeProviderTest.

Change-Id: I92e8467d60c1e2a784607181674f8ae32b47974b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoMigrate Bug4621Test
Robert Varga [Thu, 15 Jul 2021 12:16:55 +0000 (14:16 +0200)]
Migrate Bug4621Test

Move the test into the appropriate package and migrate it to work on top
of DefaultBindingGenerator.

Change-Id: Idc86823388898341d5fe54adc224ad3d5e4fbb27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove unused testing TypeDefinitions
Robert Varga [Thu, 15 Jul 2021 12:07:40 +0000 (14:07 +0200)]
Remove unused testing TypeDefinitions

We are not using these two classes anymore, remove them.

Change-Id: I12b779a4d52c080a3850499a38efd41c32520595
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove TypeProvider interface
Robert Varga [Thu, 15 Jul 2021 11:34:07 +0000 (13:34 +0200)]
Remove TypeProvider interface

We have only a single implementation of this interface, remove it
by collapsing it into AbstractTypeProvider.

Change-Id: I3e8999327a0ddbd7e632099fe1e282f6432bc960
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove BaseYangTypesProvider
Robert Varga [Thu, 15 Jul 2021 11:19:33 +0000 (13:19 +0200)]
Remove BaseYangTypesProvider

This provider is rather unused, collapse it into its sole caller and
eliminate its test.

Change-Id: I41b239babd696fe1e8be6872764bcab93c6b9dd1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove useless TypeProvider tests
Robert Varga [Thu, 15 Jul 2021 10:48:21 +0000 (12:48 +0200)]
Remove useless TypeProvider tests

These tests are just testing null arguments, remove them.

Change-Id: I97a1b87c655fe5159a17ab0d0c07c63d234e380a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoCleanup BindingGeneratorUtilTest
Robert Varga [Thu, 15 Jul 2021 10:35:52 +0000 (12:35 +0200)]
Cleanup BindingGeneratorUtilTest

We have a number of tests which should be in binding-spec-util,
move them around.

Change-Id: I76900f1f0c87401cf6d4e0b84b8340edbd116f22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump versions to 8.0.1-SNAPSHOT
Robert Varga [Fri, 25 Jun 2021 14:50:59 +0000 (16:50 +0200)]
Bump versions to 8.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: I42188134fea033a8af370b12784035554a975c6d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoLock down mdsal-binding-generator
Robert Varga [Fri, 25 Jun 2021 14:46:22 +0000 (16:46 +0200)]
Lock down mdsal-binding-generator

Expose only the bare minimum API surface from generator, requiring
downstreams to use proper injection.

Change-Id: I7552c90c4d9524b783a627fe883ed31b69ba9274
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoTest self-referencing leafrefs
Robert Varga [Fri, 25 Jun 2021 13:22:36 +0000 (15:22 +0200)]
Test self-referencing leafrefs

Our refactor has lost the ability to detect self-referencing leafrefs.
Add that capability back and activate the relevant unit test.

Change-Id: Idcc09c1a41560588cb8db3974caa8cc4047aa7ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRefactor mdsal-binding-generator artifacts
Robert Varga [Fri, 25 Jun 2021 09:53:52 +0000 (11:53 +0200)]
Refactor mdsal-binding-generator artifacts

Generator artifacts have a layout which belies their actual purpose,
as exposed after mdsal-binding-generator-impl refactor.

mdsal-binding-generator-impl is renamed to mdsal-binding-generator,
absorbing BindingGenerator from the API artifact.

mdsal-binding-generator-{api,util} are renamed to
mdsal-binding-model-{api,ri}, with generator-specific utilities being
moved to mdsal-binding-generator.

This change makes it easier to integrate
mdsal-binding-java-api-generator, as we can directly depend on
mdsal-binding-generator.

Change-Id: Idb8591771837175128e05febb4614d624dca03fd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoHide binding.model.api.DefaultType
Robert Varga [Fri, 25 Jun 2021 08:55:27 +0000 (10:55 +0200)]
Hide binding.model.api.DefaultType

Expose DefaultType only from Type.of() static factory methods and adjust
its implementation to remove open-coded toString() methods.

Change-Id: Iaa3c0a7c117f12235a18e75512d9974403ab7f24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoCleanup BindingReflections.getModuleInfo()
Robert Varga [Thu, 24 Jun 2021 12:35:13 +0000 (14:35 +0200)]
Cleanup BindingReflections.getModuleInfo()

Simplify callers by throwing only IllegalStateExceptions, i.e.
properly catching our internal errors.

Change-Id: I900f3f1ed1236e54a66ed17c093df6a1c855be50
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump byte-buddy to 1.11.5
Robert Varga [Wed, 2 Jun 2021 08:20:14 +0000 (10:20 +0200)]
Bump byte-buddy to 1.11.5

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.11.1
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.11.2
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.11.3
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.11.4
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.11.5

Also remove ByteBuddyUtils.loadThis(), as it is no longer needed.

Change-Id: I1e32f6d552ce5f1bca1ad71158cb03e1fbfda261
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDo not hash augmentation keys
Robert Varga [Thu, 24 Jun 2021 09:20:30 +0000 (11:20 +0200)]
Do not hash augmentation keys

We do not want to take into account augmentation identity for
hashCode(), as that prevents equivalent augmentation lookups.

This is not a complete solution, as equality still indicates non-equal,
but that's better than what we have.

JIRA: MDSAL-667
Change-Id: I1f4d7122534c175aff6e0d7da27c877d7493f92f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove superfluous plugin dance
Robert Varga [Thu, 24 Jun 2021 10:12:15 +0000 (12:12 +0200)]
Remove superfluous plugin dance

FileGenerator-driven directories are maintained by yang-maven-plugin
itself, there is no need to twiddle with directories here.

Change-Id: I819c622c1816e9f4d4663a68ab20f7187c0ee346
JIRA: MDSAL-232
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoCleanup mdsal-binding-dom-codec-osgi dependency
Robert Varga [Wed, 23 Jun 2021 19:18:12 +0000 (21:18 +0200)]
Cleanup mdsal-binding-dom-codec-osgi dependency

We are relying on mdsal-binding-dom-codec-spi only, hence we can lower
the dependency.

JIRA: MDSAL-672
Change-Id: If6950aabd833703062c77ea624b621a64aa64c82
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoCleanup mdsal-binding-dom-codec dependencies
Robert Varga [Wed, 23 Jun 2021 19:09:46 +0000 (21:09 +0200)]
Cleanup mdsal-binding-dom-codec dependencies

We do not need to bring in mdsal-binding-generator-util, as that is only
used by mdsal-binding-generator-impl.

JIRA: MDSAL-672
Change-Id: I5ef15bb2b4d0c6a12606b6b2995ad30f2820c942
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdd non-null getters for leaf objects
Konstantin.Nosach [Wed, 25 Nov 2020 12:07:32 +0000 (14:07 +0200)]
Add non-null getters for leaf objects

DTO getters inherently return nullable objects. We have a nonnullFoo()
concept, which is very powerful with Lists/Maps, where we return an
empty collection. This turns out to be very useful for end users, who
can worry about other logic problems instead.

This patch introduces a similar construct for non-complex getters, so
that

  container foo {
    leaf bar {
      type string;
    }
  }

ends up generating a default method:

  interface Foo {
    default @NonNull String requireBar() {
        // ..
    }
  }

which nicely throws an exception distinct from NPE and retaining call
site.

JIRA: MDSAL-602
Change-Id: Ia66ee61f51fb9b6eb11aea3736e5246aadad6a3e
Signed-off-by: Kostiantyn Nosach <kostiantyn.nosach@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoMove unified documentation generator
Robert Varga [Wed, 23 Jun 2021 12:25:42 +0000 (14:25 +0200)]
Move unified documentation generator

maven-sal-api-gen-plugin is not really useful anymore, move its
sole remaining generator into dom's unified-html-generator. It
also is deprecated, since it's never been actually used.

JIRA: MDSAL-232
Change-Id: Id6ed104ca6171d9c3d3b1d9be260211bc6e089a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRename additionalConfiguration
Robert Varga [Wed, 23 Jun 2021 09:51:44 +0000 (11:51 +0200)]
Rename additionalConfiguration

Since we are using FileGeneratorFactory, the configuration map is our
only source of configuration, rename arguments to match that.

JIRA: MDSAL-232
Change-Id: I5da112835906e070ae9016fd62f72459b9e6f4de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse FileGenerator for java-api-generator
Robert Varga [Sun, 11 Nov 2018 20:19:16 +0000 (21:19 +0100)]
Use FileGenerator for java-api-generator

Do not use deprecated BasicCodeGenerator interface to interact with
yang-maven-plugin. Using FileGenerator allows us to decouple lifecycle
and eliminate a bit of duplication.

JIRA: MDSAL-232
Change-Id: I04931ff6f70f548de5a49042201283c7e503f92e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoMake JavaFileTemplate.importedName() identify all name collisions.
Iaroslav [Wed, 23 Dec 2020 10:23:54 +0000 (12:23 +0200)]
Make JavaFileTemplate.importedName() identify all name collisions.

Refactor xtend files to use importedName instead of fillyQualifiedName
to prevent full package path in generated files.

JIRA: MDSAL-649
Change-Id: I569f46bb095512274b28c0decd5d2d2eefe7f7dd
Signed-off-by: Iaroslav Kholiavko <iaroslav.kholiavko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix UnionTypeCodec.loader() expectations
Robert Varga [Mon, 21 Jun 2021 10:15:11 +0000 (12:15 +0200)]
Fix UnionTypeCodec.loader() expectations

A union type can be derived via a typedef, in which case we will
not see a top-level RuntimeGeneratedUnion. Update the loader to walk
the inheritence hierarchy to locate union types.

Change-Id: I664c21c0400140c1f02a7c48f455608751ddd072
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump to yangtools-7.0.3
Robert Varga [Sat, 19 Jun 2021 09:27:32 +0000 (11:27 +0200)]
Bump to yangtools-7.0.3

Pick up fixes from upstream.

Change-Id: Iad48c8176c3c91e79552266e2943c80e09e0a3bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoTreat wildcards as objects
Robert Varga [Wed, 16 Jun 2021 09:11:59 +0000 (11:11 +0200)]
Treat wildcards as objects

The effort to properly specialize leafref values has created
opportunities for WildcardType to be reported as the return. Handle
these as Objects for now, but also issue FIXMEs for a follow-up proper
fix.

JIRA: MDSAL-668
JIRA: MDSAL-670
Change-Id: I4e8a6ff3aa23a3e94c1ec4a52726e9caf9e9c4ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUpdate CodecDataObjectGenerator FIXME
Robert Varga [Wed, 16 Jun 2021 09:18:31 +0000 (11:18 +0200)]
Update CodecDataObjectGenerator FIXME

We have an issue tracking the activation of Fixed generator, make sure
the FIXME is referencing it.

JIRA: MDSAL-443
Change-Id: Id5af6daa7ee777592b214085dbe61fecc4ac8305
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix union losing patterns
Robert Varga [Wed, 9 Jun 2021 20:34:46 +0000 (22:34 +0200)]
Fix union losing patterns

Union typedefs need to generate type enforcement patterns for their
constituent types. Make sure that happens.

Change-Id: Id4512f17e1ca6b2f9a5157d3b44dd3d03d5dfcec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdd yang-ext:mount extension
Robert Varga [Wed, 9 Jun 2021 08:54:38 +0000 (10:54 +0200)]
Add yang-ext:mount extension

We are gratiously refering to yang-ext:mount all over the place, without
the construct being actually defined. Add a proper definition so that
our data/schema processing can be correctly hooked into it.

JIRA: MDSAL-665
Change-Id: Ib6076060d693955be236d548e07fca1c88016b5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump yangtools to 7.0.2
Robert Varga [Tue, 8 Jun 2021 07:13:20 +0000 (09:13 +0200)]
Bump yangtools to 7.0.2

Adopt released version instead of temporary snapshot.

Change-Id: I00fbc1099046cc3ecd229342169cc08e2a3ca50f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDo not use a static String reference in length enforcer
Robert Varga [Fri, 21 May 2021 11:13:11 +0000 (13:13 +0200)]
Do not use a static String reference in length enforcer

LengthGenerator is making the mistake of having a static reference
to java.lang.String without FQCN. This breaks down if String is
overridden by definition context.

Fix this by using importedName(Type) to emit a properly-scoped
reference.

JIRA: MDSAL-664
Change-Id: I16b12865448bde807f0afd0d35e3145f8b6359c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoReenable mdsal533 test
Robert Varga [Mon, 24 May 2021 19:58:34 +0000 (21:58 +0200)]
Reenable mdsal533 test

For some reason we lost @Test here, make sure we reinstate it.

Change-Id: I879179761ff33e85dbb4579ed4643db6726b3efe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump upstreams
Robert Varga [Mon, 24 May 2021 16:53:38 +0000 (18:53 +0200)]
Bump upstreams

Adop odlparent-9.0.2 and yangtools-7.0.2-SNAPSHOT to pick up their
bugfixes.

Change-Id: I2394c3bfcd300caeb16530db0783e544476d516c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUpdate yangtools to 7.0.1
Robert Varga [Sun, 9 May 2021 05:12:38 +0000 (07:12 +0200)]
Update yangtools to 7.0.1

We have an upstream release, use it instead of snapshots.

Change-Id: I78f5726fb0754dcedc18cdebc680b12d948e82d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump to odlparent-9.0.0/yangtools-7.0.1-SNAPSHOT
Robert Varga [Tue, 22 Dec 2020 21:01:36 +0000 (22:01 +0100)]
Bump to odlparent-9.0.0/yangtools-7.0.1-SNAPSHOT

Aside from the usual mechanical updates, we need to also rewrite
mdsal-binding-generator-impl, as its mechanics relied completely on
TypeDefinition.getPath(), which is no longer available.

The rewritten component is a wee bit more navigable, making a number of
deficiencies clearly visible. These are marked as FIXMEs for future
improvements.

One such problem arises when we attempt to create a derived type from an
enumeration: here we ended up generating an empty DTO rather than
properly specializing the type. Attempting to retain compatibility would
be fruitless, as it would violate a number of method signatures.

Furthermore leafref resolution is made stricter, requiring that
references actually point to a leaf, not to a random location -- which
was true in abstract-topology@2013-02-08.yang test model.

Another change revolves around nested union types. These previously
ended up being flattened in the class hierarchy, i.e. siblings of the
generated type and enclosed in the top-level type. Refactored code
structure is showing this is inconsistent, as bits/enums end up not as
siblings, but rather normal enclosed types.

This patch leaves a bit of dead code, deactivated test cases as well as
a few uncaught codegen regressions. These will be rectified by follow-up
patches.

JIRA: MDSAL-503
Change-Id: I40c445aa1d3f79fd55f6e8007db1259d9a09c8d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoCentralize union/leafref naming
Robert Varga [Fri, 7 May 2021 13:41:58 +0000 (15:41 +0200)]
Centralize union/leafref naming

We have open-coded dependency between dom-codec and generator-impl where
union member naming is concerned. The entire glue here is rather funky
and flaky, make sure the construction is captured in BindingMapping and
use the magic from there.

Change-Id: I3e19f41b7bab8b8431beae37e4e712e09153e883
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImprove binding-dom-codec assertions
Robert Varga [Fri, 30 Apr 2021 15:44:33 +0000 (17:44 +0200)]
Improve binding-dom-codec assertions

We are using a plain checkState(boolean), improve it with a message,
to get some diagnostic when things go wrong.

Change-Id: Ided7ba1f546ea8b861cbb2ec99fae5a8305e97eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImprove mdsal-binding-java-api-generator asserts
Robert Varga [Fri, 30 Apr 2021 09:18:48 +0000 (11:18 +0200)]
Improve mdsal-binding-java-api-generator asserts

Use proper assertNotNull() and also be more defensive about type
ordering.

Change-Id: If1ea743a85d8a4bc24db857efa9a8e2ddb2c8791
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoImprove CompilationTest assertions
Robert Varga [Wed, 28 Apr 2021 18:24:38 +0000 (20:24 +0200)]
Improve CompilationTest assertions

Annotation assertions could use a bit of love, fix that.

Change-Id: I10b5ea21d50a74c198f1565025e6fb4af6877b6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix context-reference test
Robert Varga [Wed, 28 Apr 2021 17:33:08 +0000 (19:33 +0200)]
Fix context-reference test

The test relies on overly-broad definition of context reference, but we
should only be binding to yang-ext. Fix that.

Change-Id: I43d6beecf2af50f275408fb103b60fbe4633dbee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump byte-buddy to 1.11.0
Robert Varga [Mon, 19 Apr 2021 08:40:23 +0000 (10:40 +0200)]
Bump byte-buddy to 1.11.0

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.21
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.22
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.11.0

Change-Id: I1d31c7b5297fd28b13297aa44c03593770fc7409
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSwitch to com.guicedee.services/javax.inject
Robert Varga [Tue, 13 Apr 2021 14:00:44 +0000 (16:00 +0200)]
Switch to com.guicedee.services/javax.inject

odlparent is removing the declaration of this old artifact, switch
to using the GuicedEE version.

Change-Id: I5acddef14039fe6b1558748636a7c25348569008
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoCleanup yang model whitespace
Robert Varga [Mon, 12 Apr 2021 16:39:57 +0000 (18:39 +0200)]
Cleanup yang model whitespace

We have a ton of trailing whitespace, clean it up.

Change-Id: Ib7f5ae567b83f5b5172386fc496728e8c48131c2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdd 'var', 'yield' and 'record' to Java reserved words
Robert Varga [Mon, 2 Sep 2019 15:50:50 +0000 (17:50 +0200)]
Add 'var', 'yield' and 'record' to Java reserved words

Update reserved words with:
- var, which is reserved since Java 10
- yield, which is reserved since Java 14
- record, which is reserved since Java 16

Change-Id: Ia3455cf60d5afa4b83dfb5cb92364a2d1a6bfb7b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSkip java-api-generator tests when running on windows-type OS
Oleksii Mozghovyi [Tue, 6 Apr 2021 20:06:27 +0000 (23:06 +0300)]
Skip java-api-generator tests when running on windows-type OS

Xtend code generation uses the "line.separator" system property to
generate proper line endings, and there is no possibility to override
this setting w/o modifying the system property. This change disables
some tests to avoid misleading failures when running those on the
windows type os.

Change-Id: I8c9b2776d45a149debe3948ef0d2ce8a682c79d6
Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoCleanup GeneratedTypeBuilder/enclosing mechanics
Robert Varga [Tue, 6 Apr 2021 11:18:59 +0000 (13:18 +0200)]
Cleanup GeneratedTypeBuilder/enclosing mechanics

Rather than requiring a Builder to enclose types, use an already-built
type. This allows splitting out the product phases.

Change-Id: I8bcebb1a010272eadd065cff465d16bbc5992043
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove parent type references
Robert Varga [Tue, 6 Apr 2021 11:52:28 +0000 (13:52 +0200)]
Remove parent type references

Requiring Constant, Enumeration, GeneratedType and TypeMember to
report its enclosing/parent type leads to circular dependencies, as
the parent type needs to report the objects as well. This leads to
the requirement to perform callouts from constructor -- utterly fusing
parents and children together.

As it turns out, though, these references are not used anywhere and
hence we can completely ditch them.

Change-Id: Ic9bfa6d0b69ffa3bdc1cd02c824405c9e22d0375
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBindingGenerator methods return GeneratedTypes
Robert Varga [Thu, 25 Mar 2021 15:47:47 +0000 (16:47 +0100)]
BindingGenerator methods return GeneratedTypes

The documentation is explicit here and implementation does exactly
this. Update return types to reflect this, which allows us to simplify
at least tests.

Since we are touching tests, improve their assertions by asserting the
number of generated types rather than blanket
assertFalse(types.isEmpty()).

Change-Id: I62a44f0b39f17c26334ade4af2a96337f3ad6504
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix String length checker
Robert Varga [Wed, 24 Feb 2021 00:11:08 +0000 (01:11 +0100)]
Fix String length checker

We are enforcing length restrictions on String.length(), which is
the wrong measure, as it returns the number of code units in the
String. We actually want to compare the number of code points, i.e.
we need to use String.codePointCount().

JIRA: MDSAL-661
Change-Id: I7291aabb67ec9d002cdeb52befd1723707113121
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump odlparent/yangtools to 8.1.1/6.0.5
Robert Varga [Wed, 24 Feb 2021 15:35:58 +0000 (16:35 +0100)]
Bump odlparent/yangtools to 8.1.1/6.0.5

Adopt latest versions.

Change-Id: I2bc8323184ac482daf59812b907b3c4ecd27f025
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove an unused import
Robert Varga [Wed, 24 Feb 2021 00:08:12 +0000 (01:08 +0100)]
Remove an unused import

This is an xtend/java warning, fix it.

Change-Id: Iedb1472972de60e2074d1adf967815129705c08d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDo not generate 'isFoo()' methods
Robert Varga [Fri, 18 Dec 2020 17:28:28 +0000 (18:28 +0100)]
Do not generate 'isFoo()' methods

Remove compatibility boolean getter generation, i.e.
'Boolean getFoo()' methods no longer get 'Boolean isFoo()' siblings.

JIRA: MDSAL-659
Change-Id: Ib7111ea600296ce1d55730c1d9c754abf3f4f78b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove deprecated uint migration elements, take 2
Robert Varga [Fri, 5 Feb 2021 16:31:21 +0000 (17:31 +0100)]
Remove deprecated uint migration elements, take 2

It's been 18 months since we introduced this particular change in
mapping, giving ample time for users to migrate.

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

JIRA: MDSAL-490
Change-Id: I03c80a92dbb6bb429b5bd939cb2068a0289defc5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRemove setFoo(List) compatibility setters
Robert Varga [Sun, 19 Jul 2020 12:00:58 +0000 (14:00 +0200)]
Remove setFoo(List) compatibility setters

A migration setter was present to eash downstream users'
migration from List<Foo> to Map<FooKey, Foo>. This is no longer
necessary, remove the setter.

JIRA: MDSAL-540
Change-Id: I587ff1eaf81fca912cdb0c1370d1fd7ecd248d7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Illia <illia.ihushev@pantheon.tech>
2 weeks agoBump versions to 8.0.0-SNAPSHOT
Robert Varga [Fri, 5 Feb 2021 08:13:21 +0000 (09:13 +0100)]
Bump versions to 8.0.0-SNAPSHOT

This starts the next major development iteration.

Change-Id: I345d38f8e9e77aba90fa00a6282a59668abf8d97
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUpdate byte-buddy integration
Robert Varga [Wed, 3 Feb 2021 09:16:53 +0000 (10:16 +0100)]
Update byte-buddy integration

Update ByteBuddy to 1.10.20.

Reuse ElementMatcher for isDefaultConstructor(), lowering
the amount of garbage we potentially generate. While we are at it
make sure our intra-package use patters are more consistent.

Change-Id: I5cc297129c4b04eade4d1a8a9dfb96cd8504554e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBump versions to 7.0.6-SNAPSHOT
Robert Varga [Mon, 25 Jan 2021 14:44:18 +0000 (15:44 +0100)]
Bump versions to 7.0.6-SNAPSHOT

This starts the next development iteration.

Change-Id: I9981dbfe7447c995cfad982d5bb2108b470e066d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdopt odlparent-8.1.0/yangtools-6.0.4
Robert Varga [Thu, 21 Jan 2021 13:04:44 +0000 (14:04 +0100)]
Adopt odlparent-8.1.0/yangtools-6.0.4

Adopt OSGi R7 as well by migrating osgi.core pointers to the new
place.

Change-Id: I7351883bd53c40b82abda744d9eefcb49ef183d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix a few sonar warnings
Robert Varga [Thu, 14 Jan 2021 17:28:58 +0000 (18:28 +0100)]
Fix a few sonar warnings

Sonar is pointing out a few trivial issues, fix them up.

Change-Id: I6dc7a9d842404f5826279b800763f3044ee5ab9f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse doCallRealMethod() instead of when()
Robert Varga [Sat, 9 Jan 2021 08:51:08 +0000 (09:51 +0100)]
Use doCallRealMethod() instead of when()

We use doReturn() and similar across the board, fix this single
outlier.

Change-Id: I47866407b30613e3af61cd9d429930269cb4e60b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix Javadoc deprecation links
Robert Varga [Sat, 9 Jan 2021 07:33:29 +0000 (08:33 +0100)]
Fix Javadoc deprecation links

There is a typo in specification of the reference, leading to
this bit being rendered without a link. Fix that.

Change-Id: Id58978511ef601471d76e8a8f962df96f2e26a4f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 40d9da9d71a301c6df20899cb6082658a4361781)

2 weeks agoBump versions to 7.0.5-SNAPSHOT
Robert Varga [Fri, 8 Jan 2021 13:35:13 +0000 (14:35 +0100)]
Bump versions to 7.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: I2dcf27e5cd4523922a0bda00f9b5ea11e61ed550
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoBe more defensive around List types
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>
2 weeks agoFix javadoc formatting in interfaces
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>
2 weeks agoMigrate getDataChildByName() users
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>
2 weeks agoBump to odlparent-8.0.3/yangtools-6.0.3
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>
2 weeks agoFix module name reference
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>
2 weeks agoUpdate mdsal-binding-dom-codec-spi JPMS
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>
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>