yangtools.git
5 years agoBump versions to 2.1.3-SNAPSHOT 70/76970/1
Robert Varga [Sat, 13 Oct 2018 12:48:52 +0000 (14:48 +0200)]
Bump versions to 2.1.3-SNAPSHOT

This starts the development of 2.1.3.

Change-Id: I710c410311cff014ed4249a158242400be3c3a62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFixup MinMaxElementsValidation with disappearances 56/76956/4
Robert Varga [Fri, 12 Oct 2018 21:11:22 +0000 (23:11 +0200)]
Fixup MinMaxElementsValidation with disappearances

When a list disappears, even when it has a certain number of minimum
elements, MinMaxElementsValidation should not take any action.
The resposibility for enforcing the list being present when it has
min-elements > 0 falls under perview of MandatoryNodeValidator, which
covers the non-existence of the list at the proper enforcement point
-- something MinMaxElementsValidation cannot do.

JIRA: YANGTOOLS-909
Change-Id: I3612a1c1461456b2bd41651decab1032581f85d1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMinMaxElementsValidation needs to deal with lists disappearing 21/76921/3
Robert Varga [Fri, 12 Oct 2018 09:02:27 +0000 (11:02 +0200)]
MinMaxElementsValidation needs to deal with lists disappearing

Constrained lists may become empty, in which case applying
the modification will result in a non-present TreeNode. In that
case the list needs to count as zero elements rather than tripping
up VerifyException.

MinMaxElementsValidation really needs to become a full-blown proxy
ModificationApplyOperation instead of being piggy-backed on
SchemaAwareApplyOperation, as otherwise can end up tripping up
preconditions which ware dealt by the proxy.

JIRA: YANGTOOLS-909
Change-Id: Ia410231f701223792a821cd69af84b7742fe5156
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDrop the use of project.groupId 20/76820/1
Robert Varga [Wed, 10 Oct 2018 14:06:50 +0000 (16:06 +0200)]
Drop the use of project.groupId

Spelling out org.opendaylight.yangtools makes things more
clear without being too verbose.

Change-Id: I10aabbd4a07eb6d6c25aa8f68157a889ee7ab43e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd bundle-parent and use it 19/76819/1
Robert Varga [Wed, 10 Oct 2018 12:46:41 +0000 (14:46 +0200)]
Add bundle-parent and use it

This concentrates common version definitions into a yangtools
bundle-parent and reuses it them where possible -- shaving almost
500 lines of XML.

Change-Id: Ifc79fee557dc0a49fc0a277c2fafa34199171151
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agojaxb-api should be scope=compile 87/76787/1
Robert Varga [Tue, 9 Oct 2018 11:26:15 +0000 (13:26 +0200)]
jaxb-api should be scope=compile

Keeping scope=provided breaks downstream tests with JDK9+,
hence we need to rework the dependencies to make sure we always
pull jaxb-api, but we also need to exclude it from odl-yangtools-data
feature, because it is provided by Karaf.

Change-Id: Id09281c89a74c3d6c780179dfa21ced545318ba1
JIRA: YANGTOOLS-906
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate parser extensions to JDT annotations 90/76690/19
Robert Varga [Fri, 5 Oct 2018 09:16:46 +0000 (11:16 +0200)]
Migrate parser extensions to JDT annotations

This removes run-time reliance on javax.annotation package.

JIRA: YANGTOOLS-907
Change-Id: I9cd870882d8c7edfcc44a50154d0e4148bd4eca5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate common/util to use JDT annotations 12/76712/7
Robert Varga [Fri, 5 Oct 2018 09:02:56 +0000 (11:02 +0200)]
Migrate common/util to use JDT annotations

This removes run-time reliance on javax.annotation package.

Change-Id: I59193dbe7fcf472fbab29099b685df669c3b301a
JIRA: YANGTOOLS-907
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate yang-common to use JDT annotations 11/76711/7
Robert Varga [Fri, 5 Oct 2018 08:53:50 +0000 (10:53 +0200)]
Migrate yang-common to use JDT annotations

This removes run-time reliance on javax.annotation package.

Change-Id: If8870ba4f6aed9b77d65dc129e3fd7112fb01949
JIRA: YANGTOOLS-907
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate concepts to use JDT annotations 10/76710/4
Robert Varga [Wed, 3 Oct 2018 09:32:57 +0000 (11:32 +0200)]
Migrate concepts to use JDT annotations

This removes run-time reliance on javax.annotation package.

Change-Id: Ia4c2115f1160446d781f2d7fa1a7b5a4940a3feb
JIRA: YANGTOOLS-907
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix Java 11 build 26/76726/1
Robert Varga [Mon, 8 Oct 2018 05:50:12 +0000 (07:50 +0200)]
Fix Java 11 build

This fixes spotbugs/Java11 false positive.

Change-Id: Idb8e648bf35f0c9f73a236dcfc8a8419e800cacb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not import java.annotation 25/76725/2
Robert Varga [Mon, 8 Oct 2018 05:22:10 +0000 (07:22 +0200)]
Do not import java.annotation

Nullable JSR305 annotations have runtime retention scope, which is
causing javax.annotation being imported by our bundles, which is not
correct as we do not need the annotation. Reduce the use of these
and suppress javax.annotation imports.

JIRA: YANGTOOLS-907
Change-Id: I0e1f384880e148c707037f8afd4b8cb9d2e00e72
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Migrate common/util to use JDT annotations" 09/76709/1
Robert Varga [Fri, 5 Oct 2018 16:54:23 +0000 (18:54 +0200)]
Revert "Migrate common/util to use JDT annotations"

This reverts commit f069fc0c4ef1a95ef7ca81a2d83301a48bf18fb8.

Change-Id: Icaa2bf8d664fcacf4cb7ac97bdb796414845d623
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Migrate yang-common to use JDT annotations" 08/76708/1
Robert Varga [Fri, 5 Oct 2018 16:54:22 +0000 (18:54 +0200)]
Revert "Migrate yang-common to use JDT annotations"

This reverts commit 7286488bb26fbd175297925978c4f75ecee1b70f.

Change-Id: I39afedde0aa2d58b9fe8a809a6f8a7a6de59b770
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Migrate concepts to use JDT annotations" 07/76707/1
Robert Varga [Fri, 5 Oct 2018 16:54:20 +0000 (18:54 +0200)]
Revert "Migrate concepts to use JDT annotations"

This reverts commit 99379bf4ef363ff88b1898aac1ad671025407322.

Change-Id: I4c3915be96ba1344ca05933359ed88aa238c8913
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate common/util to use JDT annotations 89/76689/7
Robert Varga [Fri, 5 Oct 2018 09:02:56 +0000 (11:02 +0200)]
Migrate common/util to use JDT annotations

This removes run-time reliance on javax.annotation package.

JIRA: YANGTOOLS-907
Change-Id: I6665adc378a37b09669de5542b7571a040a5d6f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate yang-common to use JDT annotations 88/76688/5
Robert Varga [Fri, 5 Oct 2018 08:53:50 +0000 (10:53 +0200)]
Migrate yang-common to use JDT annotations

This removes run-time reliance on javax.annotation package.

JIRA: YANGTOOLS-907
Change-Id: I9fc87546af3c3a0ee194be68e5cf9278b18b836c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate concepts to use JDT annotations 01/76601/7
Robert Varga [Wed, 3 Oct 2018 09:32:57 +0000 (11:32 +0200)]
Migrate concepts to use JDT annotations

This removes run-time reliance on javax.annotation package.

JIRA: YANGTOOLS-907
Change-Id: I9345cd4cd1e5554e18717e4eea721b1fd7fe984b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix spotbugs with Java 11 96/76596/1
Robert Varga [Wed, 3 Oct 2018 09:02:15 +0000 (11:02 +0200)]
Fix spotbugs with Java 11

https://github.com/spotbugs/spotbugs/issues/600 is still present,
biting us.

Change-Id: If9bcd5540c5c0d1427a9e69fde87a674d771c182
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup ScannedDependencyTest 81/76581/2
Robert Varga [Tue, 2 Oct 2018 18:17:10 +0000 (20:17 +0200)]
Cleanup ScannedDependencyTest

Rather than messing with test resources set them up properly
in the project so that we can rely on them being present.

Also make sure we clean up our resources correctly.

Change-Id: Idb1b8a8d87293a255582f7120cdb0e47f7278080
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump versions to x.1.2-SNAPSHOT 83/76583/1
Robert Varga [Tue, 2 Oct 2018 19:54:40 +0000 (21:54 +0200)]
Bump versions to x.1.2-SNAPSHOT

This starts the next development cycle.

Change-Id: I69d1b41f0deed275a1654f623a15c667b6dcfa37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd NoOp{Listener,Object}Registration 42/76542/3
Robert Varga [Mon, 1 Oct 2018 19:01:01 +0000 (21:01 +0200)]
Add NoOp{Listener,Object}Registration

As it turns out, there are use cases for registration which do
nothing in their close() method. Add utility classes to support
those use cases. Also update javadocs a bit.

Change-Id: Ife196f26229cf54173e9b9046ece22bd0138c2ea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump triemap to 1.0.1 96/76496/2
Robert Varga [Fri, 28 Sep 2018 23:50:43 +0000 (01:50 +0200)]
Bump triemap to 1.0.1

This brings in the latest version, making sure we pull the same
odlparent.

Change-Id: I47c6a26d8cd9f1d38ae7c57246a0ebe6c4c7540d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump odlparent to 4.0.2 27/76427/2
Robert Varga [Mon, 24 Sep 2018 14:23:48 +0000 (16:23 +0200)]
Bump odlparent to 4.0.2

This brings in the latest fixes.

