In the following code:
HashMap<String, Integer> hm = new HashMap<String, Integer>();
hm.put("Driller", 0);
hm.put("Planner", 1);
"Planner" entry overwrites "Driller". Their respective hashcodes are obviously different. If the keys are just in lowercase ("driller" and "planner") then put works properly. However, for different reasons internal to the project, it is not possible to change the key case.
I am using JDK 7 Update 25 64 bits, but as far as I know String hashcodes have been really stable since early versions.
Do you know what is going on and how could I solve it?