[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2021) org.hibernate.cache.QueryKey has a fragile equals() method

Bernard Niset (JIRA) noreply at atlassian.com
Thu Mar 6 08:08:34 EST 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29704 ] 

Bernard Niset commented on HHH-2021:
------------------------------------

Unfortunately, the fix for this bug didn't make it in 3.2.6 according to the changelog. It is too bad for a one line fix. 
I would like to emphasize on the fact it affects all versions not just 3.1.3 like indicated in header of this bug.


> org.hibernate.cache.QueryKey has a fragile equals() method
> ----------------------------------------------------------
>
>                 Key: HHH-2021
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2021
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.1.3
>            Reporter: Kenny MacLeod
>            Priority: Trivial
>
> This one is no great shakes, but the first line of QueryKey.equals() casts the argument to QueryKey without checking for its type.  As such, the method is fragile.
> It should be consistent with CacheKey, which does an instanceof check before the cast.

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

        



More information about the hibernate-issues mailing list