mdsal.git
5 years agoEnable spotbugs in mdsal-binding-dom-codec-osgi 08/76908/1
Robert Varga [Thu, 11 Oct 2018 18:57:37 +0000 (20:57 +0200)]
Enable spotbugs in mdsal-binding-dom-codec-osgi

This fixes up the issues reported and flips enforcement to on.

Change-Id: Ia58b4f08fb1b594446cec458268586db8df8d62c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable spotbugs in yang-binding 07/76907/1
Robert Varga [Thu, 11 Oct 2018 18:49:01 +0000 (20:49 +0200)]
Enable spotbugs in yang-binding

This fixes up the issues reported and flips enforcement to on.

Change-Id: I2e9b0c82af063d322428216be40e7562959f0824
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable spotbugs in mdsal-binding-generator-util 06/76906/1
Robert Varga [Thu, 11 Oct 2018 18:43:43 +0000 (20:43 +0200)]
Enable spotbugs in mdsal-binding-generator-util

This fixes up the issues reported and flips enforcement to on.

Change-Id: I2f9d96aff277864f7e1edc1be69d45610947a250
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable mdsal-binding-generator-api spotbugs 05/76905/1
Robert Varga [Thu, 11 Oct 2018 18:32:36 +0000 (20:32 +0200)]
Enable mdsal-binding-generator-api spotbugs

This just flips enforcement to on.

Change-Id: I7fac526f853d156ff6c8d2c60433944f7670b9d6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable spotbugs in mdsal-binding-spec-util 04/76904/1
Robert Varga [Thu, 11 Oct 2018 18:31:02 +0000 (20:31 +0200)]
Enable spotbugs in mdsal-binding-spec-util

This fixes up the issues reported and flips enforcement to on.

Change-Id: I24d7722143253cc4c16cfac6f6d38976741ee6b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable mdsal-binding-util spotbugs 03/76903/1
Robert Varga [Thu, 11 Oct 2018 18:11:52 +0000 (20:11 +0200)]
Enable mdsal-binding-util spotbugs

This just flips enforcement to on.

Change-Id: I53d63c44e27a52d152535a0218d4b83f2ee35f59
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable spotbugs in entity-ownership-service 02/76902/1
Robert Varga [Thu, 11 Oct 2018 18:08:51 +0000 (20:08 +0200)]
Enable spotbugs in entity-ownership-service

This fixes up the issues reported and flips enforcement to on.

Change-Id: Ifd8201eb6ad60c133559bc29b40fda487f4d2c5e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in mdsal-binding-java-api-generator 92/76892/3
Robert Varga [Thu, 11 Oct 2018 15:38:26 +0000 (17:38 +0200)]
Fix checkstyle in mdsal-binding-java-api-generator

This fixes violations and flips enforcement on.

Change-Id: I08d96c67c0d072655529ed9890b85ca1c4e7059f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable spotbugs in singleton-service 01/76901/1
Robert Varga [Thu, 11 Oct 2018 17:49:59 +0000 (19:49 +0200)]
Enable spotbugs in singleton-service

This fixes up the issues reported and flips enforcement to on.

Change-Id: If2c1b8214a552f791eda8c68da12cafd59ad6a10
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable mdsal-dom-inmemory-datastore spotbugs 98/76898/2
Robert Varga [Thu, 11 Oct 2018 17:43:26 +0000 (19:43 +0200)]
Enable mdsal-dom-inmemory-datastore spotbugs

This fixes up the issues reported and flips enforcement to on.

Change-Id: Ic475fd76d3449c2ab165b2e5da41b693edb3cb8b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable mdsal-dom-schema-service-osgi spotbugs 94/76894/3
Robert Varga [Thu, 11 Oct 2018 17:34:28 +0000 (19:34 +0200)]
Enable mdsal-dom-schema-service-osgi spotbugs

This just flips enforcement to on.

Change-Id: I3a3495d3442c6231e9fc25dc7d9ffab099bc75f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable mdsal-dom-broker spotbugs 97/76897/2
Robert Varga [Thu, 11 Oct 2018 16:42:48 +0000 (18:42 +0200)]
Enable mdsal-dom-broker spotbugs

This fixes up the issues reported and flips enforcement to on.

Change-Id: Iae6de422f027e6413b4e3021d4324b051f41a513
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSwitch mdsal-binding-test-utils to spotbugs 93/76893/2
Robert Varga [Thu, 11 Oct 2018 16:35:50 +0000 (18:35 +0200)]
Switch mdsal-binding-test-utils to spotbugs

This changes from findbugs to spotbugs.

Change-Id: I4f59b2ee72e593ac26d8f91fa3802d3ef87e6994
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in mdsal-binding-util-tests 87/76887/1
Robert Varga [Thu, 11 Oct 2018 15:33:38 +0000 (17:33 +0200)]
Fix checkstyle in mdsal-binding-util-tests

This fixes a single violation and flips enforcement on.

