logo       

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

lang.jruby.user

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

I believe there's a syntax something like this, but I haven't tried to
use it before this and it doesn't seem completely stable. Tom?

include_class "java.lang.String"

x = String[].new(5)

After this, x.length returns 5, but I wasn't able to figure out how to
put stuff into the array. Also, x.methods blew up with a
SystemStackError.

- Charlie

On 2/13/06, Werner Schuster (murphee) <werner.schuster@xxxxxxxxx> wrote:
> howdy,
>
> I'm messing with JMX and I'm trying to call
>
> Object invoke(Objectame, String opName, Object[] args, String[] signature)
>
> Problem: is there a way to create an empty String[] with JRuby?
>
> 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. I think this is the case, because after the include_class, I keep
> on getting the error message
> "No method '<<' on Array"
>
> 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
> _______________________________________________
> Jruby-user mailing list
> Jruby-user@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/jruby-user
>


--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com


-------------------------------------------------------
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&kid3432&bid#0486&dat1642


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

News | FAQ | advertise