mdsal.git
7 years agoBinding2 runtime - Codecs impl - codecs - part2 31/58531/15
Jakub Toth [Thu, 8 Jun 2017 15:58:47 +0000 (17:58 +0200)]
Binding2 runtime - Codecs impl - codecs - part2

  * operation codecs

Change-Id: I8c08617ec52d47b424d41aa04c7bf574055f1662
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding2 runtime - Codecs impl - context - part2 23/58523/15
Jakub Toth [Thu, 8 Jun 2017 15:31:33 +0000 (17:31 +0200)]
Binding2 runtime - Codecs impl - context - part2

  * derived parts
  * fixed base parts

Change-Id: Ib46351557a42e914bba3c4a34abf2ef94ec9bb80
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding2 runtime - Codecs impl - codecs 22/58522/11
Jakub Toth [Thu, 8 Jun 2017 10:15:35 +0000 (12:15 +0200)]
Binding2 runtime - Codecs impl - codecs

  * remove codec.*.codecs packages

Change-Id: I17897e62d5343ee059489a999d68c6bab0fe9c2c
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoMigrate to odlparent 1.9.0 44/58844/1
Thanh Ha [Tue, 13 Jun 2017 18:39:24 +0000 (14:39 -0400)]
Migrate to odlparent 1.9.0

Change-Id: I100a35acd3f47c49cb7d93a972f6c01a4804b446
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
7 years agoBug 8634: list & leaf-list compilability fix 05/58805/5
Martin Ciglan [Tue, 13 Jun 2017 10:39:12 +0000 (12:39 +0200)]
Bug 8634: list & leaf-list compilability fix

- compilability fix for list & leaf-list generated code
- tested yangs
- make sure 'leaf key' as key makes no harm

Change-Id: I1b4e5f4ac7c0070672d6a33b0db62976c2b3f507
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding2 runtime - Codecs impl - cache 06/58406/16
Jakub Toth [Wed, 7 Jun 2017 11:29:57 +0000 (13:29 +0200)]
Binding2 runtime - Codecs impl - cache

  * caching data part

Change-Id: If0b595c4c50dd3a0741629432623210c31bce381
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding2 runtime - Codecs impl - writers 05/58405/14
Jakub Toth [Wed, 7 Jun 2017 10:18:19 +0000 (12:18 +0200)]
Binding2 runtime - Codecs impl - writers

  * writers of Binding v2 and DOM for serializing data

Change-Id: I947f902f8acd97c67646b65750edf470f04ccc3e
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoAdd endline to gettermethod and property 33/58333/14
Jie Han [Tue, 6 Jun 2017 11:29:42 +0000 (19:29 +0800)]
Add endline to gettermethod and property

Change-Id: I6bec99d905e1021e064bd5d9b66858782b7b2f4f
Signed-off-by: Jie Han <han.jie@zte.com.cn>
7 years agoBinding2 runtime - Codecs impl - context 04/58404/12
Jakub Toth [Wed, 7 Jun 2017 09:18:30 +0000 (11:18 +0200)]
Binding2 runtime - Codecs impl - context

  * derived contexts
  * fixed based contexts

Change-Id: I2900f4356a7750553180a043d450b3f279c99d63
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding2 runtime - Codecs impl #2 53/58253/16
Martin Ciglan [Mon, 5 Jun 2017 14:27:47 +0000 (16:27 +0200)]
Binding2 runtime - Codecs impl #2

- NodeCodecContext & relatives

TODO: test coverage

Change-Id: I024618f2b80207e47eec85819390868ee34b6407
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding v2 runtime - refactor - part3 13/58613/8
Jakub Toth [Fri, 9 Jun 2017 13:09:22 +0000 (15:09 +0200)]
Binding v2 runtime - refactor - part3

  * various runtime classes lost in generator or even spec v2 packages
    are grouped in new runtime v2 module and used in runtime v2
  * move javassist part from spec

Change-Id: I87522a6f79f7bcc0ebcb66a87cedd75e506b51a8
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding v2 runtime - refactor - part2 12/58612/8
Jakub Toth [Fri, 9 Jun 2017 13:04:12 +0000 (15:04 +0200)]
Binding v2 runtime - refactor - part2

  * various runtime classes lost in generator or even spec v2 packages
    are grouped in new runtime v2 module and used in runtime v2
  * move AugmentationFieldGetter and BindingReflections
  * move tests

Change-Id: I61459f6a392890e2a2c038ab25e4592c2b135e05
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding v2 runtime - refactor - part1 11/58611/7
Jakub Toth [Fri, 9 Jun 2017 12:41:16 +0000 (14:41 +0200)]
Binding v2 runtime - refactor - part1

  * various runtime classes lost in generator or even spec v2 packages
    are grouped in new runtime v2 module and used in runtime v2
  * move BindingRuntimeContext and BindingSchemaContextUtils

Change-Id: Iad8316c29a424b3dae881849d0c59c261d608629
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding v2 runtime - init modul 10/58610/5
Jakub Toth [Fri, 9 Jun 2017 12:03:47 +0000 (14:03 +0200)]
Binding v2 runtime - init modul

  * various runtime classes lost in generator or even spec v2 packages
    are grouped in new runtime v2 module and used in runtime v2

Change-Id: Ie9b2d8e9c25076301e87728061969e7ff7607a1b
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoSupport for Yang 1.1 Anydata statement in mdsal-binding2-generator 75/58475/4
Martin Ciglan [Thu, 8 Jun 2017 07:11:27 +0000 (09:11 +0200)]
Support for Yang 1.1 Anydata statement in mdsal-binding2-generator

- able to recognize anydata statement in root or data schema node
- generate type & Java code for it
- YANG test example

Change-Id: I79baeb831ed1b663d332800cca556f6e1dc53cb6
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years ago Add implement type 'BindingTypes.INSTANTIABLE' to augment type 40/57740/6
Jie Han [Wed, 24 May 2017 03:06:02 +0000 (11:06 +0800)]
 Add implement type 'BindingTypes.INSTANTIABLE' to augment type
 -Add implement type 'BindingTypes.INSTANTIABLE' to augment type
 to replace 'DataObject' as to  override the interface "implementedInterface"
 in it's builder.

Change-Id: I2ece953f805a8246a3f1ca7532e5c170047eff44
Signed-off-by: Jie Han <han.jie@zte.com.cn>
7 years agoBinding v2 DOM Codec - generator - SPI - part 2 49/58349/12
Jakub Toth [Tue, 6 Jun 2017 13:20:02 +0000 (15:20 +0200)]
Binding v2 DOM Codec - generator - SPI - part 2

  * prepare base SPI parts of generating serializers for writers
  * added implementation of StreamWriterGenerator

Change-Id: I9445495e5893296e1384b258856eca8236ea6698
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding v2 DOM Codec - choice serializer implementation 48/58348/10
Jakub Toth [Tue, 6 Jun 2017 13:18:42 +0000 (15:18 +0200)]
Binding v2 DOM Codec - choice serializer implementation

Change-Id: I2147b0ef3e254d552134ccf371a25fcdb18fe402
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding v2 DOM Codec - generator - SPI - part 1 27/58327/14
Jakub Toth [Tue, 6 Jun 2017 12:30:27 +0000 (14:30 +0200)]
Binding v2 DOM Codec - generator - SPI - part 1

 * prepare base SPI parts of generating serializers for writers
 * add missing method to GeneratedClassLoadingStrategy
   * resolving class from class loader according to fully qualified
     name
 * checkstyle issues solved

Change-Id: I55aa8286c8d02c69db2af3534076c13f443d7544
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding v2 DOM Codec - augmentation 45/58345/11
Jakub Toth [Tue, 6 Jun 2017 12:29:06 +0000 (14:29 +0200)]
Binding v2 DOM Codec - augmentation

  * api for augmentation
  * impl of agumentation serializer
  * fix jdoc in spec
    * use of TreeNode instead of DataObject

Change-Id: I7c6ec42ddb8bc7f3957e3a82b55fb982fab6de4d
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding generator v2 - leaf-list support 15/58615/1
Martin Ciglan [Fri, 9 Jun 2017 13:27:22 +0000 (15:27 +0200)]
Binding generator v2 - leaf-list support

- generate types & Java code
- test yang file

Change-Id: Idccbcf49bddb7a465e5951d5fa5490e0304bf7f8
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding generator v2 - Choice/Cases support 83/58583/2
Martin Ciglan [Fri, 9 Jun 2017 09:09:53 +0000 (11:09 +0200)]
Binding generator v2 - Choice/Cases support

- generate types & Java code
- builder template fix
- test yang file

Change-Id: Ia001b5e02a3b2e870ae0b46f59a7a9546395b48b
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBug 8583 - Duplicate appending rank to augement class 70/58170/4
Jie Han [Fri, 2 Jun 2017 08:46:43 +0000 (16:46 +0800)]
Bug 8583 - Duplicate appending rank to augement class

- The rank was appended repeatedly in both ReferencedTypeImpl
  and addRawAugmentGenTypeDefinition

Change-Id: If139626f4fafd2824f9c24437918067e78a909b2
Signed-off-by: Jie Han <han.jie@zte.com.cn>
7 years agoBug 8593 - Augmentation's Builder overrides a method from interface Augmentable. 35/58235/5
Jie Han [Mon, 5 Jun 2017 11:05:38 +0000 (19:05 +0800)]
Bug 8593 - Augmentation's Builder overrides a method from interface Augmentable.

