logo       

Re: java.lang.reflect.Array considered harmful?: msg#00027

lang.jruby.user

Subject: Re: java.lang.reflect.Array considered harmful?

Damian Steer wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Werner Schuster (murphee) wrote:

I've been messing with java.lang.reflect.Array and its newInstance
method, but that doesn work because include_class-ing it will mess up
JRuby, because it seems like java.lang.reflect.Array replaces JRuby's
Array.
Did you try including it as JArray rather than Array? Try:
include_class "java.lang.reflect.Array" { |p,name| "J" + name } [1]
[1] http://jruby.sourceforge.net/docs/java-highlevel.shtml


Thanks, that seems like a good solution (Hmm... how did I miss that in the docs... odd).

However: when I execute the sample

include_class "java.lang.reflect.Array" { |p,name| "J" + name }

I get: "syntax error".
Are the docs out of date or am I doing something wrong? Does this still work?
(I'm using the stock 0.8.2 version).

murphee
--
Blog @ http://jroller.com/page/murphee





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise