There is already an option on the inspection for whether == comparison of enums should be reported, but it's set to true by default. On consideration, I've changed this to false, but am leaving the option.
Dave, why do you need this option? equals() is declared final in java.lang.Enum, so it is impossible to make a custom equality, and the general one coincides with reference equality.
There is already an option on the inspection for whether == comparison of enums should be reported, but it's set to true by default. On consideration, I've changed this to false, but am leaving the option.
No, it is legal to compare enum constants with ==.
Actually Idea generates its equals() using == for enum constants.
A request to JIRA?
Eugene.
"Alex Roytman" <nospam@hello.world> wrote in message
news:d9iote$u9$1@is.intellij.net...
>
>
>
There is already an option on the inspection for whether == comparison of enums should be reported, but it's set to true by default. On consideration, I've changed this to false, but am leaving the option.
--Dave Griffith
Dave,
why do you need this option? equals() is declared final in java.lang.Enum,
so it is impossible to make a custom equality, and the general one coincides
with reference equality.
Eugene.
"Dave Griffith" <dave.griffith@cnn.com> wrote in message
news:26183444.1119699731910.JavaMail.itn@is.intellij.net...
>