Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 0.9.2
-
Fix Version/s: JRuby 0.9.9
-
Component/s: Java Integration
-
Labels:None
-
Environment:Gentoo Linux/Java 5
Description
Expected behavior (using Ruby classes/modules):
>> Array < Enumerable
=> true
>> Array < Object
=> true
>> Array.new.kind_of? Enumerable
=> true
>> Array.new.kind_of? Object
=> true
Actual behavior when using Java classes/interfaces:
>> include_class('java.lang.Object') { |package, name| "J#{name}" }
>> include_class %w{ArrayList List}.map { |e| "java.util.#{e}" }
>> ArrayList < List
=> nil
>> ArrayList < JObject
=> nil
>> ArrayList.new.kind_of? List
=> false
>> ArrayList.new.kind_of? JObject
=> false
As near as I can tell, there is no workaround to this – it's not possible to do the equivalent of an "instance of" check against Java classes/objects in JRuby...
See also the description for
JRUBY-236.JRUBY-236.