Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.6
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Java Integration
-
Labels:None
-
Environment:Mac OSX, Windows 7, Ruby 1.8 and 1.9 mode
-
Number of attachments :
Description
I cannot seem to turn Ruby arrays to Java arrays with to_java. It does not appear to recognize the class:
irb(main):002:0> require 'java'
=> true
irb(main):003:0> [1, 2].to_java
=> #<#<Class:0x1ae3e881>:0x68b57af1>
irb(main):004:0> [1, 2].to_java.class
=> #<Class:0x1ae3e881>
This is not the same output as on the wiki (https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby):
[1,2,3].to_java
=> [Ljava.lang.Object;@1a32ea4
I've tried this on 1.6.5.1, 1.6.6, 1.6.7, on windows and mac and it all looks the same...
Master has better output for this. It's just a matter of #inspect returning a rather ugly version on 1.6.x. to_s looks like what's on the wiki...perhaps you can update the wiki?