[YANGTOOLS-339] Invalid use of addType in ChoiceCaseBuilder during copy in yang-parser-impl CopyUtils class Created: 15/Oct/14 Updated: 10/Apr/22 Resolved: 20/Oct/14 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Lukas Sedlak | Assignee: | Ladislav Borak |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 2191 |
| Description |
|
The ChoiceCaseBuilder prohibits adding of TypeDefinitionBuilder via addTypedef method, hence the copy method in CopyUtils in yang-parser-impl project tries to copy typedefs if there are present in ChoiceCaseBuilder which is faulty too. The wrong implementation is located between lines 136-137 in CopyUtils.java |
| Comments |
| Comment by Lukas Sedlak [ 16/Oct/14 ] |
|
According to RFC 6020 http://tools.ietf.org/html/rfc6020#section-7.9.2.1 grouping statement is NOT valid substatement for choices case, thus the addGrouping in ChoiceCaseBuilder SHOULD throw YangParseException in attemt to add grouping under choices case node and CopyUtils.copy(ChoiceCaseBuilder, Builder, boolean) MUST NOT have functionality to try and copy Groupings from original ChoiceCaseBuilder. |
| Comment by Ladislav Borak [ 17/Oct/14 ] |
|
proposed patch: https://git.opendaylight.org/gerrit/#/c/12041/ |