Cloning an array?

91 views
Skip to first unread message

Adrian Blakey

unread,
Jul 14, 2011, 11:52:44 PM7/14/11
to google-we...@googlegroups.com
What do I have to do to get gwtc to translate something like: String[] foo = (String[])bar.clone();?

gwtc ouputs: [ERROR] Line nn: Cannot invoke clone() on the array type String[]

I understand that clone is implemented by the java compiler for all arrays and there isn't a method on a java class that can be emulated. I tried a couple of things to get this to work by emulation but gwtc barfs with other errors.

Is the only work around to change the code to System.arraycopy and then supply a js emulation for arraycopy?

Adrian Blakey
adrian...@gmail.com
skype: adrianblakey

Thomas Broyer

unread,
Jul 15, 2011, 4:47:49 AM7/15/11
to google-we...@googlegroups.com
System.arraycopy *is* emulated.
Reply all
Reply to author
Forward
0 new messages