mdsal.git
5 years agoBump yangtools to 2.0.6.7 23/79723/2 stable/oxygen
Robert Varga [Fri, 18 Jan 2019 23:37:49 +0000 (00:37 +0100)]
Bump yangtools to 2.0.6.7

These are latest fixes, with odlparent-3.1.6.

Change-Id: I427c122c6f2bc6c03848715c03331e202d8e72d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 3.1.6 95/79695/2
Stephen Kitt [Fri, 18 Jan 2019 15:46:15 +0000 (16:46 +0100)]
Bump to odlparent 3.1.6

Change-Id: Ifa263a74627721131b8a0ec5923c9fe201a6e810
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoFix aggregator pom name 22/79722/1
Robert Varga [Fri, 18 Jan 2019 21:58:48 +0000 (22:58 +0100)]
Fix aggregator pom name

This has a typo in it, fix it.

Change-Id: Idf979465e4ffe9814415147367db6e8a9b4a47fd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 0b318674e2b6f8bc9927960ee0577824976cacee)

5 years agoBump odlparent to 3.1.5 82/78982/1
Robert Varga [Sat, 22 Dec 2018 01:16:29 +0000 (02:16 +0100)]
Bump odlparent to 3.1.5

This should fix xtend.

Change-Id: Id838155e0a08be1fca179cb5ae95d374e3c299c2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump versions by x.y.(z+1) 98/78698/1
jenkins-releng [Wed, 12 Dec 2018 11:58:17 +0000 (11:58 +0000)]
Bump versions by x.y.(z+1)

Change-Id: I2ede303d1e6df3103275e91fa03caa1281825313
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
5 years agoIndex getter methods by String 43/78043/3
Robert Varga [Fri, 16 Nov 2018 09:20:45 +0000 (10:20 +0100)]
Index getter methods by String

Looking up by String offers slight advantage over Method lookup,
because we'll end up with a constant hashCode() over objects which
are guaranteed to be interned.

This rework implies we no longer get to have a map whose keySet
reflects property methods -- which is fine, as the keyset would
take up more memory than a plain array, so we retain the methods
in an array -- hence this ends up being a net win in both cases.

JIRA: MDSAL-398
Change-Id: I36526ce15735d4ef8e4ba847bcc24ea69b950e94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4373edb6c40884357668a5099af5a1ea5fb0f76a)

5 years agoDo not box result twice 22/77922/1
Robert Varga [Sun, 18 Nov 2018 20:58:17 +0000 (21:58 +0100)]
Do not box result twice

result is an int while both cache and return type are Integer,
instantiate a local variable to hold the boxed value so we not
box twice.

Change-Id: I659b60b40d0d1dfa1eee25d214af4a096bf3e60e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoIndex cached data by method name 89/77889/2
Robert Varga [Fri, 16 Nov 2018 07:15:42 +0000 (08:15 +0100)]
Index cached data by method name

Method.hashCode() is not a constant, whereas String.hashCode() is
pre-computed (for interned Strings). As Method.getName() is guaranteed
to be interned and getters have zero arguments, a method's name
is enough to uniquely identify the corresponding piece of data.

Therefore use Method.getName() to index cachedData.

Change-Id: Ie9fec477bd7346042e3700695588bc526fd56dac
JIRA: MDSAL-398
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5a4700262acd57d7ff878a0d690109e80de6f537)

5 years agoSwitch on method names 88/77888/2
Robert Varga [Fri, 16 Nov 2018 06:51:27 +0000 (07:51 +0100)]
Switch on method names

Method names are guarateed to be interned by the JVM, hence their
hashCode is O(1) -- making them a prime target for a switch statement,
which side-steps the need to run String.equals() slow path most of
the time.

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

5 years agoSwitch on parameterCount 87/77887/1
Robert Varga [Fri, 16 Nov 2018 06:47:39 +0000 (07:47 +0100)]
Switch on parameterCount

The else case here assumes parameterCount being 1, make that explicit,
resulting in cleaner code.

JIRA: MDSAL-398
Change-Id: Ie3fa47de6b1630e98a426da69bb6c6d2b6b4b026
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 312facb6827886b2a129b754e416809a2115b878)

5 years agoUse Method.getParameterCount() 86/77886/1
Robert Varga [Fri, 16 Nov 2018 06:38:51 +0000 (07:38 +0100)]
Use Method.getParameterCount()

Java 8 introduced this method, which bypasses array cloning done
by getParameterTypes(), making it more efficient. Take advantage
of it.

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

5 years agoDefine getImplementedInterface name in BindingMapping 85/77885/1
Robert Varga [Fri, 16 Nov 2018 06:34:37 +0000 (07:34 +0100)]
Define getImplementedInterface name in BindingMapping

This moves the definition from LazyDataObject to a common place,
so we have one place which defines it. Also remove unused Throwable
declaration.

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

5 years agoBump to odlparent 3.1.4 and yangtools 2.0.6.5 08/77108/4
Stephen Kitt [Fri, 19 Oct 2018 13:29:31 +0000 (15:29 +0200)]
Bump to odlparent 3.1.4 and yangtools 2.0.6.5

Change-Id: I121d31fcfb4e0c5eaa9817519e34348e89501613
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoCache mismatched augmentations 26/77726/1
Robert Varga [Tue, 13 Nov 2018 14:13:41 +0000 (15:13 +0100)]
Cache mismatched augmentations

Address a FIXME around caching of mismatched augmentations, as it
seems openflowplugin is doing this on purpose.

The cache is expected to be needed infrequently in terms of associated
objects as well as modified infrequently, hence we use a space-efficient
ImmutableMap.

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

