You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Greg Brown (JIRA)" <ji...@apache.org> on 2011/03/25 13:03:05 UTC

[jira] [Commented] (PIVOT-704) JSONSerializer can't deserialize to BigDecimal

    [ https://issues.apache.org/jira/browse/PIVOT-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011169#comment-13011169 ] 

Greg Brown commented on PIVOT-704:
----------------------------------

That logic will fail when value is an instance of Number (it will convert to long or double instead of BigInteger and BigDecimal).


> JSONSerializer can't deserialize to BigDecimal
> ----------------------------------------------
>
>                 Key: PIVOT-704
>                 URL: https://issues.apache.org/jira/browse/PIVOT-704
>             Project: Pivot
>          Issue Type: Bug
>          Components: core-beans, core-json, core-serialization
>    Affects Versions: 2.0
>            Reporter: Augustus Thoo
>            Assignee: Sandro Martini
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: patch.patch
>
>
> JSONSerializer would throw an IllegalArgumentException "Unable to coerce double to BigDecimal" when the object class contains at least one BigDecimal field.
> Exception is traced to BeanAdapter.java , line 916, where coerce(Object, Class) has no else-if for BigDecimal class.
> Re: http://apache-pivot-users.399431.n3.nabble.com/JSONSerializer-can-t-deserialize-to-BigDecimal-td2464302.html

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira