Bug 50175 - Add Import... menu item provides inner class options and should not [code manipulaiton]
Summary: Add Import... menu item provides inner class options and should not [code man...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 36896
Blocks:
  Show dependency tree
 
Reported: 2004-01-17 06:48 EST by Bill Dudney CLA
Modified: 2005-05-23 12:27 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Dudney CLA 2004-01-17 06:48:13 EST
When using the Add Import... editor context menu item inner classes are offered as potential 
choices even though they don't make sense in context.

Using Source->Organize Imports works as expected and imports java.util.ArrayList

Here is an example;

1) Add this code to a new class and save
2) Double Click on the unknown type ArrayList and invoke 'Source->Add Import'
3) Notice that both java.uti.ArrayList and java.util.Arrays.ArrayList are presented as choices.

import java.util.List;

/**
 * @author bdudney
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class HelloWorld {

	public static void main(String[] args) {
		List myHellos = new ArrayList();
		HelloProvider hp = new HelloProvider();
		WorldProvider wp = new WorldProvider();
		String hello = hp.getHello();
		String world = wp.getWorld();
		System.out.println(hello + " " + world);
	}
}
Comment 1 Olivier Thomann CLA 2004-01-17 12:54:59 EST
Move to JDT/UI.
Comment 2 Martin Aeschlimann CLA 2004-01-19 04:23:29 EST
Would like to implement that but jdt.core misses the required API. see bug 36896
Comment 3 Andre Weinand CLA 2004-01-20 06:02:43 EST
[Problem not Mac specific. Setting Platform/OS to "All"]
Comment 4 Dirk Baeumer CLA 2005-03-14 06:19:15 EST
Martin, bug 36896 got fixed.
Comment 5 Martin Aeschlimann CLA 2005-05-23 12:27:33 EDT
That has been fixed for M7. Private types are now ignored.