mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-02-12 11:11:00 +01:00
- ConsistentMap's key equality is based on serialized byte[].
2 Problems fixed by this patch:
(1) By caching Key -> String representation,
Cache will use Key's Object#equals for look up,
which can possibly have different equality than byte[] equality,
leading to wrong String to be used as a key in backend Database.
Fixed by reversing the mapping.
(2) Similar issues with keySet(), entrySet()
Set based on reference equality needs to be used to avoid
deduplication based on Object#equals
Fixed by replacing Set implementation with MappingSet.
Change-Id: I1b727abd2614a9b72b5b1d02ecca2de26493adcc