Change-Id: I87b5b66679aa8825f4ce46e6c25a2d05eba680dd
Signed-off-by: Jie Han <han.jie@zte.com.cn>
7 years agoBug 8575 - IllegalArgumentException thrown when uses a grouping which name is not... 90/58090/11
Jie Han [Thu, 1 Jun 2017 02:43:29 +0000 (10:43 +0800)]
Bug 8575 - IllegalArgumentException thrown when uses a grouping which name is not unique

- find target uses grouping which name is not unique
- add JUnit Test and Yang file
Change-Id: Idc0d782a2443ed2cd3339f4f7ed4c712a04a60fe
Signed-off-by: Jie Han <han.jie@zte.com.cn>
7 years agoBug 706: - Missing support for anyxml statement in java generator and mapping service 13/58413/7
Martin Ciglan [Wed, 7 Jun 2017 13:36:40 +0000 (15:36 +0200)]
Bug 706: - Missing support for anyxml statement in java generator and mapping service

- basic logic to recognize anyxml node within root or data schema node
- generate type and Java code for it

Change-Id: I0a7dd00661b569dd76d95b6404e4590f6544e415
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding generator v2 - Unions compilability fix 25/58225/4
Martin Ciglan [Mon, 5 Jun 2017 07:19:13 +0000 (09:19 +0200)]
Binding generator v2 - Unions compilability fix

Change-Id: I8ae28571069c2d0f966d9953f43229bce941083f
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding v2 DOM Codec - generator - base implementation 52/58252/10
Jakub Toth [Mon, 5 Jun 2017 14:00:09 +0000 (16:00 +0200)]
Binding v2 DOM Codec - generator - base implementation

 * prototype of implementation of tree node serializer
 * static property for Binding objects

Change-Id: I67ba59924044adf12bed0bd2293f91ddf3f02025
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding v2 DOM Codec - generator - API 51/58251/9
Jakub Toth [Mon, 5 Jun 2017 13:32:39 +0000 (15:32 +0200)]
Binding v2 DOM Codec - generator - API

  * api for getting serializer fo specific type

Change-Id: I04288cf4d514193a1bae363781a29517cf5adb2f
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding v2 DOM Codec - Javassist part 26/58326/6
Jakub Toth [Tue, 6 Jun 2017 08:33:16 +0000 (10:33 +0200)]
Binding v2 DOM Codec - Javassist part

Change-Id: I9f07629ef79729650e44b1caba239a25a23db81e
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoAdd version declaration 61/58361/1
Robert Varga [Tue, 6 Jun 2017 17:57:54 +0000 (19:57 +0200)]
Add version declaration

This is another missed version declaration.

Change-Id: I2b3674b830a71cefd7b925434e019f179a78ea25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoFix missing version declaration 57/58357/1
Robert Varga [Tue, 6 Jun 2017 16:52:45 +0000 (18:52 +0200)]
Fix missing version declaration

Change-Id: I39ed597273861b0c3792c00217ee4c417a4da5ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoMigrate to odlparent 1.8.0-Carbon 95/58295/2
Thanh Ha [Tue, 6 Jun 2017 02:13:13 +0000 (22:13 -0400)]
Migrate to odlparent 1.8.0-Carbon

Per request of odlparent project we are downgrading all Nitrogen
projects to use the released odlparent 1.8.0-Carbon to allow for the
odlparent project to start performing semver style releases.

Jira: RELENG-159
RT: 41406
Change-Id: Ica7007072c5f10e052c4aab6c46feb26e89c5915
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
7 years agoBinding2 runtime - Codecs impl #1 28/58228/3
Martin Ciglan [Mon, 5 Jun 2017 09:02:30 +0000 (11:02 +0200)]
Binding2 runtime - Codecs impl #1

- value based codecs & relatives

TODO: more Javadocs, test coverage

Change-Id: I1c780772ea93d613c4e220ded61c07d6582c8954
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding v2 DOM Codec - codecs API - Part 2 03/58103/10
Jakub Toth [Thu, 1 Jun 2017 09:53:59 +0000 (11:53 +0200)]
Binding v2 DOM Codec - codecs API - Part 2

  *factory
  *serializer

Change-Id: I63ef1b59b31514e8e6d583d3b9aaa17ad1224365
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding v2 runtime context 99/58099/13
Jakub Toth [Thu, 1 Jun 2017 06:10:08 +0000 (08:10 +0200)]
Binding v2 runtime context

  *preparing of binding runtime context via reflection
  *tests

Change-Id: I02a3e568942fe4f31621299c12bf978bcaa4940b
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding v2 DOM Codec - codecs API - Part 1 36/58036/13
Jakub Toth [Wed, 31 May 2017 09:12:10 +0000 (11:12 +0200)]
Binding v2 DOM Codec - codecs API - Part 1

  * normalized node codec
  * tree codec
  * tree node codec

Change-Id: Id58cf84d337ce310afb889c54f913fdbb59d79b0
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding spec runtime v2 - TreeNodeSerializer & relatives 32/58032/6
Martin Ciglan [Wed, 31 May 2017 07:54:10 +0000 (09:54 +0200)]
Binding spec runtime v2 - TreeNodeSerializer & relatives

Change-Id: I6ad9cf2f0fc6fb9b55c7ba788fa6ece86ba7f8c0
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding2 runtime - API #7 73/57773/17
Martin Ciglan [Wed, 24 May 2017 13:44:29 +0000 (15:44 +0200)]
Binding2 runtime - API #7

- NotificationPublishService & its relatives
- test coverage for classes
- Javadocs provided

Change-Id: I888f72924d8fe38e76f0990fec34b040824439c6
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding2 runtime - API #6 71/57771/18
Martin Ciglan [Wed, 24 May 2017 13:09:53 +0000 (15:09 +0200)]
Binding2 runtime - API #6

- DataTreeCommitCohortRegistry & its relatives
- Javadocs provided

Change-Id: I86f5771140f7c151dfad78b0066cc8d0b8790625
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding2 runtime - API #5 65/57665/18
Martin Ciglan [Tue, 23 May 2017 09:15:50 +0000 (11:15 +0200)]
Binding2 runtime - API #5

- Rpc, Action, ListAction API support
- Javadocs provided

Change-Id: I8250bf00579c5743be50d3fcf8296fddb3be1d69
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding2 runtime - API #4 61/57661/17
Martin Ciglan [Tue, 23 May 2017 08:11:25 +0000 (10:11 +0200)]
Binding2 runtime - API #4

- MountPointService & its relatives
- Javadocs provided

Change-Id: I15c55a34b0b4bb4df9aefd92749743c4a0cc2c3e
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding2 runtime - API #3 35/57635/22
Martin Ciglan [Mon, 22 May 2017 14:33:18 +0000 (16:33 +0200)]
Binding2 runtime - API #3

- DataTreeProducer, DataTreeService & its relatives
- Javadocs provided
- test coverage for classes

Change-Id: I75e2b4666db95153d97a24be38a9e2e78c37237f
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding2 runtime - API #2 29/57629/18
Martin Ciglan [Mon, 22 May 2017 13:31:46 +0000 (15:31 +0200)]
Binding2 runtime - API #2

- DataTreeWriteCursor & its relatives
- Javadocs provided

Change-Id: I1e6d6e6f609d048f78821875a0ef37f7aa6f47b1
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding2 runtime - API #1 26/57626/18
Martin Ciglan [Mon, 22 May 2017 12:24:28 +0000 (14:24 +0200)]
Binding2 runtime - API #1

- BindingService, DataTreeModification, transactions basics & its relatives
- Javadocs provided
- test coverage for classes

Change-Id: I2d032ec3a0a565941266610194fb8d176c5392ff
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoFix checkstyle problems not detected by the current version 87/58187/2
David Suarez [Fri, 2 Jun 2017 20:30:54 +0000 (22:30 +0200)]
Fix checkstyle problems not detected by the current version

This change is required for overall move to new Checkstyle version, see
https://git.opendaylight.org/gerrit/#/q/topic:bumpCheckstyle

Change-Id: I422841dc64a48a67e0c1d3656dbf0a4e50763baa
Signed-off-by: David Suarez <david.suarez.fuentes@ericsson.com>
7 years agoBinding generator v2 - Identities support 13/58113/8
Martin Ciglan [Thu, 1 Jun 2017 12:20:10 +0000 (14:20 +0200)]
Binding generator v2 - Identities support

- naming conflict prevention added

Change-Id: Iac43a3ed45ed13b113fd48a2dce3829a9ce7c21a
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding generator v2 - Unions fix 98/58098/7
Jakub Toth [Thu, 1 Jun 2017 14:51:48 +0000 (16:51 +0200)]
Binding generator v2 - Unions fix

- generate Java code fixes

TODO: template compilability issues

Change-Id: Icfa857df13617edec93b3a8de47bbba5d4a9b966
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBinding generator v2 - Notifications 12/58012/3
Martin Ciglan [Tue, 30 May 2017 12:17:01 +0000 (14:17 +0200)]
Binding generator v2 - Notifications

- generated Java code compilability fixes

Change-Id: I82e1f59820820c1d6717fc4227031e7d33465cab
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoMDSAL Binding2 Artifacts missing dependency fix 08/58008/1
Martin Ciglan [Tue, 30 May 2017 07:50:28 +0000 (09:50 +0200)]
MDSAL Binding2 Artifacts missing dependency fix

Change-Id: I7b6f0bc98cc951c654207ebc62d55cfbfe804bf2
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoBinding v2 runtime 62/57062/5
Martin Ciglan [Mon, 15 May 2017 13:07:35 +0000 (15:07 +0200)]
Binding v2 runtime

- main placeholders with pom.xml files

Change-Id: Idda2c78a00412b71a1366fb4c222329e981946d6
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoFix ShardedDOMDataTree registration result 22/57622/5
Robert Varga [Mon, 22 May 2017 11:28:19 +0000 (13:28 +0200)]
Fix ShardedDOMDataTree registration result

