Object javadocs and Josh Bloch tell us a great deal about how hashCode/equals should be implemented, and good IDEs will handle fields of various types correctly. Some discussio
Sounds like what you're looking for is an addon or feature in an IDE that performs the analysis of the classes and generates warnings if the equals() and hashCode() methods do not reference all the relevant fields.
This would basically move the reflection overhead to the IDE rather than let it have the cost during run-time.
Unfortunately, I don't know of any addon that does this, though I'll certainly have a look.
On the other hand, how would such an automated tool know which fields are relevant for business logic? You'd probably need to mark irrelevant fields with something like an annotation, otherwise you could find yourself with warnings you can't get rid of, but that you know are incorrect.
Edit: This answer is not useful, so I'm just compiling here the really useful suggestions from better answers:
equals()
, hashCode()
and other boiler-plate code - since it's generated at compile-time, any changes to the class will automatically update these methods tooequals()
with reflection - doesn't support testing hashCode()