null pointer exceptions
Erik Max Francis
max at alcyone.com
Fri Jul 18 02:04:36 EDT 2003
Tennessee James Leeuwenburg wrote:
> Certainly I can catch it. However, Java does not require that it be
> caught
> itself.
>
> I realise it's not great practise to leave these kinds of things in
> your
> Java code, but I'm extending someone else's code, and don't really
> want to
> back-correct class after class as I find these problems coming up,
> especially since it doesn't cause Java any hassles.
So the Java program itself handles the NullPointerException, but when
run from Jython it doesn't? I thought NullPointerExceptions always
propagated all the way up like normal RuntimeExceptions?
Or is it that in Java a NullPointerException is thrown in a side thread,
which dies, but everything else keeps running fine -- and Jython makes a
bigger deal out of the NullPointerException because it chokes on any
exception from any Java subthread?
If it's the latter, then it sounds like the right solution -- mimicking
Java's not-great-but-satisfactory behavior would be to catch the
NullPointerException in Jython and then toss it (since that is, what in
effect, Java is doing).
--
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \ You can buy any kind of love, but you can't buy love deluxe.
\__/ Sade Adu
More information about the Python-list
mailing list