[MDSAL-58] Binding Java API Generator: Inner class with same name as outer class is not allowed Created: 12/Nov/14 Updated: 09/Mar/18 Resolved: 01/Mar/18 |
|
| Status: | Verified |
| Project: | mdsal |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Martin Ciglan | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Issue Links: |
|
||||||||
| External issue ID: | 2360 | ||||||||
| Description |
|
If model contains this structure: . binding generator generates Group interface with inner Group class, which is not compilable. |
| Comments |
| Comment by Shivani Pathak [ 20/Nov/15 ] |
|
As this problem persists specifically when [case and leaf name is same] & [leaf Type is 'Union'],one option is to add some prefix with the name of the inner class(corresponding to the leaf) while converting Yang into Java code so that there will not be any conflict between outer class and inner class name. Below is an example for the same: Ex.Container mycont{ } An interface will be created for case 'MyCase.java' with an inner class named 'MyCase'. We can add a check to append a prefix to the inner class such as InnerMyCase. Please suggest and provide any references/documents if any to help me in making the changes in specific generators as this scenario is very particular and the suggested chnage will have a generic impact on so many scenarios. |
| Comment by Martin Ciglan [ 11/Mar/16 ] |
|
solution of this issue is part of new Binding specification v2, which is going to be designed and implemented in Boron |
| Comment by Vratko Polak [ 06/Jul/16 ] |
|
More example structures: |
| Comment by Vratko Polak [ 06/Jul/16 ] |
|
A complete yang model for testing: |
| Comment by Jie Han [ 20/Oct/17 ] |
|
This issue has been resolved in binding2. |