|
[Coding]
Fooled by Java identity
[
joehni
]
How often do you imply facts that nowhere have been stated or confirmed? Last week I found myself trapped by such a certainty that revealed to be a false assumption. Ever asked yourself what you can expect from the values delievered by the JDK's method Well, the implication was wrong. Short unit test:
junit.framework.AssertionFailedError: expected:<50000> but was:<49963> Bottom line: The identity hash code of an object does not mean uniqueness. And have a closer look at the (short) Javadoc of System.identityHashCode() — uniqueness is nowhere stated Post a comment
|