Archive for January 26th, 2010

What’s the deal with Java equals() and hashcode()?

Continue Reading January 26th, 2010 Jeff Howell

I came across this issue a couple years ago. It was surprisingly not-so-obvious to the developer, a good developer, who was sorting out a very elusive bug in a large Java application.

The symptom was that a Map of objects sometimes returned null when queried. The developer ran the code in a debugger and could see that the object was put into the Map. Yet, when the map was asked to retrieve the object, it was not found (even though it could be seen by inspection in the debugger).

Other objects were successfully stored and retrieved from the same Map.

Continue Reading Add comment


Pages

Categories

Most Recent Posts

Feeds

  Subscribe in a reader

Calendar

January 2010
M T W T F S S
« Dec   Feb »
 123
45678910
11121314151617
18192021222324
25262728293031

Tags

Calendar

January 2010
M T W T F S S
« Dec   Feb »
 123
45678910
11121314151617
18192021222324
25262728293031

Posts by Month

Posts by Category