Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Problems with java.util.List assignments using JDK 1.5
Problems with java.util.List assignments using JDK 1.5 [message #215347] Wed, 21 September 2005 04:49 Go to next message
Eclipse UserFriend
For experimental reasons I tried to compile some of our code with a Sun
JDK 1.5 (instead of 1.4.2, that we are using so far). So in Window =>
Preferences => Java => Installed JREs I changed the JRE to use and
recompiled.

Using that (even after doing a full "build clean") the compiler reports
several errors all of which are places where I assign to variables of
type java.util.List.

The error message reads "Type mismatch: cannot convert from List to
List" (sic!) If I hold the compilers hand and change my statement to
something like "foo = (java.util.List)bar;" I get a warning "Unnecessary
cast from List to List". ?!?

If I change back the JRE setting, everything works fine again, if I
change it to JDK 5/1.5 I get these errors again. It's fully
reproducible!

Anybody seen something like this before? Could anybody make sense out of
it and find some explanation (classpath problems, library version or
classfile version conflicts, or whatever)?
How do I get my code compiled under JDK 1.5 without that superfluous
type-cast?

Michael
Re: Problems with java.util.List assignments using JDK 1.5 [message #215359 is a reply to message #215347] Wed, 21 September 2005 06:06 Go to previous messageGo to next message
Eclipse UserFriend
This is an already referenced issue, see bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=107756

It will be adressed in next 3.1 Maintenance Release delivery (aka 3.1.1):
http://www.eclipse.org/eclipse/development/eclipse_maintenan ce_schedule_3_1_x.html

Michael Moser wrote:
> For experimental reasons I tried to compile some of our code with a Sun
> JDK 1.5 (instead of 1.4.2, that we are using so far). So in Window =>
> Preferences => Java => Installed JREs I changed the JRE to use and
> recompiled.
>
> Using that (even after doing a full "build clean") the compiler reports
> several errors all of which are places where I assign to variables of
> type java.util.List.
>
> The error message reads "Type mismatch: cannot convert from List to
> List" (sic!) If I hold the compilers hand and change my statement to
> something like "foo = (java.util.List)bar;" I get a warning "Unnecessary
> cast from List to List". ?!?
>
> If I change back the JRE setting, everything works fine again, if I
> change it to JDK 5/1.5 I get these errors again. It's fully reproducible!
>
> Anybody seen something like this before? Could anybody make sense out of
> it and find some explanation (classpath problems, library version or
> classfile version conflicts, or whatever)?
> How do I get my code compiled under JDK 1.5 without that superfluous
> type-cast?
>
> Michael
>
Re: Problems with java.util.List assignments using JDK 1.5 [message #215367 is a reply to message #215359] Wed, 21 September 2005 07:34 Go to previous message
Eclipse UserFriend
"Frederic Fusier" <frederic_fusier@fr.ibm.com> wrote in message
news:dgrbbh$u6v$1@news.eclipse.org...
> This is an already referenced issue, see bug
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=107756
>
> It will be adressed in next 3.1 Maintenance Release delivery (aka
> 3.1.1):
> http://www.eclipse.org/eclipse/development/eclipse_maintenan ce_schedule_3_1_x.html
>

Thanks - hadn't been aware of that! And help/fix seems to be coming
soon, so no major issue...

Cheers,
Michael
Previous Topic:New To Java
Next Topic:Iterator<E> - Iterator cannot be resolved to a type
Goto Forum:
  


Current Time: Wed Jul 23 10:03:50 EDT 2025

Powered by FUDForum. Page generated in 0.03910 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top