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 182410 - Autocompletion for Generics
Summary: Autocompletion for Generics
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-20 01:26 UTC by aberryjr
Modified: 2010-03-25 09:46 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 aberryjr 2010-03-20 01:26:13 UTC
In the new release it would be a nice feature to auto-complete generics. 

Example.

 Map<Integer, String> errors = new HashMap<Integer, String>();

If you were to enter Map it would dropdown and give you options for the type. Then if you were to say select <Interger, String> when you type HashMap it would up date it with the type.

I don't know if this is doable or if this is the correct implementation.
Comment 1 Vitezslav Stejskal 2010-03-24 13:48:15 UTC
I'm not sure if I understand. What exactly do you mean? What types should CC offer? Ok, the best would be to write an example with the pipe (|) indicating the caret position at which you invoke CC. Then describe what you expect CC to offer.

Also, note that in jdk7 it should be possible to write simply:
Map<Integer, String> = new HashMap<>();

That should make life much easier and depending on what you are asking for it may render this request obsolete.
Comment 2 aberryjr 2010-03-25 09:46:13 UTC
Hello,

I don't know how to implement my idea. But we have autocomplete for most items in netbeans. So what I was looking for is some type of autocomplete for generics

In my example "Map<Integer, String> errors = new HashMap<Integer, String>();" you would enter Map<Integer, String> errors = new Hashmap<"at this point autocomplete would kick in"> this would complete  the statement for you. Currently if you don't specify -Xlint:unchecked then you can get raw type errors so it would seem that we already know what needs to have generics so let's SUGGEST to the user that  he uses these and with any of the autocompletes it is the users choice. 

If there is some new feature in the upcoming release that assists in this great.

Thanks very much,

Alex.