Performance improvements to yang.data.api.InstanceIdentifier 84/5184/2
authorTony Tkacik <ttkacik@cisco.com>
Fri, 7 Feb 2014 21:04:16 +0000 (22:04 +0100)
committerTony Tkacik <ttkacik@cisco.com>
Fri, 7 Feb 2014 22:44:53 +0000 (23:44 +0100)
commit3bfe9f1d2ad0a4f7ba880eb6c97d24fbea3e10ba
tree184915dbcad33b9af23ef5289660fd0114434e55
parent3343722e640de4fad948ee1ba02d409b435498db
Performance improvements to yang.data.api.InstanceIdentifier

- Changed Collections.unmodifiableMap() to ImmutableMap,
  which is faster and safer, since the InstanceIdentifier
  contract requires immutability
- Added hashCode cache, which is safe, since all state
  captured by instance is immutable, from the moment of
  the object allocation.

Change-Id: I4d52af24f58c63ff5870e098b2b5fc9bbb34aec4
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/InstanceIdentifier.java