mdsal.git
6 years agoBump versions by x.y.(z+1) 41/71941/1 stable/nitrogen
jenkins-releng [Thu, 10 May 2018 23:34:39 +0000 (23:34 +0000)]
Bump versions by x.y.(z+1)

Change-Id: If374d8d4a36e760195bc25e84e473985c3c45014
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
6 years agoBump to odlparent 2.0.7 07/71507/1
Stephen Kitt [Fri, 27 Apr 2018 10:17:20 +0000 (12:17 +0200)]
Bump to odlparent 2.0.7

Change-Id: I768298d5fe800ace6c8e5ccbf0e8d111de824d7a
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoBump to odlparent 2.0.6 66/71366/3
Stephen Kitt [Thu, 26 Apr 2018 08:29:02 +0000 (10:29 +0200)]
Bump to odlparent 2.0.6

Change-Id: Ifcadb992c83214f7024644c9d8655c7748c5a721
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoUse QName.withModule() 24/70824/1
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>
(cherry picked from commit c88bb5b55f973303e4a6b04aced3ad10fdd1b96d)

6 years agoFix derived types missing pattern restrictions 48/70748/3
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 agoChange transformation from DOMRpcResult to RpcResult 78/69678/1
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 agoAdd alternative enum assigned name mapping 36/69336/2
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 agoBump versions by x.y.(z+1) 78/68578/1
Thanh Ha [Fri, 23 Feb 2018 21:20:38 +0000 (16:20 -0500)]
Bump versions by x.y.(z+1)

Change-Id: Ic677f9951943f960b9cc2a0960071d66b1926c61
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoFix infinite loop on cancel transaction 11/68111/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>
(cherry picked from commit 3534aba923cb1d2dcdd9e3ecf2675e35ce343910)

6 years agoFix type ordering assumptions 76/68076/2
Robert Varga [Wed, 17 Jan 2018 15:58:59 +0000 (16:58 +0100)]
Fix type ordering assumptions

There are two types in this test with the same name. Do not assume
they will be reported in a particular order, but rather pick the
correct one for testing.

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

6 years agoCache group replacement pattern 75/68075/2
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>
(cherry picked from commit 73b562bedadd1fbdb1acd5991c39c20c2cc79ec6)

6 years agoFix YangTemplate key statement generation 74/68074/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>
(cherry picked from commit d816769c0b68a69653478b724d46dc04cfb4eb0c)

6 years agoMDSAL-269: fix missing identityref union members 10/67810/4
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>
(cherry picked from commit efe48e633c3bb10f750fda4a451920d7fcde8f78)

6 years agoLookup leaf key methods in parents 17/67917/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>
(cherry picked from commit 6ac608d5c6b02fbcc3ee01af8fc4e3301a8ed52b)

6 years agoMDSAL-298: properly handle unkeyed lists 71/67671/3
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>
(cherry picked from commit 972489522808ad9777d4c190a2a0c3896ed0fca4)

6 years agoAdd DataTreeIdentifier.toString() 70/67670/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>
(cherry picked from commit fd18053813ba9954ea7efa58ad95993b2f9f599c)

6 years agoMDSAL-302: make sure uses+augment works in RPCs 18/67618/2
Robert Varga [Fri, 26 Jan 2018 12:24:54 +0000 (13:24 +0100)]
MDSAL-302: make sure uses+augment works in RPCs

Add missing callouts to generate uses augments for RPC input/output
nodes. This complements processing for data nodes and notifications.

Change-Id: I4f0d9fddce1e019c57b9a45874a45b22ffe6a15f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoShare pre-generated non-verbose string 14/67014/1
Robert Varga [Mon, 8 Jan 2018 17:19:45 +0000 (18:19 +0100)]
Share pre-generated non-verbose string

As it turns out, xtend does not do any sort of constant folding,
hence we need to share the strings instance ourselves to get
the most speed out of quick profile.

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

6 years agoBump versions by x.y.(z+1) 73/65973/1
jenkins-releng [Tue, 28 Nov 2017 03:49:04 +0000 (03:49 +0000)]
Bump versions by x.y.(z+1)

Change-Id: Id2e4d9e63a689f1d898ce331122bf9d0e86dfd5c
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
6 years agoBinding v2 generator - fix getting elements from empty array. 80/62080/3
Jakub Toth [Thu, 17 Aug 2017 09:01:09 +0000 (11:01 +0200)]
Binding v2 generator - fix getting elements from empty array.

Change-Id: I865b8bc9f6197489934037ddba68d85b8c7c1378
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoBUG-9145: rework singleton service group state tracking 72/64072/1
Robert Varga [Thu, 21 Sep 2017 23:00:04 +0000 (01:00 +0200)]
BUG-9145: rework singleton service group state tracking