Change-Id: I9b5aca10dc74f540d98fa4dca5db08b888ef4f8b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in mdsal-binding-generator-impl 78/76878/4
Robert Varga [Thu, 11 Oct 2018 13:39:22 +0000 (15:39 +0200)]
Fix checkstyle in mdsal-binding-generator-impl

This fixes violations and flips enforcement on.

Change-Id: Ida4e62f4c3ddf4d7d8066f3858e6ab98f0f92cf1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in mdsal-binding-generator-util 77/76877/3
Robert Varga [Thu, 11 Oct 2018 12:31:01 +0000 (14:31 +0200)]
Fix checkstyle in mdsal-binding-generator-util

This fixes violations and flips enforcement on.

Change-Id: Ibc12e6595498c4349695d62bcd74f3d126f4b8e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable checkstyle in mdsal-binding-util 73/76873/2
Robert Varga [Thu, 11 Oct 2018 12:20:03 +0000 (14:20 +0200)]
Enable checkstyle in mdsal-binding-util

This fixes a few violations and flips enforcement on.

Change-Id: I6b0de1511bda6ad509991f343c2a456ba67866d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable checkstyle in mdsal-binding-spec-util 72/76872/2
Robert Varga [Thu, 11 Oct 2018 12:13:39 +0000 (14:13 +0200)]
Enable checkstyle in mdsal-binding-spec-util

This flips enforcement on.

Change-Id: I8e3db62a29d21fe727b1c31b0c3982b42eb58444
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable checkstyle in mdsal-binding-generator-api 70/76870/2
Robert Varga [Thu, 11 Oct 2018 12:09:40 +0000 (14:09 +0200)]
Enable checkstyle in mdsal-binding-generator-api

This fixes a few violations and flips enforcement on.

Change-Id: Id55c011e8a7f5e85e678aefe793e6aba585ee083
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable checkstyle in mdsal-dom-schema-service-osgi 69/76869/2
Robert Varga [Thu, 11 Oct 2018 11:43:13 +0000 (13:43 +0200)]
Enable checkstyle in mdsal-dom-schema-service-osgi

This fixes a few violations and flips enforcement on.

Change-Id: I336e1624564f9f41c62f96294ebf5c9ef0ca839c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove redundant string operations 65/76865/3
Stephen Kitt [Thu, 11 Oct 2018 09:58:14 +0000 (11:58 +0200)]
Remove redundant string operations

* use StringBuilder::append to extract substrings directly;
* split combined append/concatenation into multiple append calls;
* use "" instead of new String();
* remove a couple of unnecessary toString() calls.

Change-Id: If09efe90d756c3b1faf30c27eb94d514593a4861
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSeparate out builder/impl copy generators 29/76829/3
Robert Varga [Wed, 10 Oct 2018 17:43:41 +0000 (19:43 +0200)]
Separate out builder/impl copy generators

Builders are taking an immutable implementation of target type,
hence for list entries they can rely on the key to be present and
do not have to check it. Implementations need to account
for the builder key being set to null, hence they need to
instantiate the key themselves.

This patch separates the two code paths, so both cases are properly
expressed in the object hierarchy. This allows us to simplify
the abstract template, removing weird boolean-based decisions.

We also promote implementation constructor to package-visible, which
allows javac to skip generation of synthetic accessor.

We further optimize the template output by capturing importedNames
when they are reused -- leading to xtend generating cleaner Java code.

JIRA: MDSAL-374
Change-Id: I3274e35780b8e6a56d470caf80459e9e115a5374
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd feature-parent 41/76841/4
Robert Varga [Wed, 10 Oct 2018 23:15:57 +0000 (01:15 +0200)]
Add feature-parent

This adds a utility parent (useful for downstreams, too),
which adds the mdsal imports.

Change-Id: If1bdad409b08a3f7cc47852b73439b18b1e07936
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove project.groupId use 40/76840/3
Robert Varga [Wed, 10 Oct 2018 23:13:44 +0000 (01:13 +0200)]
Remove project.groupId use

Having explicit groupId make things more explicit, making it a wee
bit more navigable between mdsal proper and models.

Change-Id: Ib7cce538930b51268e960cf27f4cbd8dbbec9793
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse properties to skip deploy/install 99/76799/2
Stephen Kitt [Tue, 9 Oct 2018 14:21:50 +0000 (16:21 +0200)]
Use properties to skip deploy/install

odlparent-lite recognises maven.deploy.skip and maven.install.skip to
skip the deploy and install plugins, use those instead of re-declaring
the plugins.

Change-Id: I5cd645fe810b54e018abdb2f12487037ba3b01d8
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoSort out BindingCodecTreeNode.streamChild() nullness 67/76767/8
Robert Varga [Mon, 8 Oct 2018 17:52:21 +0000 (19:52 +0200)]
Sort out BindingCodecTreeNode.streamChild() nullness

This method really cannot return null, which means there is some
dead code in DataContainerCodecContext. Remove the FIXME and kill
the superfluous code.

Change-Id: I7ee3e86b10e1ad2ccc5cfaa4aad228654b1445c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFixup null warnings reported by eclipse 63/76763/10
Robert Varga [Mon, 8 Oct 2018 17:29:20 +0000 (19:29 +0200)]
Fixup null warnings reported by eclipse

JDT annotations are flushing out some lazyness in tests, fix that
up by throwing UnsupportedOperationExceptions and proper mocking
in most places.

Change-Id: I2374a368e4a361c0e58d61e4b563f98036b4c540
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate mdsal-binding-dom-codec to JDT annotations 52/76752/20
Robert Varga [Mon, 8 Oct 2018 13:12:08 +0000 (15:12 +0200)]
Migrate mdsal-binding-dom-codec to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package.

Change-Id: I436b9f0d0b3c835fce9da9e4c99e4dad273f9bbe
JIRA: MDSAL-373
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOverride scala-lang to 2.11.12 92/76792/2
Robert Varga [Tue, 9 Oct 2018 12:59:31 +0000 (14:59 +0200)]
Override scala-lang to 2.11.12

In order to build with JDK10, we need to make sure we pull in
the latest 2.11.x scala.

Change-Id: Iccea3ffebed11580fc7ad108f5988a88e0e7a597
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump scala-maven-plugin 91/76791/2
Robert Varga [Tue, 9 Oct 2018 12:54:43 +0000 (14:54 +0200)]
Bump scala-maven-plugin

We cannot use the latest plugin because of maven-3.5.4 requirement,
hence bump it just a bit.

Change-Id: I1f74835d38291cb93bd8997665e198d41fd2ee9c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unneeded dependencies 02/76802/2
Robert Varga [Tue, 9 Oct 2018 14:49:10 +0000 (16:49 +0200)]
Remove unneeded dependencies

odlparent is declaring test dependencies for us, and also
declares osg.core correctly. yangtools also declares test utils
with proper scope, hence we can remove those overrides, too.

Change-Id: I7c4f18313b32123043242b36b573263afde40962
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse dom-parent internally 01/76801/2
Robert Varga [Tue, 9 Oct 2018 14:27:25 +0000 (16:27 +0200)]
Use dom-parent internally

dom-parent is essentially an mdsal-level bundle-parent, as it
inherits from bundle-parent and brings in dependencyManagement
we (and our downstreams) need.

Reuse this parent pom across the project, so that we do not have
to repeat dependencyManagement over and over again.

Change-Id: I0575ef37d2eedcd7cda0c69d6dcec3a65af64cf3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove use of Class.newInstance() 93/76793/2
Robert Varga [Tue, 9 Oct 2018 13:12:34 +0000 (15:12 +0200)]
Remove use of Class.newInstance()

This method has been deprecated in JDK9+, use its simple replacement
instead.

Change-Id: I1f7ed3babd4b339d1b1a9cc396b901e7886c985a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix mdsal-binding-spi parent setup 86/76786/2
Robert Varga [Tue, 9 Oct 2018 11:01:53 +0000 (13:01 +0200)]
Fix mdsal-binding-spi parent setup

We need to have a relativePath to work correctly.

Change-Id: I8ab8e034001ce73546d73f7629ffe36b7ecb4b41
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable spotbugs in mdsal-{binding,dom}-spi 89/76789/2
Robert Varga [Tue, 9 Oct 2018 11:40:52 +0000 (13:40 +0200)]
Enable spotbugs in mdsal-{binding,dom}-spi

This patch addresses violations and flips the switch.

Change-Id: I9a0a715b26d42cff395f6448323be1b6e52b162d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable spotbugs in mdsal-{common,binding,dom}-api 83/76783/2
Robert Varga [Tue, 9 Oct 2018 10:35:22 +0000 (12:35 +0200)]
Enable spotbugs in mdsal-{common,binding,dom}-api

This suppresses the single violation and flips the switch.

Change-Id: I48e8364604192a973a05bf35631551091403e2b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDeprecate BaseYangTypes.UnionType 64/76764/8
Robert Varga [Mon, 8 Oct 2018 17:30:48 +0000 (19:30 +0200)]
Deprecate BaseYangTypes.UnionType

This class is not used anywhere and is defunct due to nullness
violation. Deprecate it for removal.

Change-Id: Icfdda71931571b8bf98f0f4d65a783447db13f7e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate mdsal-binding-dom-adapter to JDT annotations 54/76754/16
Robert Varga [Mon, 8 Oct 2018 13:29:40 +0000 (15:29 +0200)]
Migrate mdsal-binding-dom-adapter to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package.

Change-Id: I220ed55636d3a4a4bc3e4c39a6169541f89cf283
JIRA: MDSAL-373
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate ietf-type-util to JDT annotations 62/76762/6
Robert Varga [Mon, 8 Oct 2018 16:52:05 +0000 (18:52 +0200)]
Migrate ietf-type-util to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package.

