Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JRuby 1.1
-
Component/s: Java Integration
-
Labels:None
-
Number of attachments :
Description
If we have an ruby class "implementing" an Java Interface, when an instance of this class "go" to Java and then returns to JRuby it changes her proxy.
Something like this...
require 'java'
include_class "JavaInterface"
include_class "JRuby"
class RubyClass < JavaInterface
def initialize()
super()
end
end
newRubyClass = RubyClass.new()
puts newRubyClass .kind_of?(JavaInterface) => true
rubyClass = JRuby.pass(newRubyClass )
puts rubyClass.kind_of?(JavaInterface) => false
JRuby is only an Java Class that have an static method with one arg that returns this one arg.
------------------------------------------------------------------------
public class JRuby {
public static Object pass(Object pass)
}
------------------------------------------------------------------------
public interface JavaInterface {
}
Issue Links
- is duplicated by
-
JRUBY-1513
Broken polymorphic method invocation when calling a method on a ruby derivative of a java object referenced by another java object.
-
-
JRUBY-1735
Java Integration wraps to much
-
The same problem when we define an java class implementing an java interface like...
public class SimpleJavaClass implements JavaInterface {
{ return "Client OK!"; }public String get()
}
and we receive an instance of the class in jruby, like...
object = JRuby::getJavaClass()
puts object.kind_of?(SimpleJavaClass) => true
puts object.kind_of?(JavaInterface) => false
where getJavaClass is an java method that returns a new instance of SimpleJavaClass.