commons-issues mailing list archives

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

    [ https://issues.apache.org/jira/browse/COLLECTIONS-340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13639470#comment-13639470
] 

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: https://issues.apache.org/jira/browse/COLLECTIONS-340
>             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)))
{noformat} 

--
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: http://www.atlassian.com/software/jira

Mime
View raw message