Change-Id: I05d01bb4aa3a8e343432987e8a66e06971d22e69
JIRA: MDSAL-373
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSuppress javax.annotation imports in yang-binding 61/76761/6
Robert Varga [Mon, 8 Oct 2018 16:24:54 +0000 (18:24 +0200)]
Suppress javax.annotation imports in yang-binding

We do not want to generate references to javax.annotation, remove
it from imports.

Change-Id: I2edffd282db530c6052b3541a553d52e33c3fd78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate mdsal-dom-inmemory-datastore to JDT annotations 51/76751/15
Robert Varga [Mon, 8 Oct 2018 12:45:49 +0000 (14:45 +0200)]
Migrate mdsal-dom-inmemory-datastore to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package.

Change-Id: I9b05210e5a927e78085779e216fde8cd2142c30b
JIRA: MDSAL-373
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate mdsal-dom-broker to JDT annotations 50/76750/15
Robert Varga [Mon, 8 Oct 2018 12:41:51 +0000 (14:41 +0200)]
Migrate mdsal-dom-broker to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package.

Change-Id: Idabf3b89a4aad9b04168126d5ea9ebee1268b1f9
JIRA: MDSAL-373
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate mdsal-dom-spi to JDT annotations 49/76749/14
Robert Varga [Mon, 8 Oct 2018 12:32:48 +0000 (14:32 +0200)]
Migrate mdsal-dom-spi to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package.

Change-Id: Ic7751f6fbffeb063ddda0bf4dc8b7dc7b66f7c80
JIRA: MDSAL-373
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate mdsal-dom-api to JDT annotations 48/76748/12
Robert Varga [Mon, 8 Oct 2018 12:17:30 +0000 (14:17 +0200)]
Migrate mdsal-dom-api to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package.

JIRA: MDSAL-373
Change-Id: Ida93d05898d6b9d967e240096feb4d1092e02e87
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate mdsal-dom-schema-service-osgi to JDT annotations 47/76747/10
Robert Varga [Mon, 8 Oct 2018 11:59:33 +0000 (13:59 +0200)]
Migrate mdsal-dom-schema-service-osgi to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package.

Change-Id: Ife7598dcaca40e2bacc32f2da679cd85f60c1567
JIRA: MDSAL-373
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate entity ownership to JDT annotations 44/76744/10
Robert Varga [Mon, 8 Oct 2018 11:53:28 +0000 (13:53 +0200)]
Migrate entity ownership to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package.

Change-Id: If89fd8302e1e709c23c6802e3e10341f96bcfe00
JIRA: MDSAL-373
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate mdsal-singleton-dom-impl to JDT annotations 42/76742/11
Robert Varga [Mon, 8 Oct 2018 10:59:25 +0000 (12:59 +0200)]
Migrate mdsal-singleton-dom-impl to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package.

JIRA: MDSAL-373
Change-Id: I6b0683321f0f499383fb36e9658e9ba643f82b92
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate mdsal-common-api to JDT annotations 41/76741/11
Robert Varga [Mon, 8 Oct 2018 10:54:54 +0000 (12:54 +0200)]
Migrate mdsal-common-api to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package. Also improve APIs by annotating additional
elements with @NonNull and reusing FluentFutures, which are more JDT
friendly.

JIRA: MDSAL-373
Change-Id: I9cb82bcb5bd755dbb544efeefeb9a0ebec3cb69c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove mdsal-binding-util javax.annotation.Nullable reference 39/76739/11
Robert Varga [Mon, 8 Oct 2018 10:42:26 +0000 (12:42 +0200)]
Remove mdsal-binding-util javax.annotation.Nullable reference

This removes the use of javax.annotation nullable annotations
to remove import-package.

JIRA: MDSAL-373
Change-Id: Iace3fb91218fae8ccc8d65b5f295f865dc1ba94c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate mdsal-binding-generator-impl to JDT annotations 38/76738/9
Robert Varga [Mon, 8 Oct 2018 10:40:07 +0000 (12:40 +0200)]
Migrate mdsal-binding-generator-impl to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package.

JIRA: MDSAL-373
Change-Id: I51519c4587dfe6a06fb9f875c6e6e410192c0cc9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate mdsal-binding-spi to JDT annotations 37/76737/8
Robert Varga [Mon, 8 Oct 2018 10:39:48 +0000 (12:39 +0200)]
Migrate mdsal-binding-spi to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package.

JIRA: MDSAL-373
Change-Id: Ibaa0506b451e9f06fff05ed3043acb707609fba1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAnnotate mdsal-binding-api with @NonNull 40/76740/8
Robert Varga [Mon, 8 Oct 2018 10:48:57 +0000 (12:48 +0200)]
Annotate mdsal-binding-api with @NonNull

This fixes a mismatch with mdsal-binding-util and formalizes
existing effective contracts.

