Bug 20424 - Autocompletion "Iterate through Collection" should add "import java.util.Iterator"
Summary: Autocompletion "Iterate through Collection" should add "import java.util.Iter...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Claude Knaus CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
: 10812 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-06-17 05:48 EDT by Andreas Krüger CLA
Modified: 2002-09-09 03:53 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Krüger CLA 2002-06-17 05:48:32 EDT
I use autocompletion to generate an iteration through a collection.  So this is
the kind of code I'm getting:

   for (Iterator iter = myCollection.iterator(); iter.hasNext();) {
      type element = (type) iter.next();

However, autocompletion leaves my .java file without the neccessary

   import java.util.Iterator;

required for all of this to make sense.

I feel it's not as "auto" and not as "complete" as it could be (if you pardon
the pun).
Comment 1 Dirk Baeumer CLA 2002-06-17 11:42:39 EDT
Known limitation. We have to live with it for 2.0
Comment 2 Dirk Baeumer CLA 2002-07-31 09:53:18 EDT
Since we try to be smart regarding imports in JDT we should investigate if we 
can add an import in this case as well. Claude the is a special edit to 
organize imports. May be you only need to add that edit to the text buffer.

Please investigate
Comment 3 Claude Knaus CLA 2002-08-05 08:11:03 EDT
fixed >= 20020805
Comment 4 Claude Knaus CLA 2002-09-09 03:53:47 EDT
*** Bug 10812 has been marked as a duplicate of this bug. ***