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 128836

Summary: Completion should autoimport in more cases.
Product: java Reporter: Petr Nejedly <pnejedly>
Component: SourceAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Petr Nejedly 2008-02-29 15:00:05 UTC
If I type "Coll", invoke completion and pick, say Collection, completion does automatically generate an import for me.
But if I do similar a line later, with an intent to make my collection immutable, I would usually do following:
1. Type "Co"<Ctrl+K> to get "Collection". Maybe try completion but this time only in-scope types would get displayed (as
Collection is already imported and matches).
2.Type the last letter and dot manually, so I have "Collections.|" and wait/invoke completion (all types are considered
this time as nothing in-scope matches).
3. pick unmodifiableCollection

I would expect that the completion would generate "import java.util.Collections" for me as it had to traverse that
(unknown) type for the match, but only the picked method gets expanded and I have to fix the code later using hints.
Comment 1 Petr Nejedly 2008-02-29 15:01:50 UTC
Moreover, the completion won't work for the expression after this point, until I fix the imports.