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

    Details

    • Type: Quality Risk
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: JBossAS-4.2.3.GA
    • Fix Version/s: None
    • Component/s: JMS (JBossMQ)
    • Labels:
      None
    • Estimated Difficulty:
      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                adrian.brock Adrian Brock
                Reporter:
                MrEasy Rico Neubauer
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: