Problems with java.util.List assignments using JDK 1.5 [message #215347] |
Wed, 21 September 2005 04:49  |
Eclipse User |
|
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03910 seconds