The beef of the issue here is that there are multiple codepaths
which end up sharing state transitions -- hence we could erroneously
end up waiting for entity release, when if fact we have already
lost it.

Rather than going the explicit FSM route, which would require quite
a few more states, rework state tracking such that each event is
evaluated against current state. This has the nice feature of making
duplicate events idempotent, as the code is all about reconciling
current and intended state.

This also disentangles the loss of ownership codepaths, which means
we can optimize behavior when partitions are involved -- specifically
jeopardy service entity ownership does not result in service shutdown,
because service liveness is actually guaranteed by cleanup entity.
Hence we can keep the services and the cleanup entity intact, leading
to less churn during partitions.

Should the cleanup entity report jeopardy, we need to bring the services
down, but we do not need to unregister the cleanup entity -- if the
partition is healed, we can start services again without the delay
incurred by EOS. If we end up losing partition healing, cleanup entity
ownership will be taken from us, at which point we also unregister.

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

6 years agoFix use of deprecated Futures.addCallback() 71/64071/1
Robert Varga [Thu, 21 Sep 2017 09:00:24 +0000 (11:00 +0200)]
Fix use of deprecated Futures.addCallback()

Specify MoreExecutors.directExecutor() instead of relying on a deprecated
method.

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

6 years agoBinding v2 Generator - fix dependency yang-ext of mdsal-binding2-test-model 51/63751/4
Jie Han [Thu, 28 Sep 2017 06:07:42 +0000 (14:07 +0800)]
Binding v2 Generator - fix dependency yang-ext of mdsal-binding2-test-model
- It should depend on yang-ext in binding2 model for using generated codes v2.

Change-Id: I3c5b597285b3ca67c376184b2b080745776c2d94
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoAdd yang-ext to model-binding2 43/63743/6
Vratko Polak [Thu, 5 Oct 2017 11:23:37 +0000 (13:23 +0200)]
Add yang-ext to model-binding2

- add yang-ext to resolve denpendency of odl-mdsal-binding2-base

Change-Id: Ie02a799b795a2b38009721339f2ff831694f5b51
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
6 years agoFix revisions format in tests 32/63132/3
Jakub Toth [Thu, 14 Sep 2017 09:02:03 +0000 (11:02 +0200)]
Fix revisions format in tests

Change-Id: I18fec54ad112d34b315a9fed6c5f48a8ee02e5dd
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
(cherry picked from commit 3e48f8e6836ae68438ba1e174999a25093f856ad)

6 years agoBump odlparent 2.0.4 to 2.0.5 93/63693/1
Stephen Kitt [Wed, 27 Sep 2017 13:52:50 +0000 (15:52 +0200)]
Bump odlparent 2.0.4 to 2.0.5

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

6 years agoMDSAL Binding 2 Features for Karaf 4 77/63277/5
Jakub Toth [Tue, 19 Sep 2017 09:24:30 +0000 (11:24 +0200)]
MDSAL Binding 2 Features for Karaf 4

  * odl-mdsal-binding2-api
  * odl-mdsal-binding2-base
  * odl-mdsal-binding2-dom-adapter
  * odl-mdsal-binding2-runtime
  * odl-mdsal-binding2

Change-Id: I7b622cba52bf5833e13bb28fef1a917249544e71
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoBump versions by x.y.(z+1) 59/63559/1
Thanh Ha [Tue, 26 Sep 2017 21:13:08 +0000 (17:13 -0400)]
Bump versions by x.y.(z+1)

Change-Id: Id288e43797fda5144ca79bf16a424afa79189e85
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoBUG-8858: rework singleton group locking 08/62708/1
Robert Varga [Wed, 9 Aug 2017 11:54:12 +0000 (13:54 +0200)]
BUG-8858: rework singleton group locking

Group locking relied on a single semaphore held for long periods
of time, with undeterministic locking in face of timing variance.

This patch reworks the logic to properly lock and manage object
lifecycle. It also expands the test suite to cover cleanup scenarios,
while removing test duplication.

The test suite is expanded slightly to assert that asynchronous
service group cleanup does not interfere with user's ability to
reuse the same group.

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

6 years agoImprove length constraint checks 59/61959/1
Robert Varga [Thu, 17 Aug 2017 12:44:12 +0000 (14:44 +0200)]
Improve length constraint checks

If we have an unrestricted string/binary or the constraint is
satisfied by the combination of String/array length return
values and integer value domain, we can skip the checks altogether,
leading to less generated code.

Cuts down size of ietf-inet-types by 1%.

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