5 years agoFix AbstractTypeMember toString() 73/77573/1
Stephen Kitt [Tue, 6 Nov 2018 16:08:35 +0000 (17:08 +0100)]
Fix AbstractTypeMember toString()

It shouldn't reference MethodSignatureImpl.

Change-Id: I20c44fe66b76daa5fb8ccd51485e57c1da0e932c
Signed-off-by: Stephen Kitt <skitt@redhat.com>
(cherry picked from commit 2786e60fbb57e29857adebfe2c4e2a03da80b01b)

5 years agoOptimize AbstractBuilderTemplate key property sort 64/76964/1
Robert Varga [Sat, 13 Oct 2018 08:54:39 +0000 (10:54 +0200)]
Optimize AbstractBuilderTemplate key property sort

Rather than using a lambda for each comparison, create a constant
Comparator and reuse it.

Change-Id: I0b5af97b485f65924adb2de369a69e03027af887
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 8fde45a68a9a39ac9358e720f1e8f0791c8703a3)

5 years agoUse ArrayList.sort() instead of Collections.sort() 63/76963/1
Robert Varga [Sat, 13 Oct 2018 08:38:32 +0000 (10:38 +0200)]
Use ArrayList.sort() instead of Collections.sort()

We do not need Collections, as we have Java 8 and hence can
directly use List.sort(). This has the side-effect of
short-circuiting to ArrayList's implementation.

Change-Id: If978265242275014c586fcf92d96d5ba09bb7bca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 0da0d185e5c0720029b5cab2d1c614e96493431e)

5 years agoMake sure we compare key members via their property name 54/76654/6
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>
(cherry picked from commit f1353f855b99a1f1fd2e5c32b0f58ecf83398600)

5 years agoBump yangtools to 2.0.6.3 14/76214/1
Robert Varga [Tue, 18 Sep 2018 12:35:42 +0000 (14:35 +0200)]
Bump yangtools to 2.0.6.3

This bumps yangtools to 2.0.6.3, picking up latest fixes.

Change-Id: Ia14e13084156b29a29eae3e7275d230dc93f3e21
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRework ClusterSingletonServiceGroupImpl locking 41/75541/2
Robert Varga [Wed, 25 Jul 2018 12:16:29 +0000 (14:16 +0200)]
Rework ClusterSingletonServiceGroupImpl locking

The problem we are are seeing is a classic AB/BA deadlock, hence
we need to change how serviceGroup is handled. This patch reworks
ClusterSingletonServiceGroupImpl to separate state tracking from
service startup/shutdown mechanics.

State locking is separated out into three domains:
- entity state, guarded by ClusterSingletonServiceGroupImpl object
- service membership, tracked in a ConcurrentMap
- service instantiation, guarded by a simple CAS-based lock

Furthermore anytime state changes, we mark this fact in a volatile
variable. Whenever we observe dirty state, we attempt to reconcile
it -- if we can also acquire the service instantiation lock.

Each registered service is tracked separately, so we do not have
to have wholesale aggregator futures for stopping services and can
also start newcomer services without causing weird state tracking
disruptions.

Splitting state tracking and service instantiation leads to faster
group shutdown, because when a group is being closed we know we can
unregister the service entity irrespective of the state of user
services. Unit tests, especially asynchronous, are updated to account
for this accelerated shutdown procedure.

This has the benefit of improving inter-node failover latency,
because the process of user service shutdown and service entity
unregistration runs concurrently. That leads to lower likelihood
of the new service entity owner having to block on becoming
the cleanup entity owner, as services which shut down quickly
will have released the cleanup entity by the time the new owner
is selected.

JIRA: MDSAL-362
Change-Id: I7cd82f81da9135591e4242a196cc0f06a78973a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 2.0.6.2 14/75614/1
Robert Varga [Fri, 31 Aug 2018 09:16:53 +0000 (11:16 +0200)]
Bump yangtools to 2.0.6.2

This brings in latest fixes.

Change-Id: I04fe9e387cff73fe5d3d887f740990d28409c78f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate internal structure to pass registrations 40/75540/2
Robert Varga [Tue, 24 Jul 2018 16:29:37 +0000 (18:29 +0200)]
Update internal structure to pass registrations

Within lusterSingletonServiceGroupImpl we need identity-based
lookup, which ObjectRegistration provides.

This is useful for keeping additional per-service state without
relying on user's equals() method.

JIRA: MDSAL-362
Change-Id: I01fd1f34a689a2c8f50ff7efc590f713a0212354
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFixup javassist class use 93/75093/4
Robert Varga [Fri, 10 Aug 2018 08:51:45 +0000 (10:51 +0200)]
Fixup javassist class use

We need to cast the returned class, as the Javassist API no longer
does so.

Change-Id: Ib19477ece9e76b735285df3b553ca9504579f8c9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoActivate BUG-6135 test 90/75090/1
Robert Varga [Wed, 8 Aug 2018 09:10:46 +0000 (11:10 +0200)]
Activate BUG-6135 test

The underlying bug was fixed long time ago, but the corresponding
test was not activated. Fix that.

Change-Id: I97a31722a4cf5145f6f3c6a1ef3eba5f1f213d25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 351db7989bdb5fba3695383d408e7af391e29d9d)

5 years agoBump versions by x.y.(z+1) 44/75044/1
jenkins-releng [Thu, 9 Aug 2018 16:39:43 +0000 (16:39 +0000)]
Bump versions by x.y.(z+1)

Change-Id: I8c749737713eaa0349bd923c39ae17caf48adaf9
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
5 years agoBump yangtools to 2.0.6.1 76/74676/2
Stephen Kitt [Tue, 31 Jul 2018 08:54:43 +0000 (10:54 +0200)]
Bump yangtools to 2.0.6.1

Change-Id: I9d6d5bf1242d84ee9aab94e3a50a69537cef2b5d
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoFix case-related augment test 33/74633/1
Robert Varga [Wed, 27 Jun 2018 09:50:05 +0000 (11:50 +0200)]
Fix case-related augment test

The test model used in this test is not valid, as it introduces
same container/leaf as both an augmentation of the list and as an
augmentation of that list's choice, leading to the leaf/container
being defined twice in the list's data tree hierarchy.

Change-Id: I582b53ea942f71141e98e14aa0f23878af339b86
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7a0e6a60c9d71a08f0b981e812850675f802a752)

5 years agoBump to odlparent 3.1.3 28/74528/1
Stephen Kitt [Thu, 26 Jul 2018 14:05:39 +0000 (16:05 +0200)]
Bump to odlparent 3.1.3

Change-Id: I81642019c080a688fafc93940f012cc706b483b8
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoEnforce Xtend Maven plugin dependencies 01/73801/1
Stephen Kitt [Fri, 6 Jul 2018 07:28:19 +0000 (09:28 +0200)]
Enforce Xtend Maven plugin dependencies

This aligns the Eclipse dependencies used by version 2.13 of the Xtend
Maven plugin, to avoid signature issues. See
https://github.com/eclipse/xtext/issues/1231 for details.

Change-Id: I61e2d70e1a0c98f831ec647669a48e210e4e1f8f
JIRA: ODLPARENT-156
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoBUG-7697: add defences against nulls 80/73680/1
Robert Varga [Tue, 3 Jul 2018 07:37:41 +0000 (09:37 +0200)]
BUG-7697: add defences against nulls

Null listener is invalid, also make sure we do not ever set
prevRpcs to null.

Change-Id: If8cd16e93a2a07c77a26569c8ecacdc35696cea1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOverride xtend-maven-plugin dependencies 87/73587/1
Robert Varga [Thu, 28 Jun 2018 17:23:21 +0000 (19:23 +0200)]
Override xtend-maven-plugin dependencies

org.eclipse.equinox.common-3.10.0 seems to be required for some
reason.

Change-Id: I556c934db07148f05f701d1c541fd1f1bfc34219
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4e97682b0aaadc08db639ef688e9c275210c28ff)

5 years agoValidate augmentation binding class 22/73322/1
Robert Varga [Wed, 13 Jun 2018 14:34:39 +0000 (16:34 +0200)]
Validate augmentation binding class

LazyDataObject's DataObject.augmentation(Class) implementation
needs to re-validate if the augmentation we are about to decode
matches user-requested augmentation.

This is needed to ensure that we do not return shape-equivalent
augmentation, such as when the same augmentation is applied to
multiple instantiations of the same grouping. In such a case
type-safety indicates that the grouping can have either of the
augmentations, yet in reality its validity depends on
instantiation.

JIRA: MDSAL-328
Change-Id: I57dd70ddead65fc7f61c72b58da4ef6d26e739f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4225a73eff1f9ee46498722e4d247a0d0aca1ed4)

5 years agoBump to odlparent 3.1.1 84/73084/1
Stephen Kitt [Mon, 18 Jun 2018 08:26:52 +0000 (10:26 +0200)]
Bump to odlparent 3.1.1

Change-Id: I28f4212e0b5c7c9e6fd73aa9af0ff4ba78a17229
JIRA: RELENG-129
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoBump versions by x.y.(z+1) 34/72934/1
jenkins-releng [Wed, 13 Jun 2018 00:07:30 +0000 (00:07 +0000)]
Bump versions by x.y.(z+1)

Change-Id: Idcd85a0ac923264db2a7b3e841be2358531b5841
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
5 years agoFix BindingReflections with no revisions 80/72380/1
Robert Varga [Mon, 28 May 2018 20:48:28 +0000 (22:48 +0200)]
Fix BindingReflections with no revisions

When a module does not have a revision statement, we end up using
.norev instead of the usual .revXXYYZZ package component. This means
that valid Binding classes are not recognized by
getModelRootPackageName(), throwing IllegalArgumentException.

Fix this by updating matcher pattern to account for .norev being
a possibility.

Change-Id: Ifeede5cd2371a73eca7b189af3f3ac95db4acb9d
JIRA: MDSAL-346
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6abeecffa7a64a7c14e02ffa6198cf2276f311d3)

5 years agoFix codegen of root choices 78/72378/2
Robert Varga [Mon, 28 May 2018 17:51:15 +0000 (19:51 +0200)]
Fix codegen of root choices

If a choice which is a direct child of a module is targeted via
an augment, codegen fails.

The reason for this is that it attempts to use an empty SchemaPath
to find a DataSchemaNode: something that cannot be done. The problem
is the assumption that a Module is a SchemaNode -- which it is not.

To fix this, recognize when the parent path is empty and short-circuit
to the defining module if that is the case.

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

5 years agoFix YangModuleInfoTemplate 76/72376/1
Robert Varga [Mon, 28 May 2018 17:29:06 +0000 (19:29 +0200)]
Fix YangModuleInfoTemplate

Optional is not comparable, hence we need to pass an explicit
Comparator to the TreeMap.

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

5 years agoBump yangtools to 2.0.5 24/72224/1
Robert Varga [Thu, 24 May 2018 09:52:19 +0000 (11:52 +0200)]
Bump yangtools to 2.0.5

Change-Id: Ia6f422cee5b5f9b363dac9d0645076d576d34963
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoadd additional (debug) logging to AbstractStreamWriterGenerator 90/71890/1
Michael Vorburger [Tue, 8 May 2018 14:59:24 +0000 (16:59 +0200)]
add additional (debug) logging to AbstractStreamWriterGenerator

