Skip to content

NullPointerException on calling java_* methods on java interface impl in Ruby #709

Closed
byteit101 opened this Issue May 6, 2013 · 2 comments

2 participants

@byteit101
JRuby Team member
class BugTester
 include Java::JavaLang::Runnable
  def run
  end
end
bt =  BugTester.new
p bt
p bt.java_kind_of? Java::java.util.Map

Running it:

$ ruby bug-test.rb
#<BugTester:0x4a16841c>
JavaInterfaceTemplate.java:191:in `call': java.lang.NullPointerException
from CachingCallSite.java:306:in `cacheAndCall'
from CachingCallSite.java:136:in `call'
from CallNoArgNode.java:64:in `interpret'
from CallOneArgNode.java:57:in `interpret'
from ReturnNode.java:92:in `interpret'
from NewlineNode.java:105:in `interpret'
from BlockNode.java:71:in `interpret'
from ASTInterpreter.java:75:in `INTERPRET_METHOD'
from InterpretedMethod.java:182:in `call'
from DefaultMethod.java:188:in `call'
from CachingCallSite.java:326:in `cacheAndCall'
from CachingCallSite.java:170:in `call'
from bug-test.rb:11:in `__file__'
from bug-test.rb:-1:in `load'
from Ruby.java:815:in `runScript'
from Ruby.java:808:in `runScript'
from Ruby.java:679:in `runNormally'
from Ruby.java:528:in `runFromMain'
from Main.java:390:in `doRunFromMain'
from Main.java:279:in `internalRun'
from Main.java:221:in `run'
from Main.java:201:in `main'
@byteit101
JRuby Team member

Also crashes on .java_class calls

@headius
JRuby Team member
headius commented May 7, 2013

It's the .java_class call that's actually broken; kind_of? calls java_kind_of? which calls java_class.

Looking into it.

@headius headius closed this in bc92e76 May 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.