6 years agoUpdate odlparent to 2.0.4 60/61860/1
Thanh Ha [Wed, 16 Aug 2017 15:16:02 +0000 (11:16 -0400)]
Update odlparent to 2.0.4

Change-Id: I0c11159f0bf5662b1750cf786c52bcb48f131ba1
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoUpdate .gitreview to stable/nitrogen 47/61647/1
Thanh Ha [Mon, 14 Aug 2017 16:24:00 +0000 (12:24 -0400)]
Update .gitreview to stable/nitrogen

Change-Id: If025bfc548ba0f5c8f94c4db361fdb9e9e129ff5
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoBug 8910 - Binding v2 generator exception: Failed to find leafref target 85/61085/12
Jie Han [Thu, 3 Aug 2017 05:46:21 +0000 (13:46 +0800)]
Bug 8910 - Binding v2 generator exception: Failed to find leafref target

- this patch also fixs:
  Bug 8911 - Binding v2 generator exception: Type parameter MUST be specified and cannot be NULL
Change-Id: Icae8a5bb7b8d34d0a7fbcff49fa8f22cd06213e2
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - fix units field name 94/60594/12
Jie Han [Thu, 20 Jul 2017 11:44:06 +0000 (19:44 +0800)]
Binding generator v2 - fix units field name

- fix units field name in builder
Change-Id: Iba7e90d4b18cd148acb71d6357a441471ed11873
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - fix choice 87/60587/13
Jie Han [Thu, 20 Jul 2017 10:44:26 +0000 (18:44 +0800)]
Binding generator v2 - fix choice

- fix choice's parent type
Change-Id: I436bfb36c396cf95857a7c4c170f1f7601e3c432
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses inner type 82/60582/14
Jie Han [Thu, 20 Jul 2017 07:02:27 +0000 (15:02 +0800)]
Binding generator v2 - uses statement - uses inner type

- for current implementation of yangtools does not copy "types" from groupings,
but the original definition of a type is reused, so we should find inner type
added by uses by original node.
  this patch should be merged with:
  - https://git.opendaylight.org/gerrit/60527
  - https://git.opendaylight.org/gerrit/60529

- add yangs and test

Change-Id: I4336bbf04c25b6caf2a1bd3101760fc3fc40421e
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses grouping choice" 77/60577/12
Jie Han [Thu, 20 Jul 2017 01:54:34 +0000 (09:54 +0800)]
Binding generator v2 - uses statement - uses grouping choice"

- interface generated for choice extends interface for the same
choice for referenced grouping
Change-Id: Ida75a7d4a07e3d99c7c119a103ce6fab715b6ff3
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - fix getter in builder 32/60532/13
Jie Han [Tue, 18 Jul 2017 11:44:07 +0000 (19:44 +0800)]
Binding generator v2 - fix getter in builder

- it should exclude parameteried type for clone.
Change-Id: I0fbb0675c789bbbbf5b6d841c1d6ed261fcbf0cf
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - fix getter method name 31/60531/13
Jie Han [Tue, 18 Jul 2017 11:18:26 +0000 (19:18 +0800)]
Binding generator v2 - fix getter method name

- for yang snippet:
  container cont {
    leaf class {
      type string;
    }
  }
  the leaf name was reserved, but the result of method normalizing "get_class"
  is "getClass", so here just let "get" append the result of class normalizing
  "class" which should be "ClassReservedKeyword" ,that would be "getClassReservedKeyword".

Change-Id: Ibee98a5d82145b1f39509d05da6923fae0cb19f9
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses inner type #2 29/60529/12
Jie Han [Tue, 18 Jul 2017 10:56:25 +0000 (18:56 +0800)]
Binding generator v2 - uses statement - uses inner type #2

- for current implementation of yangtools does not copy "types" from groupings,
but the original definition of a type is reused, so we should find inner type
added by uses by original node.
  this patch should be merged with:
  - https://git.opendaylight.org/gerrit/60529
  - https://git.opendaylight.org/gerrit/60582
- support uses leaf with inner type union, bits
- add yangs and test

Change-Id: Ibee57eb030a79e6ce06bb371e82257b7ab58ab98
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses inner type #1 27/60527/17
Jie Han [Tue, 18 Jul 2017 08:58:03 +0000 (16:58 +0800)]
Binding generator v2 - uses statement - uses inner type #1

- for current implementation of yangtools does not copy "types" from groupings,
but the original definition of a type is reused, so we should find inner type
added by uses by original node.
  this patch should be merged with:
  - https://git.opendaylight.org/gerrit/60529
  - https://git.opendaylight.org/gerrit/60582

- add test yangs

