[YANGTOOLS-596] Make bits serialization sorted (by position) Created: 18/Mar/16 Updated: 10/Apr/22 Resolved: 18/Oct/16 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Vratko Polak | Assignee: | Robert Varga |
| 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: | 5561 |
| Description |
|
Yang specification describes canonical form for bits to be ordered by position: http://tools.ietf.org/html/rfc6020#section-9.7.3 But yang-data-api specifies: getBits() of BitsTypeDefinition already is a List, so it can preserve given ordering. But BitsCodes API change is required to make the ordering visible for serialization. Also, BitsTypeBuilder.build() is already aware of positions, but it does not use this information when passing arguments to constructor of BaseBitsType (usinging positionMap as a TreeMap could fix that). As this improvement requires an API change, it could be done as part of Binding Specification v2 initiative. |
| Comments |
| Comment by Robert Varga [ 05/Sep/16 ] |
|
java.util.Set does not specify iteration order, it only defines hashCode() and equals(). Iteration order is a property of an implementation and there certainly are implementations which have predictable iteration order: ImmutableSet, LinkedHashSet, for example. Hence there is no need to change APIs. |
| Comment by Robert Varga [ 05/Sep/16 ] |
| Comment by Robert Varga [ 05/Sep/16 ] |
| Comment by Robert Varga [ 05/Sep/16 ] |
|
mdsal part for BA->BI: https://git.opendaylight.org/gerrit/45158 |
| Comment by Robert Varga [ 08/Sep/16 ] |
|
last link should be https://git.opendaylight.org/gerrit/#/c/45161/ |
| Comment by Ryan Goulding [ 18/Oct/16 ] |