Please see javadoc for String.hashCode:
http://docs.oracle.com/javase/6/docs/api/java/lang/String.ht...
It's true that relying on hashCode to remain stable across arbitrary objects is brittle, but this is not the case for String.
It's true that relying on hashCode to remain stable across arbitrary objects is brittle, but this is not the case for String.
String.hashCode explicitly guarantees consistency across processes by specifying how the hash code is computed, this is something that can be safely relied upon. (Same for Integer, Long, Float and Double)