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 219878 - better codecompletion with generics
Summary: better codecompletion with generics
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-11 05:41 UTC by akobberup
Modified: 2012-10-11 05:41 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 akobberup 2012-10-11 05:41:08 UTC
This is only an issue in pre. java 7 (no diamond).

If you enter 

List<String> list = new ArrayLis

and hit CTRL+Space, the CC will suggest "ArrayList<String> (java.util)" to complete the type declaration. After this, the CC will ask which constructor you will use.

However, if you type out the full type name like this: 

List<String> list = new ArrayList

and invoke CC, it will suggest the three constructors first, and first as a fourth option it will suggest to complete the type with the generic declaration (adding the "<String>" to the type name).

This means that every time i will declare a variable that has a generic component, i will NOT type the full class name use CC to get the right constructor - i will type almost the full name, and then use CC to get the generic component, and then the right constructor.

My suggestion is to move up the CC suggestion to complete the type declaration (adding "<String>") in the CC dialog so that it is presented before the constructors.