Hmm, maybe I should have another blog for Java geeking.
What happened was, I had an ArrayList and for a variety of
reasons I decided to turn it into a HashMap.
After I’d fixed
everything up, I got the weirdest NullPointerException, and I
traced it to a call that looked like (x is the HashMap)
if ((x.size() > 0) && x.get(0).equals(foo))
and somehow the compiler had decided that get(0) was a reasonable thing to do
to a HashMap. Uh, strong typing, anyone?
By Tim Bray
I am an employee
of Amazon.com, but
the opinions expressed here
are my own, and no other party
necessarily agrees with them.
A full disclosure of my
professional interests is
on the author page.