Since the returned registration is public, we should override the
return. This will allow controller to ditch an unsafe (but safe)
cast.

Also fixes a bunch of reflection-based tests by using
@VisibleForTesting package-private methods.

Change-Id: Ie544cdc873cd7b5d65b9d469db1000743b104609
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBug 8307: Add the option for activating deviation statements 09/57409/1
Martin Ciglan [Fri, 19 May 2017 10:14:56 +0000 (12:14 +0200)]
Bug 8307: Add the option for activating deviation statements

- follow-up patch for Yangtools changes:
https://git.opendaylight.org/gerrit/#/c/56452/

Change-Id: Ia78b119fee3bdf12be90dbb95d8d811576df57ed
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
7 years agoFix warnings in mdsal-binding-generator-impl 29/57029/2
Robert Varga [Sun, 14 May 2017 22:11:19 +0000 (00:11 +0200)]
Fix warnings in mdsal-binding-generator-impl

- xtend comparison to null
- unnecessary boxing
- unneeded imports
- raw types

Change-Id: Id2d987fdf0cc3b94c78250018bc06b77ab0726f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoCleanup binding-dom-codec generator 98/56998/2
Robert Varga [Sat, 13 May 2017 18:25:24 +0000 (20:25 +0200)]
Cleanup binding-dom-codec generator

- use lambdas
- use fluent StringBuilder
- make methods static

This should improve codec generation slightly due to gains of
invoke_static vs. invoke_virtual and overall bytecode size diet.

Change-Id: Id8d3a442f63a452111907b7d683d2167dd489ca7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBUG-8226: do not import nested classes 40/56840/2
Robert Varga [Thu, 11 May 2017 09:28:38 +0000 (11:28 +0200)]
BUG-8226: do not import nested classes

Importing a nested classes leads to a unused import warning, so compare
the declared package name with the class being generated and do not emit
an import declaration if the package name matches FQDN.

Change-Id: I4240cac663476c1405962631a9d173f5ed434ee9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBindingDOMRpcProviderServiceAdapter should implement its interface 36/56936/2
Martin Ciglan [Fri, 12 May 2017 11:09:06 +0000 (13:09 +0200)]
BindingDOMRpcProviderServiceAdapter should implement its interface

Change-Id: I773f244bff3c08eb7982187089f6f0e8f0eefb65
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoFix generating of description for operations 62/56862/2
Jakub Toth [Thu, 11 May 2017 12:50:01 +0000 (14:50 +0200)]
Fix generating of description for operations

Change-Id: I8cc45bd00910377429c95fd3ab818c7d93299275
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoDisable maven site build 56/56856/1
Robert Varga [Thu, 11 May 2017 13:30:02 +0000 (15:30 +0200)]
Disable maven site build

Change-Id: I9f4ac30cffcd58d2873aeae955a6626082f3479d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBUG-8226: fix toString() formatting 39/56839/1
Robert Varga [Thu, 11 May 2017 09:04:22 +0000 (11:04 +0200)]
BUG-8226: fix toString() formatting

Fix closing curly brace offset.

Change-Id: I56d577387231a300dc508a8062f3aa07c861734a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBUG-8226: fix augmentation argument overlap 34/56834/2
Robert Varga [Thu, 11 May 2017 07:56:15 +0000 (09:56 +0200)]
BUG-8226: fix augmentation argument overlap

This fixes a trivial warning of argument name shadowing the field
name.

Change-Id: Ie0cd8f010778e198db26102a6e42274a03aee118
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBUG-8226: fix Enumeration.forValue() javadoc 33/56833/2
Robert Varga [Thu, 11 May 2017 07:48:48 +0000 (09:48 +0200)]
BUG-8226: fix Enumeration.forValue() javadoc

Fix a missing description warning.

Change-Id: I26b1d0b01b56e6a3fb5d553decc4d109fc6f762c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBinding generator implementation & decomposition 79/56779/4
Martin Ciglan [Wed, 10 May 2017 10:59:37 +0000 (12:59 +0200)]
Binding generator implementation & decomposition

- various fixes to make sure binding & code generator
generates compilable Java code for RPCs

Change-Id: I87def49a28ffa5f978e64a3d8c3de1b0adc2049c
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoRepeated instantiation of typeProvider 51/56751/2
Jie Han [Wed, 10 May 2017 01:52:06 +0000 (09:52 +0800)]
Repeated instantiation of typeProvider
Another instantiation is at line 253 of the same file in function:
public List<Type> generateTypes(final SchemaContext context, final Set<Module> modules)

Change-Id: Ic6dab97de47f54db193f5da7952e97bade656fd9
Signed-off-by: Jie Han <han.jie@zte.com.cn>
7 years agoFix of generating inner class with same name like parent 89/56489/10
Jakub Toth [Wed, 3 May 2017 20:40:28 +0000 (22:40 +0200)]
Fix of generating inner class with same name like parent

Change-Id: I9ad44f50e48f71145012fd32b1f5d9e7c322afb3
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoBUG-8360: add mdsal-binding-dom-codec-osgi 80/56480/8
Robert Varga [Wed, 3 May 2017 11:21:54 +0000 (13:21 +0200)]
BUG-8360: add mdsal-binding-dom-codec-osgi

This is an OSGi binding producing all context needed required
to implement binding/dom/external serialization. It is similar
to how the config-manager service operates, except associated
services are explicitly covered instead of sneaking them through
properties.

Change-Id: I31f2bdb11153d6e514dacf2b070b073d768c1ff3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoFix merging lines in JavaCodePrettyPrint 21/56621/1
Jakub Toth [Fri, 5 May 2017 20:15:34 +0000 (22:15 +0200)]
Fix merging lines in JavaCodePrettyPrint

Change-Id: Ice139808fdad35ee329ee87c10c05edef7984195
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoFix null warning in FutureSchema 08/56508/2
Robert Varga [Wed, 3 May 2017 21:38:45 +0000 (23:38 +0200)]
Fix null warning in FutureSchema

Using SettableFuture<?> implies possible requirement of non-nullness.
If we provise a Void, it is understand to only be null, which is what
we really want here.

Change-Id: I06f2d90cd5bb1c8f7959170d8b8d936b3c714323
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoUtil class for cleaning of generated Java files 61/56161/12
Jakub Toth [Thu, 27 Apr 2017 13:12:04 +0000 (15:12 +0200)]
Util class for cleaning of generated Java files

  *comment generateImplementedMethods in builderTemplate, was
   breaking buil + tests

Change-Id: I5880adec4b9629d8a6761b5e75161e89235a9fe5
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoCode generator prototype - Binding specification v2 77/56377/2
Martin Ciglan [Tue, 2 May 2017 11:55:36 +0000 (13:55 +0200)]
Code generator prototype - Binding specification v2

- fixes NPE & compilability issue for data schema node
builders when node is a child of root

Change-Id: Iaec542989cbeb9583f814986371b22cbb70f7858
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBinding Generator implementation & decomposition 24/56424/3
Martin Ciglan [Wed, 3 May 2017 07:43:39 +0000 (09:43 +0200)]
Binding Generator implementation & decomposition

- fixes possible NPE using Java 1.8 Optional

Change-Id: Ib8f91d85668baf738ba4d9e5c2c613d3c19aaa2c
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoCleanup ModuleInfoBackedContext 79/56479/2
Robert Varga [Wed, 3 May 2017 15:43:04 +0000 (17:43 +0200)]
Cleanup ModuleInfoBackedContext

Remove classLoader assignment in conditional.

Change-Id: I59e8da66d5cd405bd37783088083d69e52d8933c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBUG-8327: Introduce DOMYangTextSourceProvider and implement it 46/56246/4
Robert Varga [Fri, 28 Apr 2017 12:05:21 +0000 (14:05 +0200)]
BUG-8327: Introduce DOMYangTextSourceProvider and implement it

Migration requires that DOMSchemaService provides the capability to
access underlying sources in YANG text. Rather than modifying the
base DOMSchemaService, make it an DOMExtensibleService and define
the appropriate extension, DOMYangTextSourceProvider.

Update OsgiBundleScanningSchemaService to implement the new
extension.

Change-Id: I4c75d8abdf850c42fe69a08201f976271a2cbc8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBUG-7927: stop scanning bundles on framework stop 92/56192/4
Robert Varga [Thu, 27 Apr 2017 17:33:36 +0000 (19:33 +0200)]
BUG-7927: stop scanning bundles on framework stop

Monitor framework bundle for STOPPING event and when it triggers
flag us as stopping: all bundles are about to shut down, so there
is no point in trying to update the schema context anymore.

Change-Id: I1a55169fce1705c19a139063cf632674fc256701
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoTurn off visibility of OsgiBundleScanningSchemaService#start() 88/56188/3
Robert Varga [Thu, 27 Apr 2017 16:41:10 +0000 (18:41 +0200)]
Turn off visibility of OsgiBundleScanningSchemaService#start()

Since the start() method is only used in the createInstance(), it
should be private and not exposed.

Change-Id: I0264d0a66bbfb2536bc4d6c57f27f15584ddfabb
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBinding Generator Implementation & decomposition 42/56142/4
Martin Ciglan [Thu, 27 Apr 2017 08:34:22 +0000 (10:34 +0200)]
Binding Generator Implementation & decomposition

- support YANG groupings

Change-Id: If8b62b09fc61db523050ff94f53d2b7f03c422ad
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoCode generator prototype - Binding specification v2 75/56175/2
Martin Ciglan [Thu, 27 Apr 2017 14:28:26 +0000 (16:28 +0200)]
Code generator prototype - Binding specification v2

- fixes compilability issue with setter return type for nested element
e.g. String for leaf or inner container, etc...

Change-Id: I372f1492624bc9f566eaddf7ddd02e3534580f9d
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoLazily create schema context in GlobalBundleScanning* 87/56187/2
Robert Varga [Thu, 27 Apr 2017 16:38:37 +0000 (18:38 +0200)]
Lazily create schema context in GlobalBundleScanning*

On OsgiBundleScanningSchemaService startup, it calls
tryToUpdateSchemaContext when bundleTracker.open() completes.
This parses and creates a schema context and notifies listeners
of the updated schema context. However we don't have to call
tryToUpdateSchemaContext in start() unless there actually are
listeners registered as the purpose of tryToUpdateSchemaContext
is to update listeners. So made this change. It's not likely there
would be any listeners at that point anway.

I also changed the synchronization so as not to synchronize on 'this'
or the class instance as both are unsafe (users could sync on the
instance causing unwanted contention, either innocently or maliciously).

Change-Id: I435358b0851671b7fbfdc9784577c91ff20556df
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoSpeed up OsgiBundleScanningSchemaService close 86/56186/1
Robert Varga [Thu, 27 Apr 2017 16:20:53 +0000 (18:20 +0200)]
Speed up OsgiBundleScanningSchemaService close

On close, the OsgiBundleScanningSchemaService closes the
BundleTracker which untracks all the bundles and notifies the listener
of removed bundles. This results in a call to tryToUpdateSchemaContext
which causes the remaining yang files to be re-parsed to build a new
SchemaContext. To prevent this extra processing on shutdown, I added
a "stopping" flag to elide tryToUpdateSchemaContext the same we do
with the "starting" flag.

Change-Id: I9f7c05277df9bf1ffaec1c699453020312aab203
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoCode generator prototype - Binding specification v2 92/56092/1
Martin Ciglan [Wed, 26 Apr 2017 15:40:01 +0000 (17:40 +0200)]
Code generator prototype - Binding specification v2

- fixes compilability issues in builder template
including prerequisities

Change-Id: I1653caf42139256b54a38b754f0121e749a4e61a
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoCode generator prototype - Binding specification v2 88/55988/2
Martin Ciglan [Tue, 25 Apr 2017 12:43:00 +0000 (14:43 +0200)]
Code generator prototype - Binding specification v2

- this adds proper @Override tags to methods specified by superclasses.

Change-Id: Ib938ce31b71ca8fdf1aa35038b39b61f5abd1821
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoCode generator prototype - Binding specification v2 79/55979/1
Martin Ciglan [Tue, 25 Apr 2017 11:04:09 +0000 (13:04 +0200)]
Code generator prototype - Binding specification v2

- fixes compilability issues in class template
for constructors

Change-Id: Ib55533f6dc8948b2ca23c395e19b5a6ed30d4b76
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoCode generator prototype - Binding specification v2 95/55895/2
Martin Ciglan [Mon, 24 Apr 2017 11:35:26 +0000 (13:35 +0200)]
Code generator prototype - Binding specification v2

- fixes compilability in case of generated Java interfaces
- bit of a code clean-up

Change-Id: Ic8986733dea8fca60024c0a3639d2fd651ab16a0
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoUse YangSnippetCleaner in implemetation + test with yangs 91/55891/3
Jakub Toth [Mon, 24 Apr 2017 10:58:08 +0000 (12:58 +0200)]
Use YangSnippetCleaner in implemetation + test with yangs

  *fix revision part of module in yangTemplateForModule template

Change-Id: Ic5719982c25c0c4223eeb66da8de2afe27d4d8ec
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoBug 3147 - Improve generating of toString() method in builderTemplate 32/55832/3
Jakub Toth [Fri, 21 Apr 2017 20:45:47 +0000 (22:45 +0200)]
Bug 3147 - Improve generating of toString() method in builderTemplate

Change-Id: I0904401c9046831cdc6b4a103fc07a179b954cfb
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoCode generator prototype - Binding specification v2 96/55796/2
Martin Ciglan [Fri, 21 Apr 2017 09:32:43 +0000 (11:32 +0200)]
Code generator prototype - Binding specification v2

- fixes all YangModuleInfo related stuff to make
generated code compilable

Change-Id: If33eb32af3540ade129d75cdca41b6a8eb62b97f
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoFix Checkstyle problems (red in Eclipse, missed in build) 60/55760/1
Michael Vorburger [Wed, 19 Apr 2017 15:24:01 +0000 (17:24 +0200)]
Fix Checkstyle problems (red in Eclipse, missed in build)

required for overall move to new Checkstyle version, see
https://git.opendaylight.org/gerrit/#/q/topic:bumpCheckstyle-carbon

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

7 years agoCode generator prototype - Binding Specification v2 11/55711/1
Martin Ciglan [Thu, 20 Apr 2017 07:12:17 +0000 (09:12 +0200)]
Code generator prototype - Binding Specification v2