Change-Id: Ia50b273da19ab43a6a2439b9a15fbd94d5f79069
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd jaxb-api dependency 20/76420/2
Robert Varga [Mon, 24 Sep 2018 16:01:36 +0000 (18:01 +0200)]
Add jaxb-api dependency

For JDK11 we need an explicit scope=provided dependency on
jaxb-api.

JIRA: YANGTOOLS-906
Change-Id: Ifee829a5cd04561f6124ff03b772db2f5d12f04e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove javadoc overrides 19/76419/2
Robert Varga [Mon, 24 Sep 2018 08:36:17 +0000 (10:36 +0200)]
Remove javadoc overrides

JDK9 javadoc generation breaks due to us excluding the generated
package. Do not do that, allowing build to pass here.

Change-Id: I4076753a136b9ce52ef9cbad5a1fec1901bfe681
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 4.0.1 05/76405/1
Stephen Kitt [Mon, 24 Sep 2018 07:12:22 +0000 (09:12 +0200)]
Bump to odlparent 4.0.1

Change-Id: I1ec17a54dc4765e392a67ac36d65789a28e988af
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoDisable illegal UTs 00/76400/1
Robert Varga [Sun, 23 Sep 2018 15:38:47 +0000 (17:38 +0200)]
Disable illegal UTs

The XSD/Pattern conversion does not really work in this case, as
"&&" is not something which has the same meaning in XSD patterns.

The test is vailing with JDK9+, but is in general invalid. Disable
it for now, we will re-enable it once we have correct translation.

Change-Id: If54d4b9b4fcf3f612885f4af407d4d32ffcd916f
JIRA: YANGTOOLS-887
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix compilation with JDK9 99/76399/1
Robert Varga [Sun, 23 Sep 2018 15:15:15 +0000 (17:15 +0200)]
Fix compilation with JDK9

This fixes type inference failure by using a temporary variable.

Change-Id: I298cb7778d590842911dca9e2bd4936b887a221e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable spotbugs in yang-data-transform 68/76268/1
Robert Varga [Wed, 19 Sep 2018 13:07:58 +0000 (15:07 +0200)]
Enable spotbugs in yang-data-transform

This just flips the enforcement switch.

Change-Id: Ie9eb853bcdd2425417f214a736558a86bebe23b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump versions to 2.1.1-SNAPSHOT 67/76267/2
Robert Varga [Wed, 19 Sep 2018 12:59:17 +0000 (14:59 +0200)]
Bump versions to 2.1.1-SNAPSHOT

This starts the next development cycle.

Change-Id: I8037e20694f5668249a8c8ee161f2a63b8817b46
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not clutter logs with a thrown exception 50/76250/1
Robert Varga [Wed, 19 Sep 2018 10:48:17 +0000 (12:48 +0200)]
Do not clutter logs with a thrown exception

SourceException is an unchecked exception which we handle at a higher
layer. The logging statement does not add anything useful, so let's
remove it.

Change-Id: I8a4654b44469a2193996d1d90e982d01a1a62bf3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix TypedefEffectiveStatementImpl double-checked load 49/76249/1
Robert Varga [Wed, 19 Sep 2018 10:46:46 +0000 (12:46 +0200)]
Fix TypedefEffectiveStatementImpl double-checked load

We really need a volatile read here to make things alright, make
the field volatile.

Change-Id: Id04917a04f9f1fdba6ded2c773571d90106e877f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unneeded interface declaration 48/76248/1
Robert Varga [Wed, 19 Sep 2018 10:45:59 +0000 (12:45 +0200)]
Remove unneeded interface declaration

DataNodeContainer is already specified by superclass, no need to
repeat that declaration.

Change-Id: I9a409662d87b02ec9b4abcba88c90bccf684829a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unneeded check 47/76247/1
Robert Varga [Wed, 19 Sep 2018 10:45:03 +0000 (12:45 +0200)]
Remove unneeded check

brk is known to be different from -1, hence we can use it directly
rather than using a temporary variable.

Change-Id: If089baa50b8e7b15d8ab03a8e09f7d6d6d0ea7e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not emit empty non-presence containers 79/76179/3
Robert Varga [Mon, 17 Sep 2018 14:21:52 +0000 (16:21 +0200)]
Do not emit empty non-presence containers

Since the data store portion of container lifecycle has been
fixed, this patch reverts cb247b77dfab26658e434a593ca282fcd723022f
and takes containers' presence statement into account again.

JIRA: YANGTOOLS-903
Change-Id: I9aeeeb72848dd61f8abfe83ae7f22036aae2c214
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable spotbugs in yang-model-validator 83/76183/2
Robert Varga [Mon, 17 Sep 2018 15:35:02 +0000 (17:35 +0200)]
Enable spotbugs in yang-model-validator

This adds supressions as needed and flips the switch.

Change-Id: I35d60ad737a63b4f4e9f2c7819ab3ad8ebb7843a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCorrectly activate jacoco report aggregation 76/76176/1
Robert Varga [Mon, 17 Sep 2018 13:45:47 +0000 (15:45 +0200)]
Correctly activate jacoco report aggregation