Change-Id: Ia82bc7b298c91bbc3ef34cfb26fea75eed5ff2b2
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses of list 25/60525/10
Jie Han [Tue, 18 Jul 2017 08:01:33 +0000 (16:01 +0800)]
Binding generator v2 - uses statement - uses of list

interface generated for list node added by uses extends interfaces for the same
list for referenced grouping
Change-Id: I8131f83d6dd5bbc7877894a9ed33adfec00504f3
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - fix leaflist return type 24/60524/10
Jie Han [Tue, 18 Jul 2017 07:44:23 +0000 (15:44 +0800)]
Binding generator v2 - fix leaflist return type

- the package name of enum type has been normalized and
it can not be normailized again
Change-Id: I4e114a3827d16c36e0aed4d5c1c3389d63cae8b4
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - fix choice's parent 22/60522/10
Jie Han [Tue, 18 Jul 2017 06:48:08 +0000 (14:48 +0800)]
Binding generator v2 - fix choice's parent

- elminate duplicated moudle type
Change-Id: I0e3b26952c7b19ee6caf55bcde0486fac78bc5bc
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - fix double dot package name 21/60521/11
Jie Han [Tue, 18 Jul 2017 06:14:54 +0000 (14:14 +0800)]
Binding generator v2 - fix double dot package name

- fix normalize package name which has double dot ".."

Change-Id: Ic732f79a9d58d560450eaf1dfa064857c49507c5
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - fix submodule class name 16/60516/12
Jie Han [Tue, 18 Jul 2017 02:37:19 +0000 (10:37 +0800)]
Binding generator v2 - fix submodule class name

- fix normalize submodule name in camel
Change-Id: Id4829b01b2319f8410b821c6814ea459069382ab
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - fix format javadoc text 15/60515/12
Jie Han [Tue, 18 Jul 2017 01:31:13 +0000 (09:31 +0800)]
Binding generator v2 - fix format javadoc text

- call encodeJavadocSymbols first to replace like '*/' in java doc.

Change-Id: I971028f3118757b8fc26822c7e57986aa3e9c018
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses implement - fix finding target grouping 14/60514/12
Jie Han [Tue, 18 Jul 2017 00:51:00 +0000 (08:51 +0800)]
Binding generator v2 - uses implement - fix finding target grouping

- can not call findDataSchemaNode to find target grouping since it search
data node first that may find a wrong data node with the same name, here
specially find grouping by getGrouping() first, and that should be always
correct for uses grouping, anyway, in case find nothing,
keep the findDataSchemaNode methord.

Change-Id: Ibef1c5a0e01d1fe36260c76676ae02b926d62296
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses leafref #2 82/60482/9
Jie Han [Mon, 17 Jul 2017 12:07:42 +0000 (20:07 +0800)]
Binding generator v2 - uses statement - uses leafref #2

- find actual node for leafref node added by uses

Change-Id: I1b5febb3665544def9ff9ba0c7b127ca1be247fc
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses leafref #1 81/60481/9
Jie Han [Mon, 17 Jul 2017 12:06:33 +0000 (20:06 +0800)]
Binding generator v2 - uses statement - uses leafref #1

- find parent module by original node for leafref node added by uses
if the leafnode is not local.
Change-Id: I14b57b796ba33f391d59e8ae7dd06b88ef7e0b51
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBUG-8923: pull in odl-javassist-3 77/61177/5
Robert Varga [Fri, 4 Aug 2017 14:32:08 +0000 (16:32 +0200)]
BUG-8923: pull in odl-javassist-3

Rather than packaging the bundle ourselves, rely on odlparent
feature to provide it.

Change-Id: I2ed15811e0b35ff9cce405886087884a465e5f1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBump odlparent references to 2.0.4 78/61178/4
Robert Varga [Fri, 4 Aug 2017 14:38:55 +0000 (16:38 +0200)]
Bump odlparent references to 2.0.4

Change-Id: I61e87ccfcc913d1a3bd7a1f376e4c55ed04ad33a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoBinding generator v2 - fix InstanceIdentifier package path in classTemplate 69/60469/8
Jie Han [Mon, 17 Jul 2017 09:01:13 +0000 (17:01 +0800)]
Binding generator v2 - fix InstanceIdentifier package path in classTemplate

Change-Id: Ib38526864799e759e06ed123c17b46e4615587cc
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses of cases 68/60468/9
Jie Han [Mon, 17 Jul 2017 08:30:22 +0000 (16:30 +0800)]
Binding generator v2 - uses statement - uses of cases

- interface for case data extends interface for same case for referenced
grouping

Change-Id: If71de3c1361d87c5d6f4cf352e1fa9798a6e1ada
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - fix action #3 50/60450/13
Jie Han [Mon, 17 Jul 2017 07:25:46 +0000 (15:25 +0800)]
Binding generator v2 - fix action #3

