Is it standard behavior for this code to throw a NullPointerException?
- by Eric
I've had a big problem in some library code, which I've pinned down to a single statement:
System.out.println((String) null);
Ok, the code doesn't actually look like that, but it certainly calls println with a null argument. Doing this causes my whole applicaio to throw an unexpected NullPointerException.
In general, should println throw this exception under that circumstance, or is this non-standard behavior due to a poor implementation of the out instance?