This is the mail archive of the java-patches@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: String.toString()


>>>>> "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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]