- Just let RPC process not throw exception when the parent is null.
  TODO: process action that the parent is null.

Change-Id: I730c7e19db6bd708dbf1693d8116bc088c45ba98
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - fix action #2 40/60440/7
Jie Han [Mon, 17 Jul 2017 02:22:13 +0000 (10:22 +0800)]
Binding generator v2 - fix action #2

- delete duplicate resolving data node which has been done in
resolveOperationNode

Change-Id: I1fda7f35cc84f14dff1213f7c70fd844d9d08607
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - fix action #1 32/60332/8
Jie Han [Fri, 14 Jul 2017 14:07:22 +0000 (22:07 +0800)]
Binding generator v2 - fix action #1

- support action tied to a container or list data node

Change-Id: I0dafa0559608be6a269ad177f73f400bf8e18a87
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoJavaIdentifierNormalizer ThreadSafe/Memory leak fix 01/60001/17
Martin Ciglan [Thu, 6 Jul 2017 07:33:19 +0000 (09:33 +0200)]
JavaIdentifierNormalizer ThreadSafe/Memory leak fix

1. make it thread-safe
2. memory leak fix
3. avoid deep indentations by obeying code conventions

Result "org.opendaylight.coretutorials.MyBenchmark.testBindingV2":
  165.567 ±(99.9%) 1.548 ops/s [Average]
  (min, avg, max) = (146.161, 165.567, 180.523), stdev = 6.553
  CI (99.9%): [164.019, 167.115] (assumes normal distribution)

Benchmark                   Mode  Cnt    Score   Error  Units
MyBenchmark.testBindingV2  thrpt  200  165.567 ± 1.548  ops/s

We're still around 2.8x slower than binding v1 generator,
so there will be follow-up activity to analyse/profile
architecture vs. implementation weakness and fixes
should/might be necessary to improve binding v2 generator.

Change-Id: Id1ca6e5f530c0340c3234526d6babf1f9e3c62b0
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
6 years agoEnforce no split packages 13/61213/1
Robert Varga [Fri, 4 Aug 2017 22:02:03 +0000 (00:02 +0200)]
Enforce no split packages

This augments Export-Package directives with a directive to emit
a hard error if a split package is encountered.

Change-Id: Ib763fb75021de510086f1c12563cef0f49e61f61
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoCleanup DOMMountPointServiceImpl 14/61014/3
Robert Varga [Tue, 1 Aug 2017 21:43:58 +0000 (23:43 +0200)]
Cleanup DOMMountPointServiceImpl

This patch takes advantage of Java 8 features and cleans up the
test.

Change-Id: Ib7c828ebf6d02b3ca6d6bcdcfb2185c8e68d2df0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAddress sonar warnings 38/61038/1
Robert Varga [Wed, 2 Aug 2017 12:13:52 +0000 (14:13 +0200)]
Address sonar warnings

Remove traling blank comments and declaration of runtime exceptions.

Change-Id: Ibe49a0b138a3266cd41603f17d3287d7fa93796a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-8733: switch to using DOMDataTreeListener-based APIs 00/61000/2
Robert Varga [Tue, 25 Jul 2017 23:43:15 +0000 (01:43 +0200)]
BUG-8733: switch to using DOMDataTreeListener-based APIs

This patch switches ShardedDOMDataTree to use
ListenableDOMDataTreeShard, performing adaptation and aggregation
only when needed.

The end result is that a DOMDataTreeListeners affected only by
a single ListenableDOMDataTreeShard are passed directly to that
instance, allowing for efficient event delivery.

In case a registration spans multiple shards, we register a listener
with each and use DOMDataTreeListenerAggregator to efficiently
merge the callbacks.

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

6 years agoBUG-8733: Add ListenableDOMDataTreeShard 99/60999/2
Robert Varga [Fri, 21 Jul 2017 09:45:24 +0000 (11:45 +0200)]
BUG-8733: Add ListenableDOMDataTreeShard

Implementation reliance on DOMDataTreeChangePublisher is a mistake
coming from similarities between interfaces. DOMDataTreeShard interfaces
should work with DOMDataTreeListener instances, not DOMDataTreeChangeListener.

This patch introduces ListenableDOMDataTreeShard, which exposes a proper
SPI-level method for registering DOMDataTreeListeners.

It also adds AbstractStateAggregator, which can be used to efficiently
aggregate multiple listeners into a single upcall, without the synchronization
overhead of ShardedDOMDataTreeListenerContext.

This class is then used to build DOMDataTreeChangeListenerAggregator for
bridging the old approach with ListenableDOMDataTreeShard via a utility
proxy, CompatListenableDOMDataTreeShard.

