I always thought String.valueOf(null) returned "null".
Was I on crack?
-Matt
P.S. Good to see you committing, Martijn...
--- j...@apache.org wrote:
> Author: jkf
> Date: Sat Jan 31 17:10:50 2009
> New Revision: 739577
>
> URL:
> http://svn.apache.org/viewvc?rev=739577&view=rev
> Log:
> Origi
Doubted it, checked it and it returned NullPointerException.
D:\>type Test.java
public class Test
{
public static void main(String[] args)
{
System.out.println(String.valueOf(null));
}
}
D:\>java Test
Exception in thread "main" java.lang.NullPointerException
at java.lang.String.(Unknown S
st
> Betreff: Re: svn commit: r739577 -
> /ant/core/trunk/src/main/org/apache/tools/ant/property/NullReturn.java
>
> Doubted it, checked it and it returned NullPointerException.
>
> D:\>type Test.java
> public class Test
> {
> public static void main(String[] args)
>
of course, simply returning "null" is much easier ;)
>
>
>
> Jan
>
>
>
> > -Ursprüngliche Nachricht-----
> > Von: Martijn Kruithof [mailto:j...@kruithof.xs4all.nl]
> > Gesendet: Samstag, 31. Januar 2009 22:14
> > An: Ant Developers List
>
4: NPE
> > Java 1.6.0_02-b05: NPE
> >
> > If I add a cast then it works
> >System.out.println(String.valueOf( (Object)null
> ));
> >
> > So the compiler must bind that to another method
> than
> > String.valueOf(Object) ...
> >
> >
> >
What JDK/JRE is that? The Sun Java6 API doc still
says it should return "null". Whatta bitch.
-Matt
--- Martijn Kruithof wrote:
> Doubted it, checked it and it returned
> NullPointerException.
>
> D:\>type Test.java
> public class Test
> {
> public static void main(String[] args)
> {
> Syste