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 - Completion should autoimport in more cases.
Summary: Completion should autoimport in more cases.
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Dusan Balek
Depends on:
Reported: 2008-02-29 15:00 UTC by Petr Nejedly
Modified: 2008-02-29 15:04 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
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.