Bug 5809 - Duplicate class names in separate package imports cause compile error
Summary: Duplicate class names in separate package imports cause compile error
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-12 14:36 EST by John R. Hicks CLA
Modified: 2002-03-01 04:33 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John R. Hicks CLA 2001-11-12 14:36:14 EST
importing two classes with the same name, but in different packages causes a 
compilation error stating that the classes are ambiguous.  As long as fully 
qualified pathnames are being used when variables are declared, this should not 
be an error.  Sample code follows:

...
import java.sql.Date;
import java.util.Date;
...
java.util.Date date = new java.util.Date(...);
...
java.sql.Date sqlDate = rs.getDate(1);
...
Comment 1 Philipe Mulet CLA 2001-11-13 16:52:43 EST
The error should be reduced to a warning, and we should ignore conflicting imports from there on.
Comment 2 David Audel CLA 2002-01-11 11:48:18 EST
Fixed
Comment 3 Philipe Mulet CLA 2002-01-11 12:52:59 EST
Taking the fix off, actually we have to complain.
I don't understand why I got convinced the other way around, but our old 
behavior was the right one. Note: I don't see us complaining about an 
ambiguity, just collision in import.
Comment 4 Philipe Mulet CLA 2002-02-26 05:47:22 EST
Closing, we do behave like javac.