- The short version:
I’m calling RuntimeHelpers.invokeSuper and see an NPE. This is because
the call to context.getFrameKlazz() is returning null. Why???
- The long version:
I’m trying to upgrade from JRuby 1.1.4 to JRuby 1.1.6. I have classes
that subclass RubyArray and RubyHash. In those, I implement
method_missing in Java. If I don’t want to handle the missing method,
I call the super version.
In JRuby 1.1.4, I did this:
RuntimeHelpers.invokeAs(context, klazz.getSuperClass(), self,
“method_missing”, args, CallType.SUPER, block);
in JRuby 1.1.6, I am trying this:
RuntimeHelpers.invokeSuper(context, self, args, block);
but I’m seeing a NullPointerException. It looks like in 1.1.6 the
method RuntimeHelper.findImplementerIfNecessary is returning null. The
line that calls it assumes the return value is not null, thus the NPE:
RubyClass superClass =
findImplementerIfNecessary(self.getMetaClass(),
klazz).getSuperClass();
The second arg klazz is null, because the line before that
RubyModule klazz = context.getFrameKlazz();
returns null. In other words, context.getFrameKlazz() is null, which
means findImplementerIfNecessary returns null, which causes the NPE.
What am I doing wrong?
Jim
Jim M., [email protected], [email protected]
http://www.io.com/~jimm/
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email