We also introduce DOMDataTreeListenerAggregator, which performs aggregation
of multiple DOMDataTreeListeners and is useful for ListenableDOMDataTreeShard
implementations where requested subtrees live in multiple child shards.

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

6 years agoCleanup ShardRootModificationContext 98/60998/1
Robert Varga [Mon, 24 Jul 2017 12:10:51 +0000 (14:10 +0200)]
Cleanup ShardRootModificationContext

Remove and unneeded cast and add Identifiable interface.

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

6 years agoBug 8449 - BindingToNormalizedNodeCodec fails to deserialize union of leafrefs 98/60698/2
Jakub Toth [Fri, 21 Jul 2017 09:58:08 +0000 (11:58 +0200)]
Bug 8449 - BindingToNormalizedNodeCodec fails to deserialize union of leafrefs

Fix problem of leafref in typedef called from union
 *generated part
   *generating of new property of GTO for leaf's union type of typedef
     according to return type of referenced leaf via leafref from typedef
 *codec part
   *getting codec of leaf type according to new generator part of leafref
    in typedef
 *tests

Change-Id: Ibffe4e51ef66f1911c32c71d4f08bbdbdd40e234
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoAdd ietf-lisp-address-types.yang to models 28/60528/3
Lorand Jakab [Tue, 18 Jul 2017 09:25:05 +0000 (12:25 +0300)]
Add ietf-lisp-address-types.yang to models

The ietf-lisp-address-types.yang model was originally part of the
lispflowmapping project. To avoid circular dependencies, it was added to
the honeycomb/vbd project too. That's a less then ideal situation,
leading to some issues which were worked around. The proper solution is
to have a single copy in the OpenDaylight ecosystem, and the right place
for that is the MD-SAL IETF models.

Change-Id: Iaab229b9a792744b1ab0541dbe5a86a24e8904d2
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-8733: use DataTreeCandidateNodes.empty() 41/60641/1
Robert Varga [Fri, 21 Jul 2017 10:11:22 +0000 (12:11 +0200)]
BUG-8733: use DataTreeCandidateNodes.empty()

Empty node has been moved to yang-data-api, use it from there.

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

6 years agoCleanup warnings 41/60241/4
Robert Varga [Wed, 12 Jul 2017 10:00:27 +0000 (12:00 +0200)]
Cleanup warnings

- static methods
- unneeded use of CheckedFuture and checkedGet()
- Throwables.propagateIfPossible()
- raw types
- unneeded else branches

Change-Id: Ie7cc7f701efad4de843cd2884ceea9caf8787e0a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoOptimize transaction collection 95/60295/3
Robert Varga [Thu, 13 Jul 2017 15:34:56 +0000 (17:34 +0200)]
Optimize transaction collection

For cases when we have a single transaction it is not necessary
to use Futures.allAsList(). Discover this property and reuse returned
future directly.

Change-Id: I10c2d0371d8bc2c2c0585de41a114adcb7250f3c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBinding2-dom-adapter JUnit code coverage increase 79/60179/8
Martin Ciglan [Tue, 11 Jul 2017 07:21:50 +0000 (09:21 +0200)]
Binding2-dom-adapter JUnit code coverage increase

- JUnit tests
- code clean-up
- ignore failing test from different package for now

Change-Id: Ia9ad961c7f4a4f7f342d3732f61ed838fecb6593
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
6 years agoBinding generator v2 - fix union getter name in camel-case 72/60272/2
Jie Han [Thu, 13 Jul 2017 01:54:27 +0000 (09:54 +0800)]
Binding generator v2 - fix union getter name in camel-case

Change-Id: Iaf96a0db0a60ac4ae9bad587942c81723c86ea64
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - code style & cleanup 44/60244/8
Jie Han [Wed, 12 Jul 2017 12:14:48 +0000 (20:14 +0800)]
Binding generator v2 - code style & cleanup

Change-Id: I5b5d4ffcb0ea3e4f1d69158b02f665d55c3e2366
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - augment statement #4 20/60120/13
Jie Han [Mon, 10 Jul 2017 07:26:59 +0000 (15:26 +0800)]
Binding generator v2 - augment statement #4

- resolve augmentation that target in same module

Change-Id: Ic01b3e34271ba3f667ef3a6dc95482640bd9b895
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - augment statement #3 19/60119/12
Jie Han [Mon, 10 Jul 2017 07:16:47 +0000 (15:16 +0800)]
Binding generator v2 - augment statement #3

- support uses implements of augmentation

Change-Id: Ic62bf99d841ec95c81bd9408acd027f41b0bc00e
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - augment statement #2 18/60118/12
Jie Han [Mon, 10 Jul 2017 07:07:02 +0000 (15:07 +0800)]
Binding generator v2 - augment statement #2

