- This topic has 3 replies, 2 voices, and was last updated 17 years, 3 months ago by Riyad Kalla.
-
AuthorPosts
-
wciesielMemberHi all,
after moving to MyEclipse 6.0 from some 5.x version such piece of code started to be reported as Fatal Error:
final List<Class<? extends OwlThingBean>> asList = Arrays.asList( // PersonalNameBean.class, // EventBean.class, // ... PersonBean.class, // RelationshipBean.class, OwlThingBean.class);
The error is:
Type mismatch: cannot convert from List<Class<?>> to List<Class<? extends OwlThingBean>>All elements in the collection being converted (but the last one) have OwlThingBean either directly above in type hierarchy or at least one step above. The problem is being caused by the last element – OwlThingBean itself. It apparently cannot be matched with <? extends OwlThingBean (itself)>… The strange thing is that:
-
it compiles with JDK 1.5.0_05 (the same as is set within Eclipse workspace as the only and default JRE)
it was NOT causing any errors in prior versions of MyEclipse (i THINK that it worked even in the MyEclipse 6.0 M1. It started with switch to MyEclipse 6.0 GA.What is going on? Did I break the API of Generics (then why is it compiling from the command line or maven build process??)? Is there some internal compiler within Eclipse/MyEclipse that is having a bug?
I would REALLY appreciate any assistance.
Riyad KallaMemberI would open up your project properties, and under Java Compiler, make sure that it’s still set to compile Java 5 or 6 byte code. Then for the Java Build Path, make sure the JRE on your build path is Java 1.5 or later… just to make sure.
wciesielMemberUnfortunatelly yes, those things are OK (compiler set to default 5.0 complianace and JDK 1..5.0_05 is the only one on the classpath… I’ve installed a full-stack myeclipse package…
Riyad KallaMemberSounds flaky… all that should work then, we don’t instrument the compiler in any way.
Try and restart using the -clean command line argument as outlined here:
https://www.genuitec.com/forums/topic/troubleshoot-using-the-clean-command-line-argument/then after restarting, try and Project > Clean your project… I wonder if the errors are just incorrect.
NOTE: Are they *errors* or just warnings? Have you customized the project or workspace compiler settings at all? (possibly marking settings more aggressive that would mark things like this like an error)
Also I wasn’t clear from the first message… are we discussing compiler errors or runtime errors?
-
AuthorPosts