views:

81

answers:

1
+2  A: 

Based on you timestamped debug output being correct, please remember the following, regarding the HashMap class:

This class makes no guarantees as to the order of the map; in particular, it does not guarantee that the order will remain constant over time.

from the javadoc: http://download.oracle.com/javase/6/docs/api/java/util/HashMap.html

In the debugger, it may have looked like a key/value pair was being overwritten, but in reality, the insertion probably changed the order of the HashMap. Testing the return value of put(...) is the best way to test if a new key/value is colliding with an existing key.

RD
thanks, that's it!
Asahi