JIRA: MDSAL-373
Change-Id: I98914a04fb0efb8f5ebd70058f39f9fb36bdf5b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate mdsal-binding-api to JDT annotations 36/76736/6
Robert Varga [Mon, 8 Oct 2018 10:35:44 +0000 (12:35 +0200)]
Migrate mdsal-binding-api to JDT annotations

This removes the use of javax.annotation nullable annotations
to remove import-package. Since we are using @CheckReturnValue
we also need to explicitly remove javax.annotation import.

JIRA: MDSAL-373
Change-Id: I2c18495a5082fb79a61278580c67ec3a21b979af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix up testShardRegistrationClose 33/76733/1
han [Mon, 8 Oct 2018 09:22:37 +0000 (17:22 +0800)]
Fix up testShardRegistrationClose

Change-Id: I40d0fca6554a343f008fed5760256281d35e9f92
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agoMake sure we compare key members via their property name 50/76650/4
Robert Varga [Thu, 4 Oct 2018 15:17:42 +0000 (17:17 +0200)]
Make sure we compare key members via their property name

As it turns out, simple comparison ignoring cases does not correctly
work if the schema is using CamelCase. We need to do the hard work of
deriving Binding property name and sort on that to be consistent with
what the codegen does.

JIRA: MDSAL-355
Change-Id: I34cdb032fbdeb093e2973b91c5011e302e6280bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump versions to 3.0.1-SNAPSHOT 87/76687/1
Robert Varga [Fri, 5 Oct 2018 06:31:53 +0000 (08:31 +0200)]
Bump versions to 3.0.1-SNAPSHOT

This starts the next development cycle.

Change-Id: I1f1e0381f1abf9ae89c2c17ca3eb6ead58ce201a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMove rfc7895 model 59/76659/1
Robert Varga [Thu, 4 Oct 2018 16:52:18 +0000 (18:52 +0200)]
Move rfc7895 model

This fixes up the groupId for rfc7895 to match packaging requirements.

Change-Id: I599a0574553bd1447f473ac9a293985d847f8786
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDrop Xtend Equinox Common overrides 49/76649/2
Stephen Kitt [Thu, 4 Oct 2018 14:52:06 +0000 (16:52 +0200)]
Drop Xtend Equinox Common overrides

These are no longer necessary and make it harder than it should be to
upgrade Xtend in odlparent.

Change-Id: I3196ad374895e8e96f71f79529dde578913589ab
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoImplement managed transactions 43/75943/13
Stephen Kitt [Mon, 10 Sep 2018 16:31:07 +0000 (18:31 +0200)]
Implement managed transactions

Managed transactions ensure that transactions are always closed in the
appropriate way:
* read-only transactions are closed when they are no longer needed;
* read-write and write-only transactions are submitted if the code
  manipulating them didn’t throw an exception, cancelled otherwise.

Managed transactions are datastore-specific and enforce either
configuration or operational reads and writes.

Two providers are included: a basic transaction manager which provides
transactions, ensures they are closed, without any extras, and a
retrying transaction manager which will retry if a retriable error
occurs (i.e. an OptimisticLockFailedException when writing, or a
ReadFailedException when reading).

This is copied from Genius where it’s used extensively; it’s also used
in NetVirt.

Change-Id: I391ca4ca50d1b1177d827e33c0d11e98378e1fb4
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoRevert "MDSAL-361: Deal with restricted types in unions" 44/76644/1
Robert Varga [Thu, 4 Oct 2018 13:58:45 +0000 (15:58 +0200)]
Revert "MDSAL-361: Deal with restricted types in unions"

This reverts commit 47693173debca78b74858ca15080445fc93d0953, as it
breaks on openconfig-network-instance-types.yang -- the construction
results in wring constants being generated and also conflicting
constructors being present.

Change-Id: If7e3fa155e83d454570beca64e92956e69987b10
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump 2.7.0-SNAPSHOT to 3.0.0-SNAPSHOT 36/76636/2
Robert Varga [Thu, 4 Oct 2018 09:39:28 +0000 (11:39 +0200)]
Bump 2.7.0-SNAPSHOT to 3.0.0-SNAPSHOT

We are just about ready for release, with all significant external
versions harmonized to 2.7.0-SNAPSHOT. Switch this to 3.0.0-SNAPSHOT
in preparation for mdsal-3.0.0.

Change-Id: Ia9a6e8e9714e6a75eba479a4e5daf56ab5520a89
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate iana-if-type revision and packaging 40/76640/1
Robert Varga [Thu, 4 Oct 2018 10:10:53 +0000 (12:10 +0200)]
Update iana-if-type revision and packaging

This bumps packaged model to the latest available registry
and repackages it to match packaging rules.

Change-Id: I0947f90bedf8c628eaf6e68c21344ef72ed0c6cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup binding spec artifact versions 35/76635/2
Robert Varga [Thu, 4 Oct 2018 09:26:30 +0000 (11:26 +0200)]
Cleanup binding spec artifact versions

This bumps binding specification and related artifacts to version
1.0.0-SNAPSHOT.