The profile was missing activation, hence we failed to activate
it -- leading to zero coverage.

Change-Id: Icec36e7347a60f4cc077835596af99a6dd3f7379
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix spotbugs warnings in yang-data-codec-gson 74/76174/1
Robert Varga [Mon, 17 Sep 2018 13:31:43 +0000 (15:31 +0200)]
Fix spotbugs warnings in yang-data-codec-gson

This fixes the simple warnings and flips the switch.

Change-Id: I31cf662d0be9c905b7b7c4f0d2ce44142fa4d71c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove redundant interface declarations 66/76166/1
Robert Varga [Mon, 17 Sep 2018 13:16:33 +0000 (15:16 +0200)]
Remove redundant interface declarations

As pointed out by spotbugs, these classes specify Immutable while
it is already specified by a superclass.

Change-Id: I1836b1ec8ffacf441deaf1cb93a8df589ba74374
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix warnings in yang-maven-plugin 48/76148/4
Robert Varga [Mon, 17 Sep 2018 11:50:27 +0000 (13:50 +0200)]
Fix warnings in yang-maven-plugin

Fix spotbugs warnings and flip the switch.

Change-Id: I69f2f65962af3a44b9205f1659af051a30c5133d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable spotbugs in yang-data-util 47/76147/1
Robert Varga [Mon, 17 Sep 2018 11:37:30 +0000 (13:37 +0200)]
Enable spotbugs in yang-data-util

Fix the few reported warnings and flip the switch.

Change-Id: I31874f55eff860067cda7858381b0abc44444ab6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove sonar.jacoco.reportPath overrides 77/76077/1
Robert Varga [Thu, 13 Sep 2018 22:08:23 +0000 (00:08 +0200)]
Remove sonar.jacoco.reportPath overrides

Now that yangtools-sonar provides sonar.jacoco.reportPaths, there
is no need for us to override it.

Change-Id: I2915a6398bd64b22f8a8368c3276cc0e5af9443a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoActivate jacoco aggregation on odl.jacoco.aggregateFile 75/76075/1
Robert Varga [Thu, 13 Sep 2018 21:58:29 +0000 (23:58 +0200)]
Activate jacoco aggregation on odl.jacoco.aggregateFile

Unless this property is defined, we don't really have a user,
which means we should not be aggragating jacoco.

Change-Id: I2e9c72d1a30b531111089e14c1fc99ffebb4da28
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSwitch to spotbugs 30/75330/7
Robert Varga [Mon, 20 Aug 2018 15:30:21 +0000 (17:30 +0200)]
Switch to spotbugs

Findbugs is ancient, spotbugs is a live project, switch to using
it.

Change-Id: I160bb14eb1b32bc226b1e94955d340c7cc79fa5e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate to tech.pantheon.TrieMap 49/75949/10
Robert Varga [Mon, 10 Sep 2018 20:12:14 +0000 (22:12 +0200)]
Migrate to tech.pantheon.TrieMap

TrieMap has a new how outside of yangtools, use that source and
provide a compatibility wrapper.

JIRA: YANGTOOLS-902
Change-Id: Ifcc27f1dddd0e4f97ee992618bd2941c7c2821bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove the object cache 64/75564/2
Stephen Kitt [Thu, 30 Aug 2018 11:57:33 +0000 (13:57 +0200)]
Remove the object cache

It’s been experimental for four years and isn’t used anywhere in ODL.

Change-Id: Icc9778ef5ab777ae217b3ccd02e54de680460c73
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoRemove jacoco overrides 68/76068/1
Robert Varga [Thu, 13 Sep 2018 16:34:26 +0000 (18:34 +0200)]
Remove jacoco overrides

odlparent-4.0.0 includes a refactor which renders these overrides
unneeded. Remove them.

Change-Id: I898160e74e698dd939b582b7c2355165a3041fd9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable findbugs in yang-data-codec-xml 66/76066/2
Robert Varga [Thu, 13 Sep 2018 15:05:53 +0000 (17:05 +0200)]
Enable findbugs in yang-data-codec-xml

This fixes warnings reported and flips the switch.

Change-Id: I78121287fdc9d3bef6e1b0c52300c57c5be074d6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable findbugs in mockito-configuration 65/76065/2
Robert Varga [Thu, 13 Sep 2018 10:07:13 +0000 (12:07 +0200)]
Enable findbugs in mockito-configuration

This fixes warnings reported and flips the switch.

Change-Id: I4f035e4c3a9c7bc4a764668abb6adb9b8d952c9c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 4.0.0 58/76058/1
Stephen Kitt [Thu, 13 Sep 2018 10:10:06 +0000 (12:10 +0200)]
Bump to odlparent 4.0.0

Change-Id: I67af761a5a5f45fe8a76c3905661cff626355935
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoAdd a license badge 53/76053/1
Robert Varga [Thu, 13 Sep 2018 08:35:38 +0000 (10:35 +0200)]
Add a license badge

This adds a bit of visibility on github.

Change-Id: I4e62496583184ac28a39fcf8efbff869dfc5461e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix Sonar integration 14/76014/5
Robert Varga [Tue, 11 Sep 2018 23:31:30 +0000 (01:31 +0200)]
Fix Sonar integration

Use project-wide merged JaCoCo execution profile for Sonar purposes,
providing real coverage provided by yangtools UTs. This patch is rather
intrusive due to the need to override odlparent settings to make it
work.

Change-Id: I8aacec9bd2ab45d5a4ffe83d692b020d7bf32ab8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix logging template 25/76025/2
Robert Varga [Wed, 12 Sep 2018 09:31:27 +0000 (11:31 +0200)]
Fix logging template

Logger template is missing a placeholder, add it.

Change-Id: Ib1068bc4e122affc69e408da87378230607b7408
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable findbugs in more artifacts 17/76017/4
Robert Varga [Wed, 12 Sep 2018 00:26:19 +0000 (02:26 +0200)]
Enable findbugs in more artifacts

This fixed/enables FB warnings in yang-maven-plugin-spi,
yang-parser-spi, yang-test-util and yang-xpath-api,
yang-parser-impl and ang-maven-plugin-it.

Change-Id: I1b9abdbd32f81b16243c111c74143929a573d76e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix pom.xml formatting 07/76007/1
Robert Varga [Tue, 11 Sep 2018 20:58:18 +0000 (22:58 +0200)]
Fix pom.xml formatting

The patches to enable findbugs had incorrect indentation of
</plugin>. Fix that.

Change-Id: I0c58c600625a44500ff68b39fc6653d7721f2519
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Experiment: aggregate jacoco for sonar" 06/76006/1
Robert Varga [Tue, 11 Sep 2018 20:55:55 +0000 (22:55 +0200)]
Revert "Experiment: aggregate jacoco for sonar"

This reverts commit 7358371685ccb40a38f7214acd1785d4c9e73236
and cfceb5bc60cbf0d622db1f41466ace602c3ab6e5.

Change-Id: I63153afeedd1ca91835ca6fc63c6af6a71fa3a3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoExperiment: fix base.directory vs. basedir 99/75999/1
Robert Varga [Tue, 11 Sep 2018 19:42:46 +0000 (21:42 +0200)]
Experiment: fix base.directory vs. basedir

This fixes up previous patch to correctly reference maven
base directory.

Change-Id: Ib10d67ddbc9d1db116a237f99455cb0a676645c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoExperiment: aggregate jacoco for sonar 96/75996/5
Robert Varga [Tue, 11 Sep 2018 15:04:51 +0000 (17:04 +0200)]
Experiment: aggregate jacoco for sonar

This is a second cut, overriding targets for jacoco and also
pointing sonar to the aggregate report.

Change-Id: I07f13985edfbe766c41f6adff1a714c31b6d017a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Experiment: merge jacoco reports" 89/75989/1
Robert Varga [Tue, 11 Sep 2018 14:11:41 +0000 (16:11 +0200)]
Revert "Experiment: merge jacoco reports"

This reverts commit 5ae609d30b1584d716e93b5faedcb80e1405fd99.

Change-Id: I75da3ddef983b8eb71f577394e056ce245f05c5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoExperiment: merge jacoco reports 84/75984/1
Robert Varga [Tue, 11 Sep 2018 12:51:11 +0000 (14:51 +0200)]
Experiment: merge jacoco reports

This is an experiment with sonar, which should allow us to get
better coverage reports.

Change-Id: Ic5649dc88fe36e33a0274f089961a642bfc2e719
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix warnings in yang-model-util 77/75977/1
Robert Varga [Tue, 11 Sep 2018 10:08:48 +0000 (12:08 +0200)]
Fix warnings in yang-model-util

This fixes warnings reported in yang-model-util and enables findbugs
enforcement.

Change-Id: Ieb04815237075f6606711ac72e2b10910b2aa854
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix warnings in yang-model-api 76/75976/1
Robert Varga [Tue, 11 Sep 2018 09:56:33 +0000 (11:56 +0200)]
Fix warnings in yang-model-api

This fixes warnings reported in yang-model-api and enables findbugs
enforcement.

Change-Id: Iad35b5ba7c4b9c0373dbcf7be2d696cb66755600
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove tabs from pom.xmls 75/75975/1
Robert Varga [Tue, 11 Sep 2018 09:30:03 +0000 (11:30 +0200)]
Remove tabs from pom.xmls

This fixes formatting to comply with ODL standards.

Change-Id: Ieffe637a9ce2d5663164e979822be5c2646ecd7e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix warnings in yang-data-api 74/75974/2
Robert Varga [Tue, 11 Sep 2018 09:25:59 +0000 (11:25 +0200)]
Fix warnings in yang-data-api

This fixes warnings reported in yang-data-api and enables findbugs
enforcement.

