[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: classpath ./ChangeLog java/lang/

From: Brian Jones
Subject: Re: classpath ./ChangeLog java/lang/
Date: 15 Nov 2001 08:40:17 -0500
User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7

Bryce McKinlay <address@hidden> writes:

> Why? This shouldn't be neccessary.

Double.valueOf (String)
calls->new Double (String)
calls->parseDouble (String)

parseDouble is now completely native, which means the previous code
that did a trim in Java and would have thrown the NullPointerException
is no longer there.  I still don't get why Tom wanted to do the trim
in a native method.

In java_lang_Double.c, we do GetStringUTFChars on the null
object. which did not throw a NullPointerException using ORP at
least.  According to the JNI specification that method only throws
OutOfMemoryError so maybe this is normal behavior.

In the official Javadoc for Double (String) and parseDouble (String)
each is said to only throw NumberFormatException whereas
Double.valueOf is documented to throw the runtime exception
NullPointerException.  So doing so explicitly in this method (a)
matches the Javadoc and (b) passes Mauve's tests.

Brian Jones <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]