BUG-582: improve SchemaPath.hashCode() 66/7766/14
authorRobert Varga <rovarga@cisco.com>
Thu, 5 Jun 2014 21:51:26 +0000 (23:51 +0200)
committerMartin Vitez <mvitez@cisco.com>
Mon, 23 Jun 2014 10:39:55 +0000 (12:39 +0200)
commit5c32de6f002ecd2ebf98018b79d2afeae0770718
treec601898ff2d6d884f720d7046c262f3c840479bc
parentc0f47a6c3d3a0e0ef15de3b8beb5cc942d88fccd
BUG-582: improve SchemaPath.hashCode()

SchemaPath.hashCode() is currently the hottest hashCode of immutable
objects. SchemaPath has similar uses as the BA InstanceIdentifier, where
we use hash code caching.

This patch introduces such caching. It also prevents list duplication
when we do not need to copy the entire list.

Change-Id: I5a8fe845ebb50308fde7fc766970f81ea706c203
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-model-api/pom.xml
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaPath.java