Change-Id: Ibb999c321b852ad71f21301c31322f9659adffd1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable findbugs in yang-parser-api 73/75973/2
Robert Varga [Tue, 11 Sep 2018 09:03:36 +0000 (11:03 +0200)]
Enable findbugs in yang-parser-api

Flip the switch on enforcement.

Change-Id: I7bcb413c1aafd00ec63efc1ac296332ae0c1118b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix warnings in rfc8040 support 72/75972/2
Robert Varga [Tue, 11 Sep 2018 08:56:20 +0000 (10:56 +0200)]
Fix warnings in rfc8040 support

This fixes warnings reported in rfc8040-model-api and
rfc8040-parser-support, and enables findbugs enforcement.

Change-Id: I4ee91b65cc7f6ae11fffbdd3181d6470d9214c04
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable findbugs in rfc7952 support 71/75971/2
Robert Varga [Tue, 11 Sep 2018 08:54:12 +0000 (10:54 +0200)]
Enable findbugs in rfc7952 support

This just flips the enforcement switch, not further changes.

Change-Id: Idb94e589ec7ba58f9ee22231ff5c6fd0d27fc49f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable findbugs in rfc6536 support 70/75970/2
Robert Varga [Tue, 11 Sep 2018 08:40:42 +0000 (10:40 +0200)]
Enable findbugs in rfc6536 support

This just flips the enforcement switch, not further changes.

Change-Id: Iec68058a4e056b4e7b3320213a3ae290a46d3837
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix warnings in openconfig support 69/75969/2
Robert Varga [Tue, 11 Sep 2018 08:37:47 +0000 (10:37 +0200)]
Fix warnings in openconfig support

This fixes warnings reported in openconfig-model-api and
openconfig-parser-support, and enables findbugs enforcement.

Change-Id: I6769c4b4ddb4f4782911619e4d6c177d55f7dccf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix warnings in odlext support 68/75968/2
Robert Varga [Tue, 11 Sep 2018 08:33:43 +0000 (10:33 +0200)]
Fix warnings in odlext support

This fixes warnings reported in odlext-model-api and odlext-parser-support,
and enables findbugs enforcement.

Change-Id: I97d0f98052d36fbbbee1590abbc33ad4e9db07a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix findbugs in yang-common and enable enforcement 67/75967/2
Robert Varga [Tue, 11 Sep 2018 08:24:18 +0000 (10:24 +0200)]
Fix findbugs in yang-common and enable enforcement

Fix trivial issues and suppress places where findbugs does not
understand annotations.

Change-Id: I988e1471b04d42e988f20b9492d6b0f07252f6be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix javadoc warnings in testutils and enable findbugs 66/75966/2
Robert Varga [Tue, 11 Sep 2018 08:15:04 +0000 (10:15 +0200)]
Fix javadoc warnings in testutils and enable findbugs

This fixes javadoc warnings and enables findbugs in testutils.

Change-Id: If5b4cfe8cc30f8c551534e506be9d322d9c4ce03
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix warnings in concepts and enable findbugs 63/75963/2
Robert Varga [Tue, 11 Sep 2018 08:06:17 +0000 (10:06 +0200)]
Fix warnings in concepts and enable findbugs

This patch fixes all javac/checkstyle/findbugs/javadoc warnings
and enables findbugs enforcement.

Change-Id: I48a488e54cb533dd38fba5c3a61233dadef35e43
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd yang-model-api tests 47/75947/2
Robert Varga [Mon, 10 Sep 2018 17:49:08 +0000 (19:49 +0200)]
Add yang-model-api tests

This improves test coverage by testing default methods in yang-model-api.

Change-Id: Iee9290c86ad7b9ab7c20c56b5ebd51ffa966c4d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoConsider AugmentationNodes when direct descendant is not found 90/75190/34
Marek Gradzki [Tue, 14 Aug 2018 08:05:37 +0000 (10:05 +0200)]
Consider AugmentationNodes when direct descendant is not found

With previous refactors it is quite easy to arrive at a simple
solution to take augmentations into account. This also

This includes a unit test from upstream based on afi-safi-name
with bgp-openconfig-extensions.

JIRA: YANGTOOLS-892
Change-Id: I237ed2c6cbed458a2109a48b468a30650f103a48
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEliminate LeafRefValidation.forEachChoice() 33/75933/1
Robert Varga [Mon, 10 Sep 2018 15:19:51 +0000 (17:19 +0200)]
Eliminate LeafRefValidation.forEachChoice()

As it turns out the two call sites can share more code. Introduce
processChildNode(), inlining forEachChoice() and its surrounding
lookup logic.

JIRA: YANGTOOLS-892
Change-Id: I2091abcd579ce1d48a628c3bdea9b4514b050e29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOptimize QNameWithPredicateImpl 18/75918/1
Robert Varga [Mon, 10 Sep 2018 10:42:51 +0000 (12:42 +0200)]
Optimize QNameWithPredicateImpl

Create a dedicated QName-only implementation, saving some space.

Change-Id: I0218763aaf4e809f50b580677fc0b634b7c918fa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSplit up LeafRefValidation.validateNodeData() 11/75911/8
Robert Varga [Mon, 10 Sep 2018 10:02:20 +0000 (12:02 +0200)]
Split up LeafRefValidation.validateNodeData()

Turn this method into a dispatch and move logic into dedicated
methods. This makes it easier to follow the code flow and eliminate
duplicates.

JIRA: YANGTOOLS-892
Change-Id: I840fa0d2e8c7ea86efa05c1afea825e85d890837
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMinor code cleanups 15/75915/2
Robert Varga [Mon, 10 Sep 2018 09:43:07 +0000 (11:43 +0200)]
Minor code cleanups

- static private method
- reduce use of ChoiceSchemaNode.getCaseNodeByName()
- QNameWithPredicateBuilder(QName)

Change-Id: I9cf97ba4c6ef667e39212f511e17bb18b4002bc3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse Iterables.filter() instead of FluentIterable 09/75909/1
Robert Varga [Mon, 10 Sep 2018 08:36:12 +0000 (10:36 +0200)]
Use Iterables.filter() instead of FluentIterable

This removes allocation of one instance of FluentIterable, reducing
the amount of garbage we produce.

Change-Id: I93953f1263426f7fff20e579e56f82506fb423d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRename LeafRefValidatation to LeafRefValidation 36/75836/2
Robert Varga [Fri, 7 Sep 2018 10:22:25 +0000 (12:22 +0200)]
Rename LeafRefValidatation to LeafRefValidation

This is a naming typo which went unnoticed for quite some time,
rename the implementation class and instantiate a proxy for
compatibility.

JIRA: YANGTOOLS-892
Change-Id: I3ec77d7df41942502394047e9e13007c6693d3af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRework choice iteration in LeafRefValidatation 31/75831/3
Robert Varga [Fri, 7 Sep 2018 09:14:48 +0000 (11:14 +0200)]
Rework choice iteration in LeafRefValidatation

Rather than extracting ChoiceNodes into a temporary list, use
a consumer which will be invoked for each of them.

JIRA: YANGTOOLS-892
Change-Id: I0956bed6e446c1ee4bf44c88fcc361abe8a508e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup map iteration in LeafRefValidatation 30/75830/3
Robert Varga [Fri, 7 Sep 2018 09:07:09 +0000 (11:07 +0200)]
Cleanup map iteration in LeafRefValidatation

We have two codepaths for non-filtered and filtered map entry case,
which end up iterating over map entries. Rewrite the code in terms
of an optionally-filtered stream, reducing code duplication.

JIRA: YANGTOOLS-892
Change-Id: I3ca37edb66373cc5ab4632210980cd4a467fd198
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRework path LeafRefValidatation path tracking 29/75829/1
Robert Varga [Fri, 7 Sep 2018 08:36:20 +0000 (10:36 +0200)]
Rework path LeafRefValidatation path tracking

Rather than using a plain iterable sourced from LeafRefPath.getPathFromRoot(),
maintain a Deque sourced via getPathTowardsRoot(). This eliminates the need
for Iterables.skip() as well as not forcing getPathFromRoot() being initialized.

Change-Id: I23c054a63b2c0ceed24fcf48d2636508ee13d568
JIRA: YANGTOOLS-892
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPass down predicates instead of the entire predicate node 80/75780/2
Robert Varga [Wed, 5 Sep 2018 22:15:47 +0000 (00:15 +0200)]
Pass down predicates instead of the entire predicate node

Since we are not using the rest of the data, it is much simpler
to just pass down predicates. It also reduces confusion as to
what state we are propagating.

Change-Id: If790fcc2a8d023cb863d09162b25d644b0dd4638
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not validate non-existent roots 79/75779/3
Robert Varga [Wed, 5 Sep 2018 21:39:18 +0000 (23:39 +0200)]
Do not validate non-existent roots

If we have no data there is no point to validate anything, and
having the root value as an invariant makes code a lot simpler.

JIRA: YANGTOOLS-892
Change-Id: Ifd68b09c03d90c8881381809047e59f3fe92682b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd LeafRefValidatation.computeValues() 78/75778/3
Robert Varga [Wed, 5 Sep 2018 21:24:30 +0000 (23:24 +0200)]
Add LeafRefValidatation.computeValues()

This separates out the heavy-weight value computation, simplifying
callers a bit.

JIRA: YANGTOOLS-892
Change-Id: I218659f830aec822f80decd3622c9890df832379
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEliminate leafRefTargetNodeDataLog() 77/75777/3
Robert Varga [Wed, 5 Sep 2018 20:12:02 +0000 (22:12 +0200)]
Eliminate leafRefTargetNodeDataLog()

Now that we captured invariants, we can proceed to turn
leafRefTargetNodeDataLog() into a simpler lambda form.

JIRA: YANGTOOLS-892
Change-Id: I4644d0f3bc31f9f9cb3643e8443159522f14ccaa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUntangle result processing logic. 76/75776/1
Robert Varga [Wed, 5 Sep 2018 19:33:55 +0000 (21:33 +0200)]
Untangle result processing logic.

leafRefTargetNodeDataLog() is needlessly complex, where it is called
with 3 different sets of arguments from validateLeafRefTargetNodeData()
only.

Inline two of those callers, reducing nesting significantly and
making the code flow more obvious.

Change-Id: I68205d58677e2392989a5fc064a986f5c1716666
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMove LeafRefPath creation from fast path 72/75772/3
Robert Varga [Wed, 5 Sep 2018 18:15:00 +0000 (20:15 +0200)]
Move LeafRefPath creation from fast path

LeafRefValidation is the fast path and LeafRefPath we are creating
is in an invariant. Cache it in LeafRefContext as needed.

JIRA: YANGTOOLS-892
Change-Id: I40ef136630b7cdacca84b2f08a9e0491daa03c14
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup leafref path parsing 71/75771/1
Robert Varga [Wed, 5 Sep 2018 17:39:45 +0000 (19:39 +0200)]
Cleanup leafref path parsing

We have a String on input and LeafRefPathParserImpl uses ANTLR's
CharStreams -- hence it makes no sense to bounce input through
an InputStream.

Remove this atrocity, eliminating an IOException/IllegalStateException
error path in process.

JIRA: YANGTOOLS-892
Change-Id: I78eadf30da6a1e64621ca4c14dfa13e84524b591
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup LeafRefContext(Tree)Builder 70/75770/1
Robert Varga [Wed, 5 Sep 2018 17:28:16 +0000 (19:28 +0200)]
Cleanup LeafRefContext(Tree)Builder

These are package-private classes, make them final, eliminate
unneeded methods and improve code formatting.

JIRA: YANGTOOLS-892
Change-Id: I8a4925a665b1bcac7abd8088719e80f53229bafe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup LeafRefPath 61/75761/1
Robert Varga [Wed, 5 Sep 2018 15:46:13 +0000 (17:46 +0200)]
Cleanup LeafRefPath

Remove commented-out code and cleanup javadocs.

Change-Id: I7d6d62bd091191d3ab914a5767eaf4a2ab7830b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not leak Optional in QNameWithPredicateImpl.toString() 60/75760/1
Robert Varga [Wed, 5 Sep 2018 15:19:49 +0000 (17:19 +0200)]
Do not leak Optional in QNameWithPredicateImpl.toString()

The toString() method blindly appends the revision, leading to
Optional[] being present in the result. Fix the method to look
at the returned version and append the query only when it is
present -- just like QName does.

Change-Id: I47dcdaa3c7ca7b3bfaf34898f76b10dfb2ddbe00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoConsider namespace in namesakes 53/75753/2
Robert Varga [Wed, 5 Sep 2018 10:53:46 +0000 (12:53 +0200)]
Consider namespace in namesakes

XML (unlike JSON) has explicit namespaces which we need to take
into consideration when determining whether two elements have the
same name.

JIRA: YANGTOOLS-900
Change-Id: I0d53bee5d18d211343c094941985bd3f0b6a8776
Signed-off-by: Isabel Lloret <illoret@indra.es>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoNote UniqueConstraint changes 09/75709/1
Robert Varga [Tue, 4 Sep 2018 08:07:25 +0000 (10:07 +0200)]
Note UniqueConstraint changes

We should not be using Collection here, but rather Set. Mark the
change for 3.0.0.

Change-Id: I42c5070f7f243f3ad03e481d47757812029b5d55
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Avoid depending on immutables.value at runtime" 62/75662/1
Robert Varga [Mon, 3 Sep 2018 07:07:23 +0000 (09:07 +0200)]
Revert "Avoid depending on immutables.value at runtime"

This reverts commit 8ed3332603523219d19bd8481664790db4d8acc7. It
should not be necessary with immutables.org-2.7.1.

Change-Id: Ifb323f6f17b9ec1119b74f036925b05fa44addce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoClean various constructs 50/75550/4
Stephen Kitt [Wed, 29 Aug 2018 16:38:57 +0000 (18:38 +0200)]
Clean various constructs

* Remove intern() on constant strings.
* Avoid some casts by changing test instance types.
* Remove a number of unnecessary type specifiers and casts.
* Remove an unnecessary return.
* Use StringBuilder::append()'s substring parameters instead of a
  separate String::substring().

Change-Id: Iaaa206d233fbc43ed1bed2d651c549643e6e7697
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoDrop commons-lang dependency 51/75551/1
Stephen Kitt [Wed, 29 Aug 2018 15:59:30 +0000 (17:59 +0200)]
Drop commons-lang dependency

yang-data-impl's test dependency on commons-lang is unused.

Change-Id: I46d543ede3190537ff9f9dacffa57a78e1e1f462
Signed-off-by: Stephen Kitt <skitt@redhat.com>