IG Suggestion -- Object values are compared using == instead of .equals()

Dave,

For this inspection:

Object values are compared using == instead of .equals()

would it be possible to add an option to ignore this check if one or both
Objects are static?

Thanks,

Ted Hill


1 comment


I assume you mean that one of the objects is a static variable. This would be easy to do, and I will probably implement it in the next release. That said, you should realize that such comparisons, while safer than general object equality, may produce unexpected results if your application uses multiple classloaders (thus allowing multiple "copies" of the same static variables).

0

Please sign in to leave a comment.