- fix augment package and class name
Change-Id: I00e5f1d0547fdf15b9c5ee5abc9059c343feccc8
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - augment statement #1 17/60117/11
Jie Han [Mon, 10 Jul 2017 06:57:41 +0000 (14:57 +0800)]
Binding generator v2 - augment statement #1

- Only resolve augmentation that it's target in same module

Change-Id: Ifb135570871e37a697238919ec6b6ef08cb8d048
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses augment 62/60062/13
Jie Han [Fri, 7 Jul 2017 08:51:13 +0000 (16:51 +0800)]
Binding generator v2 - uses statement - uses augment

Change-Id: I04cd6044ad81fb8a71dd5ee70b5d06e7d01bf5f2
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses of list 55/60055/13
Jie Han [Fri, 7 Jul 2017 06:19:38 +0000 (14:19 +0800)]
Binding generator v2 - uses statement - uses of list

- fix list getter name of leaf "key" and
  do not add list name as prefix of leaf name.
  key "key" ; // -> getKey

  leaf key { // -> getKeyReservedWord
  ....
  }
  leaf key1 { // -> getKey1

Change-Id: I84821fbeb378e2cdd02730a2c9c0da8a288e2e90
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses of module 51/60051/13
Jie Han [Fri, 7 Jul 2017 02:44:26 +0000 (10:44 +0800)]
Binding generator v2 - uses statement - uses of module

Change-Id: I8a2c5c9872be167ee0883a5a3020af7f4dc1d937
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses of rpc & action 20/60020/12
Jie Han [Thu, 6 Jul 2017 12:17:40 +0000 (20:17 +0800)]
Binding generator v2 - uses statement - uses of rpc & action

Change-Id: I67ca5f9551141fc72de3644b7f6a0ee4c37c548c
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - restore getter 19/60019/11
Jie Han [Thu, 6 Jul 2017 12:15:48 +0000 (20:15 +0800)]
Binding generator v2 - uses statement - restore getter

- restore getter name without suffix "Data"

Change-Id: I1c3dfd17c1a6507170e79b6945d36992ddfe1f36
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - support choice 48/59548/29
Jie Han [Tue, 27 Jun 2017 08:14:54 +0000 (16:14 +0800)]
Binding generator v2 - uses statement - support choice

- generate type from uses choice which extends reference choice type
- add test yang

Note: fix getter in case type in grouping by
      "Binding generator v2 - Clean up codes of constructGetter

Change-Id: I1e72a6812ac5c32974b2db2c1b6c343ae0944bd8
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses of notification 16/60016/10
Jie Han [Thu, 6 Jul 2017 09:29:56 +0000 (17:29 +0800)]
Binding generator v2 - uses statement - uses of notification

- changed for bebase
Change-Id: I78acfd070b8fe1e9987adf7de01aab81037106a4
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - resolve uses node 05/60005/12
Jie Han [Thu, 6 Jul 2017 08:17:11 +0000 (16:17 +0800)]
Binding generator v2 - uses statement - resolve uses node

Change-Id: I06c06180e84b2798c746d00cc53be200c654af90
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - support list 38/59538/30
Jie Han [Tue, 27 Jun 2017 03:23:17 +0000 (11:23 +0800)]
Binding generator v2 - uses statement - support list

- generate type from uses list which extends reference list type
- add suffix "Data" to the method getKey in grouping to avoid clashing with
  the method generated from uses this grouping
- add test yang

Change-Id: Id9dde5688515732abe7d8e0e7ba8b68290f14fef
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - uses statement - uses implements 76/59976/13
Jie Han [Wed, 5 Jul 2017 14:15:48 +0000 (22:15 +0800)]
Binding generator v2 - uses statement - uses implements

- interfaces generated for data children extends (implements) interfaces for
  same children generated for referenced grouping

Change-Id: I4d9cd6e31760870353c5fdb22b7d961b195db8a0
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding2-runtime JUnit code coverage increase 43/60143/6
Martin Ciglan [Mon, 10 Jul 2017 15:30:20 +0000 (17:30 +0200)]
Binding2-runtime JUnit code coverage increase

- JUnit tests
- code clean-up

Change-Id: Id2dbf490e41a6cd7eddf024208765ac3381325f6
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
6 years agoBinding generator v2 - Identity fix 96/59796/10
Jie Han [Fri, 30 Jun 2017 15:40:03 +0000 (23:40 +0800)]
Binding generator v2 - Identity fix

Change-Id: Iad246a2dfc355832ff5869a5b0bbd7b330140d00
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBump odlparent references to 2.0.2 10/60110/1
Robert Varga [Sun, 9 Jul 2017 17:14:30 +0000 (19:14 +0200)]
Bump odlparent references to 2.0.2

Automated bump to latest fix release.

Change-Id: Ibbbe6dc4d9c0df1e08135f1d496eb53963c9db93
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBinding generator v2 - Type reference fix 93/59793/6
Jie Han [Fri, 30 Jun 2017 07:38:18 +0000 (15:38 +0800)]
Binding generator v2 - Type reference fix

Change-Id: I85e08bdb4bfe09ac12604b1e57d1933f753a0176
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoDo not obfuscate constant 0/1 72/59972/3
Robert Varga [Wed, 5 Jul 2017 11:30:31 +0000 (13:30 +0200)]
Do not obfuscate constant 0/1

Using simple and obvious literals is preferable to non-canonical
constants. Eliminate them, making the code more explicit.

Change-Id: I2e0c1abe7717cfc119088b00504562f20820b12d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBinding generator v2 - fix case builder to dto 94/59994/2
Jie Han [Thu, 6 Jul 2017 03:21:38 +0000 (11:21 +0800)]
Binding generator v2 - fix case builder to dto

Change-Id: I162e6349022a1fcc0efb69b84beba3b6c4716b71
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoOptimize JavaIdentifierNormalizer.normalizeClassIdentifier() 71/59971/2
Robert Varga [Wed, 5 Jul 2017 11:19:44 +0000 (13:19 +0200)]
Optimize JavaIdentifierNormalizer.normalizeClassIdentifier()

Inner split-and-iterate is really just a simple substring assembly,
as mentioned in comments. Let's not go off into weeds and perform
a simple lastIndexOf() and substring() operations.

Change-Id: I2f21a6c92644a358bd9f8316bedde33f8b661f13
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoDo not use temporary string to extract last character 68/59968/2
Robert Varga [Wed, 5 Jul 2017 10:29:24 +0000 (12:29 +0200)]
Do not use temporary string to extract last character

StringBuilder is a CharSequence, hence turning it into a String
just to get a character from it is wasteful.

Change-Id: Icba9d5b7ebc1207498a06b41fec84aa74a19ff3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoOptimize JavaIdentifierNormalizer.normalizeClassIdentifier() 67/59967/2
Robert Varga [Wed, 5 Jul 2017 10:17:04 +0000 (12:17 +0200)]
Optimize JavaIdentifierNormalizer.normalizeClassIdentifier()

Do not use toLowerCase() in order to perform a simple compare.

Change-Id: Iadb0fce7a7ec163494442396111c6f473ac649e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoOptimize fixCasesByJavaType for packages 66/59966/2
Robert Varga [Wed, 5 Jul 2017 10:10:01 +0000 (12:10 +0200)]
Optimize fixCasesByJavaType for packages

Rather than doing expensive String.replaceAll(), use CharMatcher's
removeFrom().

Change-Id: I1748fdb3fe11246b81b598cba12ddf166ee3cb4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoOptimize convertIdentifierEnumValue() 65/59965/2
Robert Varga [Wed, 5 Jul 2017 10:06:43 +0000 (12:06 +0200)]
Optimize convertIdentifierEnumValue()

Use String.equalsIgnoreCase() rather than converting strings around.

Change-Id: I1695bd7aff746a4920fe985d2f95f31d1ed875b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoOptimize JavaIdentifierNormalizer.fixCases() 64/59964/2
Robert Varga [Wed, 5 Jul 2017 09:55:38 +0000 (11:55 +0200)]
Optimize JavaIdentifierNormalizer.fixCases()

Rather than doing expensive String.split(), optimize the method
for non-underscore case and take advantage of Splitter. Also
peel the first iteration out of the loop.

Change-Id: I452737f1d3b65600aa73b19cf17ea837b12f843c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoOptimize JavaIdentifierNormalizer reserved words lookup 63/59963/2
Robert Varga [Wed, 5 Jul 2017 09:44:41 +0000 (11:44 +0200)]
Optimize JavaIdentifierNormalizer reserved words lookup

Rather than having to go to upper case for each identifier being
looked up, cache a lower-case version of
BindingMapping.WINDOWS_RESERVED_WORDS.

Change-Id: I1fe5f89cfd2b443b059bde3c5250c916b33b0978
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoOptimize JavaIdentifierNormalizer.convertFirst() 62/59962/2
Robert Varga [Wed, 5 Jul 2017 09:23:35 +0000 (11:23 +0200)]
Optimize JavaIdentifierNormalizer.convertFirst()

Rather than fiddling around with temporary strings, perform a direct
replacement capabilities of CharMatcher with two possible matches.

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