openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@dvholten.de
Subject Re: [jira] Commented: (OPENJPA-1120) idEquals() broken in BigDecimalId and BigIntegerId
Date Fri, 05 Jun 2009 16:53:23 GMT
yeah, but that is also valid for the other subclasses of OpenJPAId. They 
also just cast -  my patch is in line with that,



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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message