axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexis Reigel (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Created: (AXIS-2587) NumberFormatException for new UnsignedLong( double )
Date Mon, 06 Nov 2006 14:34:37 GMT
NumberFormatException for new UnsignedLong( double )
----------------------------------------------------

                 Key: AXIS-2587
                 URL: http://issues.apache.org/jira/browse/AXIS-2587
             Project: Apache Axis
          Issue Type: Bug
          Components: Basic Architecture
    Affects Versions: current (nightly)
            Reporter: Alexis Reigel


The double constructor for the class org.apache.axis.types.UnsignedLong raises a NumberFormatException
exception if the argument is a double value.
E.g. 

<code>UnsignedLong ulong = new UnsignedLong(1D);</code>

The Problem lies in the constructor itself. The line

<code>new BigInteger(Double.toString(value))</code>

calls the constructor of java.lang.BigInteger which expects a string defined as follows: "The
String representation consists of an optional minus sign followed by a sequence of one or
more decimal digits". In the case of a double value this fails of course.

I'm not sure about the purpose of this constructor anyway. Why would you want to create a
long from a double?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message