juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Haumer (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JUNEAU-15) StringUtils.parseNumber(String, Class<? extends Number>) returns doubles always as floats
Date Fri, 07 Oct 2016 04:53:20 GMT
Peter Haumer created JUNEAU-15:
----------------------------------

             Summary: StringUtils.parseNumber(String, Class<? extends Number>) returns
doubles always as floats
                 Key: JUNEAU-15
                 URL: https://issues.apache.org/jira/browse/JUNEAU-15
             Project: Juneau
          Issue Type: Bug
          Components: Code
            Reporter: Peter Haumer


When you serialize a bean with a member of type "double" and read it into an ObjectMap the
map will show the value now only with float precision. 

The reason is that the parsing calls org.apache.juneau.internal.StringUtils.parseNumber(String,
Class<? extends Number>), which in Line 148 recognizes it correctly as a double, but
then call s "return d.floatValue();" to return it as a float.  The fix would be to do "return
d;" instead





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message