Change-Id: Ia9fa86179e13eb5ec4a00a519ebba56311722a64
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoHarmonize parent versions with MD-SAL version 33/76633/2
Robert Varga [Thu, 4 Oct 2018 08:38:58 +0000 (10:38 +0200)]
Harmonize parent versions with MD-SAL version

We want to keep entrypoints at the same versions -- i.e.
mdsal-artifacts and all parents, so users have an easier time
figuring out inconsistencies.

Change-Id: I014ef6db9649a9f8b42a2bf5ab76776a8816c467
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove common/parent 34/76634/2
Robert Varga [Thu, 4 Oct 2018 09:13:03 +0000 (11:13 +0200)]
Remove common/parent

This parent is not used anywhere and it is rather dysfunctional,
remove it.

Change-Id: I2f0c78f8a28c612f91997dc1478dd8d296abd6e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove binding2/prototype 32/76632/2
Robert Varga [Thu, 4 Oct 2018 08:18:17 +0000 (10:18 +0200)]
Remove binding2/prototype

This code is not plugged into build, hence it is pure clutter.

Change-Id: I69139ceef2a26136a91e9c8cbc0ad95559eefc8c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup aggregator poms 31/76631/2
Robert Varga [Thu, 4 Oct 2018 08:13:17 +0000 (10:13 +0200)]
Cleanup aggregator poms

Aggregators should not be installed/deployed and should have
a version harmonized with project version (2.7.0-SNAPSHOT).

Change-Id: I6090c70adbef38fbc3cf3e4f93a551e484f664cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoIntroduce features-mdsal-experimental 30/76630/1
Robert Varga [Thu, 4 Oct 2018 07:40:12 +0000 (09:40 +0200)]
Introduce features-mdsal-experimental

This is a repository for experimental features, currently holding
Binding V2.

Change-Id: I7154f1c2f59556cf77b55ae902815a6fae480820
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMove model features into top-level directory 14/76614/2
Robert Varga [Wed, 3 Oct 2018 16:14:30 +0000 (18:14 +0200)]
Move model features into top-level directory

This eliminates the second feature directory, concentrating all
features in one place.

Change-Id: Idb86b943d59cf5ad532dda8675b9fc2e781e692e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove features-mdsal-model 13/76613/2
Robert Varga [Wed, 3 Oct 2018 16:11:38 +0000 (18:11 +0200)]
Remove features-mdsal-model

Integrate this feature repository into features-mdsal and remove
it.

Change-Id: I53914985e6001e551720379843b8865093831bd6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMove features to top-level directory 12/76612/2
Robert Varga [Wed, 3 Oct 2018 16:01:29 +0000 (18:01 +0200)]
Move features to top-level directory

Move our core feature repository and related features to a top-level
directory.

Change-Id: I6324db25c51ce8e43138e63bc0afe0d010b51b1c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd ForwardingTransaction 16/76616/3
Robert Varga [Wed, 3 Oct 2018 17:03:27 +0000 (19:03 +0200)]
Add ForwardingTransaction

This is an aspect shared by all three flavors of forwarding
transaction, hence we can factor the code out into a common
subclass for reuse.

Change-Id: I2837d20084f54350337a111a0808dbaa2391145e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSplit off Read/WriteOperations from Read/WriteTransaction 15/76615/2
Robert Varga [Wed, 3 Oct 2018 16:39:14 +0000 (18:39 +0200)]
Split off Read/WriteOperations from Read/WriteTransaction

It is oftentimes useful to allow access to a transaction's operations
without allowing the state of the transaction to be modified. This
patch splits off operations from transactions, so proper isolation
can be maintained.

This also resolves the issue of ReadWriteTransaction having both
cancel() and close() methods -- since it has a write aspect, it
inherits lifecycle methods from WriteTransaction.

Change-Id: I98c02c0c5cbcac2432f629973860c56cf2818d6b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in mdsal-binding2-java-api-generator 63/64863/6
Jie Han [Mon, 30 Oct 2017 06:25:43 +0000 (14:25 +0800)]
Fix checkstyle in mdsal-binding2-java-api-generator

- Fix checkstyle issues and activate enforcement.
Change-Id: Id7400f6eb267c822597cf4ff9adb41ba117d3c70
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agoFix checkstyle in mdsal-binding2-generator-util 52/64552/10
Jie Han [Fri, 20 Oct 2017 02:09:21 +0000 (10:09 +0800)]
Fix checkstyle in mdsal-binding2-generator-util

- Fix checkstyle issues and activate enforcement.
Change-Id: I5e83540c54650f899afa9e711d17f4c3efb2e9f0
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agoFix checkstyle in mdsal-binding2-generator-impl 13/64513/10
Jie Han [Thu, 19 Oct 2017 08:18:04 +0000 (16:18 +0800)]
Fix checkstyle in mdsal-binding2-generator-impl

 - - Fix checkstyle issues and activate enforcement.
