Commit 659c26fc by Bryce McKinlay Committed by Bryce McKinlay

String.java (toString): Check for this == null and throw NullPointerException.

1999-07-01  Bryce McKinlay  <bryce@albatross.co.nz>
        * java/lang/String.java (toString): Check for this == null and throw
        NullPointerException.

From-SVN: r27895
parent cb1902ad
1999-07-01 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/String.java (toString): Check for this == null and throw
NullPointerException.
1999-07-01 Warren Levy <warrenl@cygnus.com>
* gnu/gcj/convert/BytesToUnicode.java (read): Changed outlength
......
......@@ -115,6 +115,9 @@ public final class String
public String toString ()
{
// because String is final, we actually get this far on a null reference
if (this == null)
throw new NullPointerException();
return this;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment