[jboss-jira] [JBoss JIRA] Closed: (JBAS-6487) org.jboss.mq.server.MessageReference does override equals, but not hashCode

Adrian Brock (JIRA) jira-events at lists.jboss.org
Mon Feb 9 08:04:44 EST 2009


     [ https://jira.jboss.org/jira/browse/JBAS-6487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Brock closed JBAS-6487.
------------------------------

    Fix Version/s: JBossAS-4.2.4.GA
       Resolution: Done


I've applied your patch since it makes sense.

But its not a real issue since at least in the current version of JBossMQ you can't have two 
different MessageReferences representing the same message in memory at the same time.

> org.jboss.mq.server.MessageReference does override equals, but not hashCode
> ---------------------------------------------------------------------------
>
>                 Key: JBAS-6487
>                 URL: https://jira.jboss.org/jira/browse/JBAS-6487
>             Project: JBoss Application Server
>          Issue Type: Quality Risk
>      Security Level: Public(Everyone can see) 
>          Components: JMS (JBossMQ)
>    Affects Versions: JBossAS-4.2.3.GA
>            Reporter: Rico Neubauer
>            Assignee: Adrian Brock
>             Fix For: JBossAS-4.2.4.GA
>
>         Attachments: JBAS-6487.diff
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list