Shared publicly  - 
 
Does it throw?

. . . . public int switchOnEnum() {
. . . . . . Dwarf dwarf = Dwarf.SLEEPY;
. . . . . . switch (dwarf) {
. . . . . . case SLEEPY:
. . . . . . . . return 0;
. . . . . . default:
. . . . . . . . throw new AssertionError("dwarf = " + dwarf);
. . . . . . }
. . . . }

Hint 1: Dwarf is an enum.
Hint 2: Dalvik is a lot better today than it was just 2 years ago.
9
1
David Beaumont's profile photoTomek Czajka's profile photoEmmett Cunningham's profile photoEric Burke's profile photo
7 comments
 
Fell RIGHT over this myself a long time ago. I didn't realize it was fixed. I ended up doing a toString() compare.
 
Wow.  That's a sanity-killer.
 
I would hate to be the one debugging this...
 
How the crap does somebody get a race condition into as switch statement?
 
I'm guessing that two instances of SLEEPY got created due to some bug in initialization.
Add a comment...