arrays of generic types  
Author Message
Peter Ashford





PostPosted: 2004-10-3 19:29:00 Top

java-programmer, arrays of generic types Eclipse tells me that arrays of generic types are not legal, e.g.: it
won't allow the following:

QuadTree<MyNodeType> [] allQuadTrees;

Anyone know why this is the case?
 
Tor Iver Wilhelmsen





PostPosted: 2004-10-3 22:53:00 Top

java-programmer >> arrays of generic types Peter Ashford <email***@***.com> writes:

> Eclipse tells me that arrays of generic types are not legal, e.g.: it
> won't allow the following:
>
> QuadTree<MyNodeType> [] allQuadTrees;

Do you use a version of Eclipse that supports JDK 1.5/5.0?

From http://www.eclipse.org/jdt/index.html:

"J2SE 1.5 support was *not* officially scheduled for Eclipse 3.0
release, since J2SE 1.5 was not finalized before 3.0 release date,
and we did not want to jeopardize the 3.0 release by integrating
beta quality tooling. In parallel to the 3.0 effort, we were still
implementing an experimental version of JDT Core with 1.5 support
(mostly focusing on adding generics support to Eclipse Java
compiler). You may find details and previews of our ongoing effort
(codename "Cheetah") in our update area."

However, it seems this "experimental" support has been improved in
3.0.1 which is the latest public release.
 
IchBin





PostPosted: 2004-10-4 9:35:00 Top

java-programmer >> arrays of generic types Peter Ashford wrote:
> Eclipse tells me that arrays of generic types are not legal, e.g.: it
> won't allow the following:
>
> QuadTree<MyNodeType> [] allQuadTrees;
>
> Anyone know why this is the case?
Depends on what version of eclipse you are running. Also they do not
have full JDK 1.5 support yet.

Better to Post to Eclipse newsgroup: news.eclipse.org's eclipse.platform

--


Thanks in Advance...
IchBin
__________________________________________________________________________

'Laughter is inner jogging'
- Norman Cousins, editor and author (1915-1990)
 
 
Peter Ashford





PostPosted: 2004-10-6 17:07:00 Top

java-programmer >> arrays of generic types Tor Iver Wilhelmsen wrote:
> Peter Ashford <email***@***.com> writes:
>
>
>>Eclipse tells me that arrays of generic types are not legal, e.g.: it
>>won't allow the following:
>>
>>QuadTree<MyNodeType> [] allQuadTrees;
>
>
> Do you use a version of Eclipse that supports JDK 1.5/5.0?
>
> From http://www.eclipse.org/jdt/index.html:
>
> "J2SE 1.5 support was *not* officially scheduled for Eclipse 3.0
> release, since J2SE 1.5 was not finalized before 3.0 release date,
> and we did not want to jeopardize the 3.0 release by integrating
> beta quality tooling. In parallel to the 3.0 effort, we were still
> implementing an experimental version of JDT Core with 1.5 support
> (mostly focusing on adding generics support to Eclipse Java
> compiler). You may find details and previews of our ongoing effort
> (codename "Cheetah") in our update area."
>
> However, it seems this "experimental" support has been improved in
> 3.0.1 which is the latest public release.

I'm using the cheetah plugin which provides generics support. Eclipse
is not complaining about the use of generics - my code is littered with
it - it is complaing just about arrays of generic types.