Include shared fields in equals() and hascode()?

Just after some clarification on 'Generate equals() and hashcode()..' behaviour. I've noticed that when you invoke it on subclasses whose parent(s) don't have their own equals() and hascode() methods the public and protected fields of the parent class(es) aren't available to be added to the subclasses generated equals() and hashcode() ? Argueablly the shared fields are, more often than not, the most critical fields.

Something thats been niggling me dealing with this legacy code that's several abstract levels deep, none of which do implement those methods. If no support is planned an inspection would be handy as I've made this mistake with automatic generation too many times now and they're always a nightmare to debug.

- Richard

PS Ditto for 'Generate toString()..'

Please sign in to leave a comment.