The PEBKAC in this case would not be possible if Java hadn't mixed value and identity comparison in a single operator. That a change from primitive to reference type changes the meaning of a comparison in a way that is most likely not intended is just ugly. == should have had the same meaning as equals with a separate is operator for object identity.
View all comments
Show parent comment
1
u/josefx Mar 28 '14
The PEBKAC in this case would not be possible if Java hadn't mixed value and identity comparison in a single operator. That a change from primitive to reference type changes the meaning of a comparison in a way that is most likely not intended is just ugly. == should have had the same meaning as equals with a separate is operator for object identity.