jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig (JIRA) <j...@apache.org>
Subject [jira] [Commented] (OAK-302) Incorrect results when converting binary values
Date Fri, 14 Sep 2012 08:56:07 GMT

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

Michael Dürig commented on OAK-302:
-----------------------------------

It seems {{ValueImpl}} doesn't correctly convert to a string value first when converting to
any other value than a string value. Instead it relies on the {{getString()}} method of the
underlying {{CoreValue}} which simply returns the {{binaryID}}. 
                
> Incorrect results when converting binary values
> -----------------------------------------------
>
>                 Key: OAK-302
>                 URL: https://issues.apache.org/jira/browse/OAK-302
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: jcr
>            Reporter: Michael Dürig
>
> {code}
> Value bin = valueFactory.createValue("123", PropertyType.BINARY);
> System.out.println(bin.getString());
> System.out.println(bin.getLong());
> System.out.println(bin.getDouble());
> {code}
> results in
> {code}
> 123
> 3313233
> 3313233.0
> {code}
> it should however be
> {code}
> 123
> 123
> 123.0
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message