[ nice-Bugs-1510071 ] [] list syntax can give ClassCastExceptions

"SourceForge.net" <[email protected]> Wed, 21 Jun 2006 09:00:37 -0700
Newsgroups gmane.comp.lang.nice.devel
Message-ID <[email protected]>
Bugs item #1510071, was opened at 2006-06-21 16:00
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1510071&group_id=12788

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: B S (ben77)
Assigned to: Nobody/Anonymous (nobody)
Summary: [] list syntax can give ClassCastExceptions

Initial Comment:
This line of code compiles and gives a
ClassCastException at runtime.

LinkedList<String> list = [ "1","2"];

Exception in thread "main"
java.lang.ClassCastException: nice.lang.rawObjectArray

It should either turn the rawObjectArray into a
LinkedList via new LinkedList(Collection), make it as a
LinkedList to begin with, or give a compile time error.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1510071&group_id=12788