openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Lee (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1120) idEquals() broken in BigDecimalId and BigIntegerId
Date Fri, 05 Jun 2009 16:32:07 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12716663#action_12716663
] 

Albert Lee commented on OPENJPA-1120:
-------------------------------------

Need to check if "other" is a BigDecimalId or a subclass of BigDecimalId, otherwise a ClassCastException
will occur in the return statement.

       if(key == null || ! BigDecimalId.class.isAssignableFrom(other.getClass())) 
             return false;
 
        return key.equals(((BigDecimalId)other).key);

Albert Lee.

> idEquals() broken in BigDecimalId and BigIntegerId
> --------------------------------------------------
>
>                 Key: OPENJPA-1120
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1120
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0
>            Reporter: dieter von holten
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: BrokenEqualsId.patch
>
>
> in openjpa/util/BigDecimalId and open/util/BigIntegerId the idEquals-methods compare
their own keys to the other object, not to others.key.
> That would always result in false - which is false sometimes

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message