- benefits from https://git.opendaylight.org/gerrit/#/c/55146/
- bugfix for typedefs
- some code clean-up

Change-Id: I1f52f70bc320792ba22fa751c5d6257c3d7fbc05
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoIgnore normalizing of identifiers with reserved paths. 46/55146/5
Jakub Toth [Tue, 18 Apr 2017 09:41:12 +0000 (11:41 +0200)]
Ignore normalizing of identifiers with reserved paths.

Change-Id: Ie0a48b8cc7f68e88afa1e4a4837ed7eaa37f637f
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoBUG-8226: Add @Override to public methods 97/55197/1
Robert Varga [Thu, 13 Apr 2017 13:53:43 +0000 (15:53 +0200)]
BUG-8226: Add @Override to public methods

This adds proper @Override tags to methods specified by superclasses.

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

7 years agoBug 8151 - AuxiliaryGenUtils - Increase test coverage 87/54887/4
Jakub Toth [Thu, 6 Apr 2017 20:05:30 +0000 (22:05 +0200)]
Bug 8151 - AuxiliaryGenUtils - Increase test coverage

Change-Id: Id57b3f58a8771b23b35927d8ed308412781aee85
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoFix missing sorting of augmentations in AssertDataObjects 11/54811/2
Michael Vorburger [Tue, 11 Apr 2017 19:38:50 +0000 (21:38 +0200)]
Fix missing sorting of augmentations in AssertDataObjects

Change-Id: I7cbe3fef3f4d25c1a9c625fd8796b8b91e820f98
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Faseela K <faseela.k@ericsson.com>
7 years agoRemove implementations of definitions from template 51/54851/2
Jakub Toth [Wed, 12 Apr 2017 09:33:01 +0000 (11:33 +0200)]
Remove implementations of definitions from template

Change-Id: I5c1fc43c0de58700ef73a080c3b8028cf5ccc91a
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoCode Generator Prototype - Binding Specification v2 19/54519/12
Martin Ciglan [Fri, 7 Apr 2017 10:53:10 +0000 (12:53 +0200)]
Code Generator Prototype - Binding Specification v2

- provide means for processing generated types
to actual compilable Java files
- generators & renderers adjustments (enum, interface, class, builder)
- code clean up
- bugfix revealed while testing

Change-Id: I1c94e6b53b62cc4b77c36c87b909877c8a072d56
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoImprove NonJavaCharsConverter 80/54580/5
Jakub Toth [Mon, 10 Apr 2017 09:17:19 +0000 (11:17 +0200)]
Improve NonJavaCharsConverter

  * rename NonJavaCharsConverter to JavaIdentifierNormalizer
  * rename public methods of JavaIdentifierNormalizer from 'convert*'
    to 'normalizeIdentifier'
  * add new checking of identifiers by set of SPECIAL_RESERVED_WORDS

Change-Id: Ia603a4876065fe9f7420cafe5128c3ce89e47555
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoFix unstable test YangTemplateTest in binding2. 47/54747/2
Jakub Toth [Tue, 11 Apr 2017 08:05:18 +0000 (10:05 +0200)]
Fix unstable test YangTemplateTest in binding2.

Change-Id: I035f9f6e7cb7be8ad4aa63609e9f5e28370908db
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoBump versions by x.(y+1).z for next dev cycle 05/54705/1
Anil Belur [Tue, 11 Apr 2017 01:45:42 +0000 (11:45 +1000)]
Bump versions by x.(y+1).z for next dev cycle

Change-Id: Ia61eeda429f5e56629f70824dc156372557673e1
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
7 years agoFix wrong call to delete instead of write. 15/54615/1
Andrej Záň [Mon, 10 Apr 2017 17:10:43 +0000 (19:10 +0200)]
Fix wrong call to delete instead of write.

Change-Id: Ib7ed39e082fb83d3c78e752129a1cc573a43fcdd
Signed-off-by: Andrej Záň <andrej.zan@pantheon.tech>
7 years agoBug 8002 - Fixing and cleanup of templates for binding2 05/54005/21
Jakub Toth [Thu, 16 Mar 2017 08:00:01 +0000 (09:00 +0100)]
Bug 8002 - Fixing and cleanup of templates for binding2

  *created cleaner of generated yangs via templates
  *fixed and completed templates
  *added tests

Change-Id: I4f769d59d72769a53afc3edf1392f3914f0d42e1
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoBug 8151 - AugmentToGenType - Increase test coverage 09/54309/5
Jakub Toth [Mon, 3 Apr 2017 06:09:14 +0000 (08:09 +0200)]
Bug 8151 - AugmentToGenType - Increase test coverage

Change-Id: I9ca589aa6ad631c3a09f198bd2a9ca85cfed9aee
Signed-off-by: Jakub Toth <jatoth@cisco.com>