Uploaded image for project: 'Commons BCEL'
  1. Commons BCEL
  2. BCEL-140

org.apache.bcel.generic.Instruction.equals(Object) does not follow Object.equals(Object) rules

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.2
    • Fix Version/s: 6.0
    • Component/s: Main
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              issues@commons.apache.org Apache Commons Developers
              Reporter:
              org.apache-bugs-no-private-mail@reg.v6ak.com Vít Šesták aka v6ak
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: