commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <>
Subject [jira] Commented: (LANG-353) Javadoc Example for EqualsBuilder is questionable
Date Thu, 20 Sep 2007 16:52:31 GMT


Henri Yandell commented on LANG-353:

Yeah, scratch the classloader bit. I dug around a bit and it was with the Enum code and not
the Builder code where we were doing such things. With Enums we did want things to be equal
across classloaders, but the builders won't care.

I'll update the javadoc with the first example, and a reference to Effective Java.

> Javadoc Example for EqualsBuilder is questionable
> -------------------------------------------------
>                 Key: LANG-353
>                 URL:
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Christoph Kutzinski
>            Priority: Minor
>             Fix For: 2.4
> The Javadoc example for the class EqualsBuilder ist questionable:
>  public boolean equals(Object obj) {
>    if (obj instanceof MyClass == false) {
>      return false;
>    }
>   ...
> The implementation with instanceof lacks guarantees like equals-symmetry  (see e.g.
 for a discussion of the issue)
> The example should be changed to use getClass(). Attention: the solution in the link
above is incomplete as it doesn't check for null

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message