logo       

Are there any annotations to help find invalid hashCode() and equals() meth: msg#00041

java.findbugs.general

Subject: Are there any annotations to help find invalid hashCode() and equals() methods?

Hi,

In my object model I have some fields that should always be referred to
in equals() and hashCode() implementations and some that should never be
referred to. It would be really helpful I could annotate these facts so
that FindBugs can spot any mistakes as I or my team mates change fields
without modifying equals()/hashCode() or vice versa. Assuming the
annotations were standard or standardised then Eclipse (or whatever IDE)
could even be taught to respect the annotations when generating the
equals() and hashCode() implementations.

Anybody heard of such annotations? or have an idea where else I should
suggest the idea?

Cheers,

Rob


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise