This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Re: Patch: String.toString()
- To: Bryce McKinlay <bryce@albatross.co.nz>
- Subject: Re: Patch: String.toString()
- From: Tom Tromey <tromey@cygnus.com>
- Date: Thu, 1 Jul 1999 23:55:21 -0700
- Cc: java-patches@sourceware.cygnus.com
- References: <377C2ADF.D7D38622@albatross.co.nz>
>>>>> "Bryce" == Bryce McKinlay <bryce@albatross.co.nz> writes:
Bryce> String.toString() needs to throw a NullPointerException if it
Bryce> is called on a null reference. Thanks to Anthony for pointing
Bryce> out the problem. I have committed this to the trunk.
Could you add the test case to testsuite/libjava.lang? Thanks.
FWIW I'm not entirely certain this patch is the way to go.
Instrumenting code all over libjava to check for null seems tedious
and error-prone. If users have to do this, too, then it is worse than
that -- it is an actual bug.
It seems that the right long-term fix must be in the compiler.
Tom