Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
undefined method `__ruby_object' for interface implementation #1184
I could use some help in figuring this out. Any help is greatly appreciated.
When unregistering a previously registered LocationListener we get the exception listed below. The code for the application is in the Ruboto GPS tutorial: https://github.com/ruboto/ruboto/wiki/Tutorial%3A-get-current-gps-position
I am not sure wether this is a regression or not. The example was originally written a long time ago, and I think it worked fine then :)
Comment by @donv:
Calls to hasCode, equals, and __ruby_object are being forwarded to the Ruby class, while I think they should be handled by the proxy.
Comment by @headius:
Ok...looks like the logic involved with defining __ruby_object does so to have a reference to the real "self" that goes with a proxy type, and the call that fails is coming from JavaUtils.trySimpleConversions attempting to call that method.
Comment by @donv
Thanks for looking into this.
referenced this issue
Nov 18, 2013
I think I have found the problem, and I have at least one part of the solution. In org.jruby.javasupport.Java lines starting at 1207 "==" is used to test for methodName. Changing this to ".equals" fixes the immediate problem.
I addition to this, I think the "WTF" is right. We should call toString, hashCode and equals on the Ruby object, not the class. I can change it if you agree.