Bug 50175

Summary: Add Import... menu item provides inner class options and should not [code manipulaiton]
Product: [Eclipse Project] JDT Reporter: Bill Dudney <bdudney>
Component: UIAssignee: Martin Aeschlimann <martinae>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M7   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 36896    
Bug Blocks:    

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.