DO NOT REPLY [Bug 48321] New: org.apache.bcel.generic.Instruction.equals(Object) does not follow Object.equals(Object) rules

[email protected] Tue, 1 Dec 2009 08:18:34 -0800 (PST)
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]/bugzilla/>
https://issues.apache.org/bugzilla/show_bug.cgi?id=48321

           Summary: org.apache.bcel.generic.Instruction.equals(Object)
                    does not follow Object.equals(Object) rules
           Product: BCEL
           Version: 5.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
        AssignedTo: [email protected]
        ReportedBy: [email protected]


org.apache.bcel.generic.Instruction contains two strange methods: equals and
setComparator. The equals and hashCode methods are by definition (see
http://java.sun.com/javase/6/docs/api/java/lang/Object.html#hashCode%28%29 )
broken:
* If two Instruction objects have another InstructionComparator, they can be
asymmetrically equal.
* If instructions aren't compared by identity (==), the inherited hashCode
method is by definition broken.

I suggest: deprecate setComparator method.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.