axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexis Reigel (JIRA)" <>
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
             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.

<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:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message