First, in many cases, use a hash map.
Secondly, it uses an Oracle implementation .
This is not an endless cycle. HashTable.hashCode( just repeats through map elements once. Not infinitely. If the table does not contain itself, where to the source , I found that it is really very hacked, but prevents recursion. In this case, it skips calculating its own hash code that returns 0.
- Looking at the source,
put( called. Only the next line calls Put .
source share