Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 304111

Summary: Organize imports removes nested classes
Product: [Eclipse Project] JDT Reporter: Andrew Niefer <aniefer>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann, satyam.kandula
Version: 3.6   
Target Milestone: 3.6 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
example project none

Description Andrew Niefer CLA 2010-02-26 16:39:53 EST
Created attachment 160371 [details]
example project

Organize imports will remove an import for a nested class if the parent is being collapsed into a .* import.  This leads to compile errors when the nested class is used without being qualifier with its parent.

See the attached project, organize imports on Test.java will remove the 
import java.util.Map.Entry;


In the project properties, "Number of imports needed for .*" is 3
Comment 1 Andrew Niefer CLA 2010-02-26 16:44:29 EST
This is using  I20100223-0800, I believe this is new because p2 uses organize imports on save so I would have noticed before.
Comment 2 Olivier Thomann CLA 2010-02-26 20:54:49 EST

*** This bug has been marked as a duplicate of bug 303776 ***
Comment 3 Satyam Kandula CLA 2010-03-08 05:16:28 EST
Verified for 3.6M6 using build I20100305-101
Comment 4 Frederic Fusier CLA 2010-03-09 10:01:11 EST
Verified for 3.6M6 using I20100307-2000 build.