Bug ID: JDK-4214789 Extend import to allow renaming of imported type
source link: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4214789
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
JDK-4214789 Extend import to allow renaming of imported type
- Type: Enhancement
- Component: specification
- Sub-Component: language
- Affected Version: 1.2.0,1.3.0,1.4.1,1.4.2
- Priority: P5
- Status: Closed
- Resolution: Duplicate
- OS: generic,linux,windows_2000
- CPU: generic,x86
- Submitted: 1999-02-25
Updated: 2006-11-21
Resolved: 2006-11-21
Duplicate :
|
Name: igT44549 Date: 02/24/99 If a compilation unit needs to import two types residing in different packages but with the same name, then each reference to at least one of the types must be fully qualified. To prevent client developers from having to fully qualify names, library developers should make each importable type name unique, defeating one of the goals of the package mechanism. A compile-time mechanism to allow renaming of modules on import would prevent this. For example: import java.util.Date; import java.sql.Date as SQLDate; The ability to rename on import would not obfuscate source code, since a reader needs to review the module import declarations anyway to know the origin of the types being used. It would simplify code that uses different types with the same name. This enhancement should require only minimal changes to the compiler and to javadoc. (Review ID: 48501) ======================================================================
|
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK