commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <>
Subject [jira] [Commented] (COLLECTIONS-340) NOPClosure has a broken equals method
Date Tue, 23 Apr 2013 19:37:16 GMT


Thomas Neidhart commented on COLLECTIONS-340:

It looks like this change has been lost during the generics_branch merge.
I think we can keep it as is and highlight it in the release notes.
> NOPClosure has a broken equals method
> -------------------------------------
>                 Key: COLLECTIONS-340
>                 URL:
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Functor
>            Reporter: Goran Hacek
>            Priority: Minor
>             Fix For: 4.0
> Equals method of NOPClosure class doesn't follow objects equals contract. It isn't symmetric
nor transitive and it is just plain wrong.
> Following code evaluates to true on most (if not all) JVM implementations:
> {noformat} NOPClosure.INSTANCE.equals(new Integer(System.identityHashCode(NOPClosure.INSTANCE)))

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

View raw message