fry wrote on Mar 9th, 2007, 5:08pm:yeah, so it's a matter of expectation.. normally if the appletcontext is null, a NPE is thrown inside init() and we can move on. or we're not following something properly about how RuntimeExceptions are passed up (i.e. if they fail at a certain distance).
it appears that the NPE is instead failing inside the jruby code (in the stub.getAppletContext() line b/c stub is null) but that isn't propogating up to p5 as an NPE--it's halting inside jruby.
fyi, since an NPE is a RuntimeException, the getAppletContext() method need not declare it in the 'throws' declaration.
Yup, that's it. I've rebuilt a version of Processing's core package for the JRuby folks along with a test harness. Not sure if they'll get time to look at it. Here's the thread:
http://www.nabble.com/Java-subclasses-in-Ruby-tf3344729.html
Just as a FYI: I'm doing all this with the hopes that one of the "agile" JVM languages will be able to work modestly well with Processing. We've done Rhino, Groovy, Jython and JRuby. I personally find Ruby the most compelling language, but the performance of all of these are quite poor, alas.
One nice side effect is that you can run Processing in an interpreter for quick experiments. I believe all but JRuby, because of the NPE, would support that .. I've done it a few times (trying to figure out how the camera works) but I forget which system it was! I'm sure I can figure it out if its of interest.
So for all the "syntactic salt" of Java, its still so much better in terms of speed and lack of ambiguities, that I'm starting to like it again. I'm tempted to try Antlr or Javacc to build a translator from a Kindler, Gentler Java to standard salty Java.