Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-6487

org.jboss.mq.server.MessageReference does override equals, but not hashCode

    XMLWordPrintable

Details

    • Quality Risk
    • Resolution: Done
    • Major
    • None
    • JBossAS-4.2.3.GA
    • JMS (JBossMQ)
    • None
    • Low

    Description

      org.jboss.mq.server.MessageReference does override equals() (and even compareTo()), but not hashCode().
      This is a potential issue, when adding MessageReferences to hashCode-based Collections such as Hashmap or HashSet.

      from java.lang.Object:
      If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.

      Will append a patch.

      Came across this when searching for the root of a symptom, where messages were processed and removed from the MessageCache, but still were persistent in database - don't know yet if it's related.

      Attachments

        Activity

          People

            adrian.brock Adrian Brock (Inactive)
            r.neubauer@seeburger.de Rico Neubauer (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: