Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jruby can't use it's own java classes #1925

guai opened this issue Aug 27, 2014 · 2 comments

jruby can't use it's own java classes #1925

guai opened this issue Aug 27, 2014 · 2 comments


Copy link

guai commented Aug 27, 2014

jruby 1.7.13

require 'jruby'
JRuby.runtime.defineReadonlyVariable('$var', proxied_java_object, Java::org.jruby.internal.runtime.GlobalVariable::Scope::GLOBAL)

This does not work. JRuby always tries to unwrap proxied_java_object to the core object even when IRubyObject is needed by itself.
It seems ConcreteJavaProxy#toJava should also check this condition:

else if(type.isAssignableFrom(getClass())) {
            return this;
Copy link

Lan5432 commented Mar 28, 2016

Excuse me, but what's "proxied_java_object" supposed to be?

Copy link

guai commented Mar 29, 2016

It's the jruby's proxy object which wraps some java object. proxied_java_object implements IRubyObject.
And It can't be passed to method which expects IRubyObject param, because jruby first tries to unwrap the target java object out of it and pass it as argument.

@kares kares added this to the JRuby milestone Apr 6, 2016
@kares kares self-assigned this Apr 6, 2016
kares added a commit that referenced this issue Apr 6, 2016
@kares kares closed this as completed Apr 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

3 participants