* LOG.debug() in generateSerializer() to see if in a load test
scenario that ever gets called twice for the same type (it should not)
due to a concurrency bug I'm not seeing.

* reduce the only other LOG.debug() in that class to trace()
because that one will happen more often (constantly?) and make it hard
to see the other one.

* log onBindingRuntimeContextUpdated() on the off chance
that changing the BindingRuntimeContext somehow could cause this
suspected concurrency issue.

* log constructor to better understand the lifecycle of
AbstractStreamWriterGenerator in production.

* add Guava Cache removalListener with logging to see if this is caused
by eviction by GC due to .weakKeys() - ACK to tpantelis for this hunch.

JIRA: MDSAL-213
Change-Id: I2416131fe140ee483cc93740480ee0e37f0ce130
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoUse QName.withModule() 71/70671/4
Robert Varga [Mon, 12 Mar 2018 10:53:51 +0000 (11:53 +0100)]
Use QName.withModule()

There are multiple places where we are creating a well-known QName
with a new namespace. Use QName.withModule() so we do not end up
checking localName over and over.

Change-Id: I932bf3762bfb6ae201e6b309f8a7d95887b99b00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBump versions by x.y.(z+1) 42/71342/1
jenkins-releng [Wed, 25 Apr 2018 18:24:26 +0000 (18:24 +0000)]
Bump versions by x.y.(z+1)

Change-Id: Ied3777a0b9bf9d1ac983c3829ce6c329c9267ada
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
6 years agoFix derived types missing pattern restrictions 47/70747/1
Robert Varga [Tue, 10 Apr 2018 17:14:19 +0000 (19:14 +0200)]
Fix derived types missing pattern restrictions

We have missed a place where constants to support restrictions need
to be generated, which meant that Ipv4AddressNoZone and similar
constructs were not doing correct enforcement.

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

6 years agoartifacts mdsal-binding-test-utils <scope>test 99/70699/1
Michael Vorburger [Fri, 6 Apr 2018 18:39:36 +0000 (20:39 +0200)]
artifacts mdsal-binding-test-utils <scope>test

Change-Id: Iffc49385dd269f045291c2a22e02fbd904d5bb6e
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
(cherry picked from commit 004920a6341442abbdd25e53162ed16cf492a864)

6 years agoBump to odlparent 3.1.0 and yangtools 2.0.3 96/69996/5
Stephen Kitt [Fri, 23 Mar 2018 13:11:11 +0000 (14:11 +0100)]
Bump to odlparent 3.1.0 and yangtools 2.0.3

Change-Id: I36e5aa7ae0e11819ae50db3c67f4279a2c483bc7
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoFix invalid yang models 43/70343/2
Robert Varga [Wed, 14 Mar 2018 14:12:24 +0000 (15:12 +0100)]
Fix invalid yang models

This patch eliminates bad test models, which use constructs which
are not valid YANG identifiers.

Change-Id: If0fbf08226d64b76def98421eb4d68e781e97b98
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6d5b9f5c2e1cdbb0009c42199466485326f14110)

6 years agoUpgrade ietf-inet-types dependency to 2013-07-15 54/70154/1
Marek Gradzki [Fri, 23 Mar 2018 08:28:24 +0000 (09:28 +0100)]
Upgrade ietf-inet-types dependency to 2013-07-15

The ietf-restconf already uses ietf-yang-types@2013-07-15,
so bump ietf-inet-types for consistency.

Change-Id: Id9a871a6f7d273efa94dedb1c98451ba27e7ab7d
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
(cherry picked from commit 1de4a8e8dac2ed42f57942207427cc32612c2134)

6 years agomake sure to eliminate any reference to builders 74/69974/2
Robert Varga [Sat, 3 Mar 2018 22:47:33 +0000 (23:47 +0100)]
make sure to eliminate any reference to builders

We are picking up indexing information from ModuleContext, but we
also need to make sure to built these types.

Change-Id: I32c18b31885bcd1391412819e66314e5fa48ae3a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4bc170fb392d2100d676199abcf059b1116de2b5)

6 years agoRefactor GeneratedTypeBuilderImpl 73/69973/2
Robert Varga [Sat, 3 Mar 2018 17:07:37 +0000 (18:07 +0100)]
Refactor GeneratedTypeBuilderImpl

GeneratedTypeBuilderImpl is used by both runtime and codegen, capturing
data not needed at runtime leading to a bloated RuntimeContext.

Split out RuntimeGeneratedTOBuilder, renaming the original to
CodegenGeneratedTypeBuilder.

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

6 years agoRefactor GeneratedTOBuilderImpl 72/69972/2
Robert Varga [Sat, 3 Mar 2018 16:36:07 +0000 (17:36 +0100)]
Refactor GeneratedTOBuilderImpl

This builder is used at both runtime and codegen-time and it captures
information irrelevant to runtime, leading to bloat.

Refactor this class into three classes:
- AbstractGeneratedTypeBuilder for common information
- CodegenGeneratedTOBuilder common + codegen information
- RuntimeGeneratedTOBuilder throwing UnsupportedOperationException
  for codegen information

JIRA: MDSAL-315
Change-Id: Ie1d3d075590334cb5b8ce41c059ac2e10cf02d56
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 636ac0055012e2ee436d5526a95640c6df35e46a)

6 years agoDo not generate pattern constraints in runtime types 71/69971/2
Robert Varga [Sat, 3 Mar 2018 14:08:17 +0000 (15:08 +0100)]
Do not generate pattern constraints in runtime types

We do not need this information at run-time, so short-circuit
collection so that we always end up seeing an empty expression
map.

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

