Skip to content

Map Builders should preserve order #99

Closed
@hendrikmuhs

Description

@hendrikmuhs

Object Builders for maps use an InternalMap which is a sub-class of a hash map:

private static final class InternalMap<K, V> extends HashMap<K, V> {

Hash maps are unordered, the order is defined by the internal hashing function and can be different for different runtime environments. Although the JSON standard does not define dictionaries to be ordered, it would be good to switch to a linked hash map with insertion order:

Because this does not seems performance-critical, I suggest to switch to a linked hash map with insertion order

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions