Generic conversion problem in a project.

I was previously using Jdeveloper, and decided to migrate some code to Eclipse. The code below worked fine in my Jdeveloper(1.5.0_05) project, but upon migrating is an error that states. Cannot create a generic array of LinkedList<PlayerAction>.

private LinkedList<PlayerAction>[] actionList;

actionList =new LinkedList<PlayerAction>[4];

I have attempted to import the version of the JDK I was using in Jdeveloper to Eclipse, but it seems to have no affect on the behavior. I'm either not setting eclipse to this JDK properly. Either the eclipse compiler uses it's own compiler instead of the JDK I select compiler, or I am going insane.

I would prefer not to change the way the code currently works as it worked extremely well before, but any easy suggestions to get around this are welcome.

[902 byte] By [bruceallen612a] at [2007-11-27 11:27:00]
# 1

I'm not sure, why JDeveloper allowed it. Here you can find an explanation on why it is forbidden to create generic arrays:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5105887

stefan.schulza at 2007-7-29 16:13:46 > top of Java-index,Core,Core APIs...
# 2

Seems like Jdevelopper compiler does not respects Java rules...

ibanna at 2007-7-29 16:13:46 > top of Java-index,Core,Core APIs...