6 years agoSplit up TypeProviderImpl 70/69970/2
Robert Varga [Fri, 2 Mar 2018 19:55:58 +0000 (20:55 +0100)]
Split up TypeProviderImpl

This class needs to be split up into compile-time and runtime
implementations to eliminate polluting runtime with information
required only for code generators.

Rename the baseline to AbstractTypeProvider and provide two distinct
subclasses, CodegenTypeProvider and RuntimeTypeProvider.

JIRA: MDSAL-312
Change-Id: Ia3a8b0677dee2252820cd9ee6c709e2e896b135f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 59787cce8cce649341d38cfa7faf36de0c2613bd)

6 years agoSplit out BindingRuntimeGenerator 43/69943/1
Robert Varga [Fri, 2 Mar 2018 17:09:44 +0000 (18:09 +0100)]
Split out BindingRuntimeGenerator

BindingRuntimeContext does not require all of the information
captured in a normal BindingGenerator run, such as constants, comments
and similar.

The fact that we do not have separation between compile-time and
run-time granularity of this data comes from history of the codebase,
when BindingRuntimeContext did not exist in its current form and we
infered much of the information from the classes lazily.

Introduce BindingRuntimeGenerator interface and refactor
BindingGeneratorImpl to reflect this split. This leads to faster
BindingRuntimeContext creation, as the call to generateTypes()
is no longer needed.

JIRA: MDSAL-312
Change-Id: Ibb1c22d4e4c9ff90e37d6e10e258f632a9c87ef5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4a558ef0c1b722ee079a2855aabe285c5528ae36)

6 years agoFix deprecation warnings in RangeGenerators 42/69942/1
Robert Varga [Thu, 1 Mar 2018 09:41:31 +0000 (10:41 +0100)]
Fix deprecation warnings in RangeGenerators

Propagate @Deprecated annotation outward, removing most of the warnings.

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

6 years agoInvert enforcement patterns when needed 28/69928/1
Robert Varga [Wed, 28 Feb 2018 15:03:09 +0000 (16:03 +0100)]
Invert enforcement patterns when needed

RFC7950 and yang-model-api defines pattern modifier invert-match,
which needs to be taken into account when validating incoming strings.

Mutate the pattern we expose to the codegen such that it captures
the inversion operation. This code is closely related to generated
code and string formats used therein, hence the beef of the
implementation lives in BindingMapping.

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

6 years agoFix a patterns reference 27/69927/1
Robert Varga [Wed, 28 Feb 2018 12:32:55 +0000 (13:32 +0100)]
Fix a patterns reference

We should be referencing the constant name rather than hard-coding
it in the template.

Change-Id: Ib552b37cdfb4e3f8cef794d764ba8558f6db3df6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 02d279beb583373815e29d48be4aed3353c82b9f)

6 years agoSilence code generator a bit 26/69926/1
Robert Varga [Tue, 27 Feb 2018 23:56:28 +0000 (00:56 +0100)]
Silence code generator a bit

We do not need an explicit INFO whenever a service is generated.
Lower the level at which this information is logged to debug.

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

6 years agoSquash regular expression constants 25/69925/1
Robert Varga [Wed, 21 Feb 2018 14:49:18 +0000 (15:49 +0100)]
Squash regular expression constants

A heap dump analysis has shown we are retaining default-sized
sparse ArrayLists in ConstantImpl. Make sure we squash them to
a properly-sized ImmutableList.

Change-Id: I0b83440af46bcaad334d55506c2f08e36d9a7727
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 152301d3b1575a0132d1a0493cc20eb3c6ac0bf0)

6 years agoRemove ietf-inet-types dependency from ietf-interfaces 05/69905/2
Marek Gradzki [Wed, 21 Mar 2018 12:25:38 +0000 (13:25 +0100)]
Remove ietf-inet-types dependency from ietf-interfaces

The ietf-interfaces@2014-05-08.yang depends only
on ietf-yang-types@2013-07-15.yang

Change-Id: I146c0b130ee0a4cb6e7132a8a4ffe4a8f0bc7ccc
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
(cherry picked from commit 5e53050e07f749db8d781b2533bc1da7c6380486)

6 years agoFix YangModuleInfoTemplate 73/69073/3
Robert Varga [Mon, 5 Mar 2018 08:16:03 +0000 (09:16 +0100)]
Fix YangModuleInfoTemplate

YangModuleInfoTemplate has a wrong check for null, where it should
be checking for Optional.present. Fix that.

Change-Id: I95ccfd7a938b173cd0cc8aa6be997a2afe471056
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3a2d30a4fd44905431546826ca9226015545ee08)

6 years agoAdd alternative enum assigned name mapping 34/69334/4
Robert Varga [Fri, 9 Mar 2018 15:55:44 +0000 (16:55 +0100)]
Add alternative enum assigned name mapping

This patch corrects enumeration mapping rules so that any unicode
string can be mapped to a valid Java identifier as per JLS8.

This is done by attempting to apply className() mapping to all names
and using that if it results in valid non-conflicting identifiers.

If a conflict is detected, we use a bijective mapping, which encodes
any conflicting characters using an $-based escaping scheme.

JIRA: MDSAL-309
Change-Id: Ic51405e533eff9af6afc2abaa8d0cc193d718e64
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 53433dfe15da970a6af8362ad21911a82943de7d)

6 years agoChange transformation from DOMRpcResult to RpcResult 03/69603/6
Peter Nosal [Mon, 19 Mar 2018 07:59:37 +0000 (08:59 +0100)]
Change transformation from DOMRpcResult to RpcResult

When RpcResult was created, it was always as successful RpcResult,
this is changed so in presence of RpcErrors, RcpResult is built as
failed RpcResult with RpcErrors and binding result.

