gwt, list.toArray()

213 views
Skip to first unread message

DMoL

unread,
Nov 24, 2006, 4:56:45 AM11/24/06
to Google Web Toolkit
When I am trying to open module, it displays the error:

The method toArray() in the type List is not applicable for the
arguments (ITreeModelListener[])

I tryed to extend ITreeModelListener with IsSerializable, there were no
difference.

I am not using RPC!

Here is my code:

public abstract class AbstractTreeModel implements ITreeModel
{
private final List modelListeners = new ArrayList();
...

protected ITreeModelListener[] getListeners() {
ITreeModelListener[] result = new
ITreeModelListener[modelListeners.size()];
result = (ITreeModelListener[])modelListeners.toArray(result);
return result;
}

}...

What can I do? Thanks for any help.

Luc Claes

unread,
Nov 24, 2006, 10:18:07 AM11/24/06
to Google Web Toolkit
GWT doesn't implement the List.toArray(Object[] a) method.
You will have to use List.toArray().

Luciano Broussal

unread,
Nov 24, 2006, 5:40:00 PM11/24/06
to Google Web Toolkit
Hi,

Yep it would be nice to have this method stuff :)

mP

unread,
Nov 24, 2006, 8:27:42 PM11/24/06
to Google Web Toolkit
toArray( Object[] ) wont happen until reflection is supported. This is
necessary because the method needs to create a new array if the given
array is not large enuff to include all the elements from the list.

Reply all
Reply to author
Forward
0 new messages