Bugs item #1392369, was opened at 2005-12-28 15:58
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=438935&aid=1392369&group_id=44253
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Interactionpane does something better?
Initial Comment:
The following code fails when compiling with java 1.4
and java 1.5.
import java.util.LinkedList;
class A{
public static void main(String[] args)
{
LinkedList l = new LinkedList();
l.add("Corky");
l.add("Stephen");
String[] s = l.toArray(new String[0]);
}
}
The error being:
Error: incompatible types
found : java.lang.Object[]
required: java.lang.String[]
But if you write the same code in the
interactionspane, it works just fine.
The code is supposed to take a list and turn it into
an array. The toArray method returns something of the
type which it is given. I use length of the array to
be 0, so I don't allocate unneccesary space.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=438935&aid=1392369&group_id=44253
|