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: bcel-dev@jakarta.apache.org
        ReportedBy: qweasd-v...@soukroma.cz


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.

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscr...@jakarta.apache.org
For additional commands, e-mail: bcel-dev-h...@jakarta.apache.org

Reply via email to