[IG] == on type-safe enums?

InspectionGadget is not happy about using identity comparison
(==) on type-safe enum objects.

Could it be possible to make IG a little more type-safe enum aware?
(i..e the type being =='ed has a private constructor or something in
those lines).

I've read the potential issue of using == with multiple classloaders in a
previous discussion but maybe that could be a big warning displayed
right next to the "disable inspection for typesafe enums" checkbox :)



Comment actions Permalink

It would certainly be possible. The other place where knowlege of enums would be valuable is in the abstraction inspections, which complain if you declare a concrete class rather than an interface for various uses. Those should be extended to not complain about enums being declared (any more than they complain about "int" or "double").

That said, IG development is on hiatus, pending both the completion of MetricsReloaded and clarification of JetBrains intentions with respect to IG. I'll put this issue on the TODO list, and someone will eventually get to it, but no gaurantee about either who or when. Sorry.

Comment actions Permalink

Makes sense.
What's the status of IG with regards to JetBrains btw? "Integrate
Dave's IG" is not on the public Pallada TODO list anymore. Have
you been talking with them or are you just in the dark, too?


Comment actions Permalink

I have been in contact with JetBrains, but nothing is finalized.

--Dave Griffith


Please sign in to leave a comment.