This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 145208 - [65cat] Code completion/imports
Summary: [65cat] Code completion/imports
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: Other Linux
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-26 20:07 UTC by Unknown
Modified: 2013-09-02 14:21 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Unknown 2008-08-26 20:07:53 UTC
[ BUILD # : 200808260201 ]
[ JDK VERSION : 1.6.0_07 ]

Product Version: NetBeans IDE Dev (Build 200808260201)
Java: 1.6.0_07; Java HotSpot(TM) 64-Bit Server VM 10.0-b23
System: Linux version 2.6.26-1.slh.3-sidux-amd64 running on amd64; 
UTF-8; en_US (nb)
Userdir: /home/sasbeb/.netbeans/dev

Since Java doesn't allow covariant return types, when I 
overload/override a method, the code completion/automatic imports 
should pick the right class to import.

That is if I have class A such that:

class A extends JComponent {

   public Dimension getPrefferredSize() {
      return new Dimension(5, 4);
   }
}

and there are Dimension classes in packages like:
java.awt.Dimension
foo.bar.bar.Dimension
bar.Dimension
bar.bar.bar.Dimension

The only valid import is java.awt.Dimension since that is the only
valid class that can return from getPreferredSize
Comment 1 Jiri Prox 2008-08-27 08:17:56 UTC
This is good idea, but IMHO it's rather enhancement than a bug