enum (1.5) equality ?


When using == to compare enum values, intellij marks a warning :
"Object values are compared using '==', not '.equals()'".

Now is this correct, should I really use equals to compare enum values?
Thanks !


1 comment
Comment actions Permalink

This is a known issue, and will be fixed in the next release, by providing a flag as to whether == between enums should receive a warning. Since there are differences between .equals() and == for enums (tricky classloader issues, mostly), I will be making the check optional.

--Dave Griffith


Please sign in to leave a comment.