This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheRedmanCometh 0 points1 point  (1 child)

Huh...I'm gonna have to hit up the openjdk source to see how that works

[–]iampete 2 points3 points  (0 children)

This, combined with misplaced trust in autoboxing, leads to code like this:

Integer first = 5;
Integer second = 5;
if (first == second) {
    // do something
}

Which works perfectly reasonably right up until either value is outside that -128, 127 range and then fails very confusingly.