On 22/08/05, Henning P. Schmiedehausen <[EMAIL PROTECTED]> wrote:
> Brett Porter <[EMAIL PROTECTED]> writes:
>
> >How?
>
> >if keyBuffer is null (which it isn't, the constructor initialises it),
> >String.valueOf( keyBuffer ) would be an NPE as well. toString() should
> >not return null and won't for a StringBuffer.
>
> What the...?????
>
> --- cut ----
> import java.io.File;
>
> public class test {
> public static void main(String[] args) throws Exception {
> System.out.println(String.valueOf((Object) null));
> }
> }
> --- cut ----
>
> [EMAIL PROTECTED] tmp]$ javac test.java
> [EMAIL PROTECTED] tmp]$ java -version
> java version "1.5.0_02"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
> Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode, sharing)
> [EMAIL PROTECTED] tmp]$ java test
> Exception in thread "main" java.lang.NullPointerException
> at java.lang.String.<init>(String.java:173)
> at java.lang.String.valueOf(String.java:2591)
> at test.main(test.java:5)
>
Seems to be fixed in the latest Windows JVM:
D:\temp>java -version
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode, sharing)
D:\temp>java test
null
S.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]