Change-Id: I7ee54dfffb271505fd52feee4c6b2235c0ae4964
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoEliminate twirl execution from mdsal-binding2-generator-impl 60/68760/2
Robert Varga [Mon, 26 Feb 2018 00:04:00 +0000 (01:04 +0100)]
Eliminate twirl execution from mdsal-binding2-generator-impl

We do not have any templates left, speed up compilation by eliminating
unneeded plugin invocations. Also fixe project import in default Eclipse.

Change-Id: I3416f2cd5ed50e4a914817a205a5ca56a85091da
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBump versions by x.y.(z+1) 46/69846/1
jenkins-releng [Thu, 22 Mar 2018 16:57:43 +0000 (16:57 +0000)]
Bump versions by x.y.(z+1)

Change-Id: Icf336ee5dd0faaa2585418aa1c151d4af9e80618
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
6 years agoUpdate .gitreview to stable/oxygen 05/68705/1
Anil Belur [Mon, 26 Feb 2018 06:59:44 +0000 (16:59 +1000)]
Update .gitreview to stable/oxygen

Change-Id: I1c3c76d21d33f02c385d43c0850cc8f4575cd03c
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
6 years agoMDSAL-301: Binding v2 - Rework javadoc generation 57/68657/4
Jie Han [Sat, 24 Feb 2018 07:33:31 +0000 (15:33 +0800)]
MDSAL-301: Binding v2 - Rework javadoc generation

- ported from:
  https://git.opendaylight.org/gerrit/68191
  https://git.opendaylight.org/gerrit/68254

- Move javadoc generation from mdsal-binding2-generator-impl
  to mdsal-binding2-java-api-generator

Change-Id: Ia9a23af5528f7511908d13a0570e8900daeb60a1
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoEliminate XtendHelper and SchemaLock 53/68553/3
Robert Varga [Fri, 23 Feb 2018 15:43:04 +0000 (16:43 +0100)]
Eliminate XtendHelper and SchemaLock

These classes are not used anywhere, eliminate them.

Change-Id: If3e726219b8a5e62a2138a3d98bc1ebd7d86a405
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBinding codec v2 - fix anyxml #3 51/62351/19
Jie Han [Mon, 28 Aug 2017 06:59:50 +0000 (14:59 +0800)]
Binding codec v2 - fix anyxml #3

- Add AnyxmlNodeCodecContext

Change-Id: I76d3cec49cbd98747f666719908be304057bf364
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBinding codec v2 - fix anyxml #2 50/62350/18
Jie Han [Mon, 28 Aug 2017 06:46:01 +0000 (14:46 +0800)]
Binding codec v2 - fix anyxml #2

- Add AnyxmlCodec to serialize/deserialize between
  Document and DOMSource.

Change-Id: Idf3c6be4fa1e88874aa331b170301fa65ce10e1c
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding codec v2 - fix anyxml #1 49/62349/15
Jie Han [Mon, 28 Aug 2017 06:34:40 +0000 (14:34 +0800)]
Binding codec v2 - fix anyxml #1

- Support Anyxml node codec
Change-Id: Ic2ff67cf1be56f4e560b929cc695c329268d1d4e
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding codec v2 - fix notification implements Instantiable 48/62248/17
Jie Han [Thu, 24 Aug 2017 07:25:26 +0000 (15:25 +0800)]
Binding codec v2 - fix notification implements Instantiable

- Call implementedInterface to get class to
  get serializer.
Change-Id: I53c7422b0d15167452e9e30a3d3a43557831389a
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding codec v2 - fix augmentation #7 46/64146/15
Jie Han [Wed, 11 Oct 2017 06:49:05 +0000 (14:49 +0800)]
Binding codec v2 - fix augmentation #7

- add yangs and tests
- add comment
Change-Id: I7bf32c49a68cd7724da4a0cf355a755178f119c1
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding codec v2 - fix augmentation #6 45/64145/16
Jie Han [Wed, 11 Oct 2017 06:41:10 +0000 (14:41 +0800)]
Binding codec v2 - fix augmentation #6

- Add AbstractStreamWriterGenerator to support multiple
  augmentation schemas with the same target path for
  one generated type.

Change-Id: Iac5ec67adb6f77da2e181c59c4e6cecb0239fb9d
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoSwitch to java.util.function.Supplier 83/67683/3
Robert Varga [Mon, 29 Jan 2018 17:49:44 +0000 (18:49 +0100)]
Switch to java.util.function.Supplier

This is an internal interface, we can safely switch it to
Java 8 interface rather than the Guava one.

Change-Id: Ie199bb690e80958c859036708ce1945e3ed313f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRe-organize YANG snippet generation and comment confusion 54/68254/4
Robert Varga [Wed, 14 Feb 2018 13:06:02 +0000 (14:06 +0100)]
Re-organize YANG snippet generation and comment confusion

This is a follow-up cleanup on the previous patch, which has created
an unnecessary interface and tunneling contract. We instead record
the details of why a class was generated, capturing comments correctly
in GeneratedType.comment. mdsal-binding-java-api-generator is then
taught to use this information correctly and generate the YANG snippet
as it sees fit.

Change-Id: I25580c6310d05007fea63e04d70cd12d5c6f9ace
JIRA: MDSAL-301
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoEliminate xtend from mdsal-binding-generator-impl 91/68191/6
Robert Varga [Tue, 13 Feb 2018 13:02:44 +0000 (14:02 +0100)]
Eliminate xtend from mdsal-binding-generator-impl

This patch moves YangTextTemplate into mdsal-binding-java-api-generator
and bridges it into BindingGeneratorImpl, without it having to be lug
all the extent stuff around. This slims down the runtime classes by
143kB.

