commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Goran Hacek (JIRA)" <j...@apache.org>
Subject [jira] Created: (COLLECTIONS-340) NOPClosure has a broken equals method
Date Wed, 14 Oct 2009 11:46:31 GMT
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: Generics


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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message