Community
Participate
Working Groups
Build ID: M20071023-1652 Steps To Reproduce: java.sql.Date d = new java.util.Date(); Eclipse says: 'cannot convert from Date to Date' which doesn't make any sense. Javac says: 'incompatible types; found: java.util.Date; required: java.sql.Date' which makes much more sense. The same applies to other classes with the same name, e.g. java.sql.ResultSet and com.mysql.jdbc.ResultSet. Please make the compilation error more descriptive by using full qualified class names.
I would say we should use fully qualified name only when the simple names are identical. This would keep the messages shorter in most cases.
Also good. That's always better than nothing.
Created attachment 108255 [details] Proposed fix Probably need to update some regression tests.
Released for 3.5M1. Added regression test org.eclipse.jdt.core.tests.compiler.regression.AssignmentTest#test61
Great, thank you.
No problem. You can check next integration build to see if this is what you expected.
Verified for 3.5M1 using I20080805-1307
I believe there are other problem scenarii where names should be disambiguated (other flavors of incompatible types) as well.
*** Bug 192856 has been marked as a duplicate of this bug. ***
e.g. public class X { class Member {} void foo() { new p.X().new Member(); } }
e.g. public class X extends Throwable { public void foo() throws p.X {} }
e.g. public class X extends Throwable { void foo() throws X { throw new p.X(); } }
Also senders of ProblemReporter methods: incompatibleExceptionInThrowsClause(...) incompatibleReturnType(...) invalidEnclosingType(...) javadoc counterparts unsafeCast(...) unsafeTypeConversion(...) etc.
Ok, I'll take a look.