JIRA: MDSAL-301
Change-Id: Ibdafa574c5a825aa7a02b9ecef5352fff78ae035
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoCleanup properties 00/67900/10
Robert Varga [Sun, 4 Feb 2018 18:46:17 +0000 (19:46 +0100)]
Cleanup properties

Properties should not be used for versions, clean them up in parent
poms. Everything the users need is communicated via
dependency/pluginManagement.

Also ditches down-revisioned maven-depends-plugin, as that is already
provided by odlparent and removes unneeded site plugin configuration.

Change-Id: I54b507342c995c5e3589171c42e708829acc908b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix odl-mdsal-dom-broker 77/68177/1
Robert Varga [Tue, 13 Feb 2018 12:19:10 +0000 (13:19 +0100)]
Fix odl-mdsal-dom-broker

It should depend on odl-yangtools-data so it does not package
yang-data-impl.

Change-Id: Ia8d852c24b6fa6e929d84265f8bd1309116f35df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBinding codec v2 - fix augmentation #5 44/64144/12
Jie Han [Wed, 11 Oct 2017 06:35:24 +0000 (14:35 +0800)]
Binding codec v2 -  fix augmentation #5

- Since all augmentation with the same target would be
  taken into one generated type, the map of type and schema
  would not correct at all, just to delete it.

Change-Id: I705383ca58a9ba1e64c77dffdd4470b60d4aca73
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding codec v2 - fix augmentation #4 59/62259/17
Jie Han [Thu, 24 Aug 2017 10:11:47 +0000 (18:11 +0800)]
Binding codec v2 - fix augmentation #4

- Since uses nodes were processed as-if they were direct
  children of parent node, so just to find target node
  (added by uses) not its original node which would result
  in wrong augmentation type.

Change-Id: I8d74e368e44075eb6e273119c07578ff16a4f1dc
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding codec v2 - fix augmentation #3 90/62190/19
Jie Han [Wed, 23 Aug 2017 09:19:50 +0000 (17:19 +0800)]
Binding codec v2 - fix augmentation #3

- Since multiple augments with same target were grouped as like
just one augment, all child nodes of them were resolved as methods
to the generated type, so in runtime, it should also find all these
child nodes to add to the new EffectiveAugmentSchema object as
real childs.
Change-Id: I433930be45007e545b2e2fb074af32e118aa7cd4
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoMDSAL-218: Binding v2 - *Builder classes for 'type union' YANG gen. code should have... 05/68005/2
Jie Han [Wed, 7 Feb 2018 08:55:16 +0000 (16:55 +0800)]
MDSAL-218: Binding v2 - *Builder classes for 'type union' YANG gen. code should have private constructor

- Do not affect old generated class,  one should mannually rebuild to update.
Change-Id: I7682fc19e29e659589b71695403c83094b138e48
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoMDSAL-218: Binding v1 - *Builder classes for 'type union' YANG gen. code should have... 04/68004/2
Jie Han [Wed, 7 Feb 2018 08:50:57 +0000 (16:50 +0800)]
MDSAL-218: Binding v1 - *Builder classes for 'type union' YANG gen. code should have private constructor

- Do not affect old generated class,  one should mannually rebuild to update.

Change-Id: Ib45f7aca1aa261b2c4bce433b139cd94b91a5066
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoDelay snapshot backed transaction ready error 25/68125/1
Jaime Caamaño Ruiz [Fri, 9 Feb 2018 19:41:25 +0000 (20:41 +0100)]
Delay snapshot backed transaction ready error

Delay snapshot backed transaction ready error to 3PC canCommit.

Change-Id: Ie4004db194483dfa1528258b464df8a2f8fa573e
JIRA: CONTROLLER-1812
Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
6 years agoFix infinite loop on cancel transaction 98/68098/1
Jaime Caamaño Ruiz [Fri, 9 Feb 2018 09:47:26 +0000 (10:47 +0100)]
Fix infinite loop on cancel transaction

This patch fixes a problem where you would run into an infinite loop
after cancelling DOMForwardedWriteTransaction following an exception
thrown by the backed transaction ready or submit methods.

Change-Id: I14bcca6727ab2f173d481b84742c4edbf7bf9dd8
JIRA: CONTROLLER-1812
Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
6 years agoSpeed up whitespace replacement 29/68029/3
Robert Varga [Wed, 7 Feb 2018 15:50:05 +0000 (16:50 +0100)]
Speed up whitespace replacement

Rather than compiling a pattern, pre-compile it once and keep it
around.

Change-Id: Ibb1879d2546f731daa25e536ef45f48bde671f4f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix a few warnings 08/67908/2
Robert Varga [Mon, 5 Feb 2018 01:15:48 +0000 (02:15 +0100)]
Fix a few warnings

- unneeded imports
- potentially static methods
- unneeded @SupressWarnings

Change-Id: I0c80e0a7e917ec9b71147e582df4b6f4c7a698a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMDSAL-269: fix missing identityref union members 57/67757/5
Robert Varga [Tue, 30 Jan 2018 18:14:12 +0000 (19:14 +0100)]
MDSAL-269: fix missing identityref union members

Due to a API consistency issue in binding specification typedefs
which point to leafref and identityref types do not get a generated
encapsulation class.

BUG-8449/MDSAL-253 has dealt with the leafref case, but has omitted
identityref case. This patch corrects the situation, providing a bit
of background and a testcase.

Change-Id: Ib4247e0690c2aaa89aef51b3986bf848ce6b8192
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBinding codec v2 - fix augmentation #2 99/61299/34
Jie Han [Tue, 8 Aug 2017 01:26:17 +0000 (09:26 +0800)]
Binding codec v2 - fix augmentation #2

- filter out local augments by using a child node qname of
  augment schema.
Change-Id: I475e399460e3b19cbc1691a8c0be10cd1a2e0298
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding codec v2 - fix augmentation #1 98/61298/31
Jie Han [Tue, 8 Aug 2017 01:00:54 +0000 (09:00 +0800)]
Binding codec v2 - fix augmentation #1

-  Since if target node in same module as augment, data nodes are represented as-if
their statements were inlined in target. so we should process these data nodes from
binding structs to normalized nodes.

Change-Id: Ib024517f050758cadfbd016b96cf2821bc7c689c
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding v2 generator - fix JavaCodePrettyPrint 96/64096/15
Jie Han [Tue, 10 Oct 2017 05:28:35 +0000 (13:28 +0800)]
Binding v2 generator - fix JavaCodePrettyPrint

- Specially, such as union builder, these isn't any import,
  it doesn't work well.
Change-Id: I84b2408bd2f840bdc19e3c1c39ee731369f23361
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding codec v2 - fix get implemented interface as input of getCacheSerializer 82/62482/16
Jie Han [Thu, 31 Aug 2017 07:36:22 +0000 (15:36 +0800)]
Binding codec v2 - fix get implemented interface as input of getCacheSerializer

- The class of input is the intern class xxxImpl in Builder,
  it should be the interface, so we should call implementedInterface.
Change-Id: I880cb750cf418541c1f27849dec9c83b4eff8bf8
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding codec v2 - fix collect all properties from generated type 47/62247/17
Jie Han [Thu, 24 Aug 2017 07:16:21 +0000 (15:16 +0800)]
Binding codec v2 - fix collect all properties from generated type

- Since uses nodes were processed as-if they were direct children
  of parent node, so it's no need and not uncorrect to get properties
  from implements which would overwrite the return type for the same
  getter method.
Change-Id: I68b565d71ddf17cc13b98e29450aa144f0733adc
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoMDSAL-206: improve DOMEvent instant resolution 29/67729/2
Robert Varga [Tue, 30 Jan 2018 15:58:54 +0000 (16:58 +0100)]
MDSAL-206: improve DOMEvent instant resolution

Rather than using a Date, use an java.time.Instant, which is more
appropriate.

Change-Id: I45513f12f83065d9fc7016e357c53332d0070d6e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoLookup leaf key methods in parents 26/67826/3
Robert Varga [Thu, 1 Feb 2018 16:37:20 +0000 (17:37 +0100)]
Lookup leaf key methods in parents

Union is a valid key type and it can actually come from a grouping,
in which case it gets generated as an inner type. If that happens
the typedef is not populated into the usual places, leading to
a failure to find method return type -- leading to a missing key
member.

This is a problem similar to YANGTOOLS-424, so let's use the same
ModuleContext approach taken then.

JIRA: MDSAL-161
Change-Id: Id342701d603bdd2b9b78ba3295c8eae60f253429
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMDSAL-298: properly handle unkeyed lists 69/67669/14
Robert Varga [Mon, 29 Jan 2018 13:18:05 +0000 (14:18 +0100)]
MDSAL-298: properly handle unkeyed lists

Unkeyed lists are not representable in binding, which means they
cannot be reported as modified children, either. This has implications
for any data change which contains unrepresentable fields as child
modifications.

Previously we would report SUBTREE_MODIFIED for the container node,
but would fail to report any children, which is obviously wrong, as the
user is left guessing as to what exactly happened.

This patch modifies LazyDataObjectModification to report a WRITE event
if modifications to unrepresentable children are found in SUBTREE_MODIFIED
case. Since this is a potentially expensive operation, we cache a child
addressability summary in BindingCodecTreeNode, so that we go to this
slow path only when needed.

We also expose BindingStructuralType enumeration, so controller's
sal-binding-broker can reuse the implementation rather than having its
own copy.

Change-Id: I6642166cd262d0dddb1b2ed6d73a20785d0efff6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix BindingCodecTreeNode.getSchema() a bit 78/67678/5
Robert Varga [Mon, 29 Jan 2018 16:20:14 +0000 (17:20 +0100)]
Fix BindingCodecTreeNode.getSchema() a bit

Using Object as the return type of getSchema() is confusing, as it
does not provide a proper anchor point for users. While subclasses
provide proper access point, further restricting the domain to
DocumentedNode.WithStatus provides for a better experience.

Change-Id: Iebd198b695f5271ebadd5315c1ec22b8488c227c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoCache group replacement pattern 56/67756/1
Robert Varga [Tue, 30 Jan 2018 21:26:29 +0000 (22:26 +0100)]
Cache group replacement pattern

Rather than compiling it over and over again, compile it once.

Change-Id: Id8699f42c081b06197b769f22539e918457b5298
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMigrate to commons-text StringEscapeUtils 34/67734/1
Robert Varga [Tue, 30 Jan 2018 19:00:36 +0000 (20:00 +0100)]
Migrate to commons-text StringEscapeUtils

The utilities from commons-lang3 are deprecated, move on to their
replacement.

Change-Id: I7ed6f163d8414ef6db27876101ceaa43218ead37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix YangTemplate key statement generation 77/67677/1
Robert Varga [Mon, 29 Jan 2018 14:39:16 +0000 (15:39 +0100)]
Fix YangTemplate key statement generation

key statement should be terminated by a semicolon and it should be
emitted only if the key definition is really present.

Change-Id: I499b697be586d5cf92149a14a8ca763ba2272816
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd DataTreeIdentifier.toString() 68/67668/1
Robert Varga [Mon, 29 Jan 2018 13:17:30 +0000 (14:17 +0100)]
Add DataTreeIdentifier.toString()

Adding a toString() method aids debugging and is generally nice.

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