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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 5.2
    • 6.0
    • Main
    • 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

            issues@commons.apache.org Apache Commons Developers
            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: