[YANGTOOLS-595] Make bits serialization sorted (alphabetically) Created: 18/Mar/16  Updated: 10/Apr/22  Resolved: 22/Mar/16

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Vratko Polak Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 5560

 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:
public interface BitsCodec<T> extends Codec<T, Set<String>>{
and Set loses the ordering.
This makes ODL report bits in pseudorandom order, which is not nice as users need more logic to compare outputs.

A simple improvement would be to order serialized values alphabetically. It would take some CPU cycles, but most Yang models only have a few bits to sort.



 Comments   
Comment by Vratko Polak [ 18/Mar/16 ]

An early idea of a fix, not verified yet:
https://git.opendaylight.org/gerrit/#/c/36450/

Comment by Tony Tkacik [ 22/Mar/16 ]

Cannonical ordering (YANGTOOLS-596) would be more preferable then ordering by alphabet

Comment by Vratko Polak [ 22/Mar/16 ]

(In reply to Tony Tkacik from comment #2)
> Cannonical ordering (YANGTOOLS-596) would be more preferable then ordering by
> alphabet

I agree, but I suspect YANGTOOLS-596 fix will only be included in Boron.
If Beryllium does not get that YANGTOOLS-596 fix, would this improvement be suitable for Beryllium?

Generated at Wed Feb 07 20:53:43 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.