[MDSAL-84] Binding spec v1: auto generated code by YANGTOOLS could be more efficient. Created: 07/May/15 Updated: 09/Mar/18 Resolved: 13/Feb/17 |
|
| Status: | Resolved |
| Project: | mdsal |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | ||
| Reporter: | chenguohai | Assignee: | Jakub Toth |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Description |
|
I am reading the code under ALTO@ODL. And here are my two comments. 1:File named ‘AltoProviderImplBuilder’under alto-provider/……./modules/module/configuration :in function named 'toString',first is defined to judge a common should be inserted, i recommend writting as following @Override if (_dataBroker != null) { builder.append("_dataBroker="); builder.append(_dataBroker); builder.append(", ");//new added } if (_rpcRegistry != null) { //if (first) { // first = false; //} else { // builder.append(", "); //} builder.append("_rpcRegistry="); } else { // builder.append(", "); //} builder.append("augmentation="); BTW,could anyone tell me who is responsible for the improvements |
| Comments |
| Comment by chenguohai [ 07/May/15 ] |
|
this is not a major problem,but if we could make it more efficient. |
| Comment by Tony Tkacik [ 07/May/15 ] |
|
If you have some time you may want to improve, otherwise this will be picked-up by someone from yangtools / community. |
| Comment by chenguohai [ 07/May/15 ] |
|
(In reply to Tony Tkacik from comment #2) let expert do it ,i do not have time.Thanks. |
| Comment by Robert Varga [ 08/Sep/15 ] |
|
This needs to be translated to the builder template. I believe the individual entries are emitted in a loop, where the first two include an additional condition – hence the duplicate lines. In order to implement this, the generator needs to perform look-ahead, e.g. it needs to understand that a following entry will definitely be emitted. As things stand this is always true for augmentable types, but that can actually change in future – augmentations are empty most of the time, so it may make sense to print them out only if they are non-empty. In any case this code has moved to the MD-SAL project, so this issue should live there, too. |
| Comment by Jakub Toth [ 02/Jan/17 ] |
| Comment by Martin Ciglan [ 01/Feb/17 ] |
|
boron: |
| Comment by Robert Varga [ 02/Feb/17 ] |
|
Reopening, as it breaks format and the patches have been reverted. |
| Comment by Jakub Toth [ 03/Feb/17 ] |
| Comment by Martin Ciglan [ 09/Feb/17 ] |
|
boron backport: |
| Comment by Jakub Toth [ 13/Feb/17 ] |
|
hotfix: |