views:

23

answers:

0

There's a ten-year-old Java applet I've recently been asked to fix some bugs in, and one of those only occurs when running under Microsoft's old JVM rather than Sun's. (Or, at least, it doesn't occur under any recent Sun JRE - I haven't dug out Sun Java 1.1 to try and check.)

Yes, I'm aware that Microsoft's JVM is end-of-life, and I've already suggested that we just tell the users to upgrade to Sun's JRE - that's not my call.

Basically, what happens is that sometimes but not always when we're calling java.awt.Graphics.setClip, we get the following exception:

java.lang.NullPointerException
at com/ms/awt/GraphicsX.clearClip
at com/ms/awt/GraphicsX.setClip
at [our code]

Unfortunately, my efforts at googling haven't turned up any indications as to what could cause a NullPointerException to be thrown in those functions, but before I started spending hours trying to track down what's different between the times the call works and the times it doesn't, I figured I would ask on here and see if anyone had encountered this before and knew what might cause it.