commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Shirley (Commented) (JIRA)" <>
Subject [jira] [Commented] (CLI-120) equals and hashCode are incomplete
Date Mon, 14 Nov 2011 11:14:51 GMT


Andrew Shirley commented on CLI-120:

Sounds good, Make sure that whenever you do implement them, they follow the rules outlined
in the Javadoc on Object [1].

If you want a guide as to how to implement them properly, I would recommend the chapter on
the subject from Effective Java By Joshua Bloch or have a look at what is produced by eclipse's
"generate hashCode() and equals()" function (in the source menu).

> equals and hashCode are incomplete
> ----------------------------------
>                 Key: CLI-120
>                 URL:
>             Project: Commons CLI
>          Issue Type: Improvement
>          Components: CLI-2.x
>            Reporter: Andrew Shirley
>            Priority: Minor
>             Fix For: 2.0
> there are many classes with equals and hashCode implemented however there are also classes
which don't. We need to be consistent and if we are using equals then we need to define it
for all classes in the affected hierarchy. For example OptionImpl has an equals but ParentImpl
which extends OptionImpl and has several new members doesn't.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message