Change-Id: I5fe421e7389e4c3f1c2d809f6321829b9d7559c5
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agoMDSAL-361: Deal with restricted types in unions 57/76057/4
han [Thu, 13 Sep 2018 09:56:27 +0000 (17:56 +0800)]
MDSAL-361: Deal with restricted types in unions

- Simply address the issue by adding a numeric suffix
  to member type name of the union.

Change-Id: Ie096f9e4795766ca8729daee6f54947ce90d964b
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agoBump yangtools to 2.1.1 09/76609/2
Robert Varga [Wed, 3 Oct 2018 12:50:37 +0000 (14:50 +0200)]
Bump yangtools to 2.1.1

This bumps yangtools to 2.1.1 to version-converge with odlparent-4.0.2

Change-Id: I6cbbb0bfe9029551d3ac69e6f56283e02694aae0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove AsyncDataBroker and related classes 16/76516/4
Robert Varga [Mon, 1 Oct 2018 07:33:39 +0000 (09:33 +0200)]
Remove AsyncDataBroker and related classes

DOM and Binding APIs need to evolve separately, remove the common
straightjacket they were using.

Change-Id: I91f49284c61020fff4b4e262aa03c0a7eca70a06
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove common.api.TransactionChain 78/76078/9
Robert Varga [Thu, 13 Sep 2018 22:40:22 +0000 (00:40 +0200)]
Remove common.api.TransactionChain

This interface needs specialization for both DOM and Binding
levels. While this was partially done, the TransactionChainListener
inteface ended up being clunky.

Disaggregate the TransactionChain concept, by completely eliminating
it from common-api. BindingTransactionChain already existed,
so rename it and define DOMTransactionChain. Support classes are
refactored as well.

Change-Id: I899f1844a2ba84fdc74ba507d3235b87f6a43887
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd a failing DataBroker 63/76563/3
Stephen Kitt [Tue, 2 Oct 2018 14:19:25 +0000 (16:19 +0200)]
Add a failing DataBroker

This imports DataBrokerFailures from Genius; this is a test class
which allows faults to be injected into a data broker.

Change-Id: I89ac278a9291245ca2a1cdc42e14ced4656695b4
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoFix BindingDOMOperationProviderServiceAdapter 10/76510/2
Robert Varga [Mon, 1 Oct 2018 06:39:25 +0000 (08:39 +0200)]
Fix BindingDOMOperationProviderServiceAdapter

This class did not have proper supressions and missing @Override
annotations.

Change-Id: I4850593c95527679462284a61f4d8e036fc50e55
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix some raw types 08/76508/4
Robert Varga [Mon, 1 Oct 2018 06:26:44 +0000 (08:26 +0200)]
Fix some raw types

Add trivial parameterization to silence eclipse.

Change-Id: I92642b35426f9582ff4578835c0c34146ced207a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unneeded SuppressWarnings 07/76507/2
Robert Varga [Mon, 1 Oct 2018 06:01:54 +0000 (08:01 +0200)]
Remove unneeded SuppressWarnings

We no longer do unsafe casts, remove suppression.

Change-Id: Id8fbd7b9a156265b4a18457c18561129001402e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unused import 06/76506/2
Robert Varga [Mon, 1 Oct 2018 06:01:21 +0000 (08:01 +0200)]
Remove unused import

BaseTemplate no longer uses GTO, remove the import.

Change-Id: I43259e05f251ea87083abd382f7e727d4ffd9624
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix KeyedListAction serialization 04/76504/1
Jakub Tóth [Fri, 14 Sep 2018 08:44:14 +0000 (10:44 +0200)]
Fix KeyedListAction serialization

SchemaRootCodecContext needs to understand both Action and
KeyedListAction, as their parameterizations differ.

JIRA: MDSAL-371
Change-Id: I405a73b1a8ca8801ae1786be704cefe674c5fb72
Signed-off-by: Jakub Tóth <jakub.toth@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump odlparent to 4.0.2 97/76497/1
Robert Varga [Sat, 29 Sep 2018 07:49:20 +0000 (09:49 +0200)]
Bump odlparent to 4.0.2

This bumps the versions to receive updates of plugins.

Change-Id: If5c9346d221d5c4af6e4357b0c0847bc88465dbe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake sure we aggregate sonar reports 94/76394/2
Robert Varga [Sun, 23 Sep 2018 12:46:09 +0000 (14:46 +0200)]
Make sure we aggregate sonar reports

odlparent-4.0.0 is broken w.r.t. sonar, fix this up by aggregating
our execution reports.

Change-Id: I544fb6d196794e25d3892f7fffab44899840793d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to yangtools-2.1.0 65/76265/1
Robert Varga [Wed, 19 Sep 2018 12:15:10 +0000 (14:15 +0200)]
Bump to yangtools-2.1.0

This bumps from snapshot versions to release versions, bringing
us closer to mdsal-3.0.0.

Change-Id: I7cbc43f8814386fd5570ce37c3b96faf2c1f9a91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMDSAL-370: expose LogicalDatastoreType-aware constructor 07/76207/1
Robert Varga [Tue, 18 Sep 2018 08:30:13 +0000 (10:30 +0200)]
MDSAL-370: expose LogicalDatastoreType-aware constructor

This exposes the constructors needed to customize the underlying
data tree instances -- both through direct configuration and via
LogicalDatastoreType.

Change-Id: I056d74f4059cca792aa49e5463570b35e1d0005a
JIRA: MDSAL-370
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b1b71b0d804ed75853e31f92aa61258dcaf503fe)

5 years agoSwitch to odlparent-4.0.0 71/76071/1
Robert Varga [Thu, 13 Sep 2018 17:35:42 +0000 (19:35 +0200)]
Switch to odlparent-4.0.0

Now that odlparent-4.0.0 has been released, we can nail down that
version, getting us closer to our release.

Change-Id: I4669b27c013bd30101db0f45e0ba866da1dbb26e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRequire in-memory datastore 70/75670/3
Robert Varga [Mon, 3 Sep 2018 08:59:58 +0000 (10:59 +0200)]
Require in-memory datastore

mdsal-binding-dom-adapter publishes test-jar for downstreams,
which does not work if IMDS is excluded. Fix that up.

Change-Id: Iefeec6707e5dd94647591dedaba0481cebe07db3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Avoid depending on immutables.value at runtime" 66/75666/1
Robert Varga [Mon, 3 Sep 2018 08:22:47 +0000 (10:22 +0200)]
Revert "Avoid depending on immutables.value at runtime"

This reverts commit 41896a415dd61236b5c385ee1d00b1a61a61a761. It is
no longer needed with immutables-2.7.1.

Change-Id: I61ca9b18899ad4d4168a0d3f7ba95744d71c8098
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMDSAL-151: Add add/del utility methods to builders 99/67999/10
Jie Han [Wed, 7 Feb 2018 06:52:03 +0000 (14:52 +0800)]
MDSAL-151: Add add/del utility methods to builders

- Add 'addTO{ListFieldName}' and 'removeFrom{ListFieldName}'
  to *Builder if there exists list properties.

Change-Id: Id01e93915ea9b5c7a4c42414fe370118ba8df134
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agoMDSAL-17: Binding V2 - Simplify InstanceIdentifer creation 10/67910/16
Jie Han [Mon, 5 Feb 2018 06:49:38 +0000 (14:49 +0800)]
MDSAL-17: Binding V2 - Simplify InstanceIdentifer creation

- Add a static method getInstanceIdentifier to generated interface
  of datastore nodes:

  - If there are list items, just toke its key as inputs, like:
    getInstanceIdentifier(key1, key2,...),

  -Or it would simply be getInstanceIdentifier().

- For choice/case's children data nodes, II does not reference
  choice or case but through them.

- Add unit tests.

Change-Id: Iea592557668fd7a8ab8e6874caaac7b9e834a859
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agomdsal-dom-inmemory-datastore only a test dependency of mdsal-dom-broker 50/75650/3
Michael Vorburger [Fri, 31 Aug 2018 23:20:01 +0000 (01:20 +0200)]
mdsal-dom-inmemory-datastore only a test dependency of mdsal-dom-broker

found in https://github.com/vorburger/opendaylight-etcd/commit/097e0c1c62bc8dac2eef319ff7e2d273aabfd681

Change-Id: I70891d7d30364e0f0cc285fe930af95a5a4288ad
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoRename RFC7277 model artifacts 67/75567/3
Robert Varga [Thu, 30 Aug 2018 12:09:22 +0000 (14:09 +0200)]
Rename RFC7277 model artifacts

This patch renames ietf-ip artifact to follow unified naming.

Change-Id: If1cb032a2e66174d83ab931902e505665e4394ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRename RFC7223 model artifacts 66/75566/3
Robert Varga [Thu, 30 Aug 2018 12:02:37 +0000 (14:02 +0200)]
Rename RFC7223 model artifacts

This patch renames ietf-interfaces artifact to follow unified naming.

Change-Id: Ibc615bc78f16a2b7f281e5eba4ed58f137a0b982
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRename RFC6991 model artifacts 65/75565/3
Robert Varga [Thu, 30 Aug 2018 11:40:30 +0000 (13:40 +0200)]
Rename RFC6991 model artifacts

This patch renames ietf-{inet,yang}-types artifacts to follow
unified naming.

Change-Id: I72e14257f9df4487e8f26940178dee244a4e32cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMerge branch 'mdsal-trace' from controller
Anil Belur [Wed, 29 Aug 2018 12:33:37 +0000 (18:03 +0530)]
Merge branch 'mdsal-trace' from controller

Moved code from controller.git:opendaylight/md-sal/mdsal-trace
to mdsal.git:opendaylight/md-sal/mdsal-trace

Issue-Id: RELENG-1170
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
Change-Id: I653644cd465e069331ca1cffdfa3502515a08771