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

Bug 313822

Summary: [organize imports] 3.6 organize imports order differs to 3.5 with inner classes
Product: [Eclipse Project] JDT Reporter: Chris West (Faux) <eclipse>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, markus.kell.r, Olivier_Thomann
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Project showing problem none

Description Chris West (Faux) CLA 2010-05-20 18:13:22 EDT
Build Identifier: N20100519-2000 and M20100211-1343

If you import an inner class, like:

package one; public class A { public static class Inner { } }

from another package, like:
package two;

import one.A;
import one.A.Inner;
import one.B;

class Consumer {{ Inner p; A a; B j; }}


3.6 will sort it as above, with the Inner interspersed between A and B.
3.5 will sort it as below, with the Inner after all the other items in "one":


import one.A;
import one.B;
import one.A.Inner;


This causes Organise Imports on two different versions of Eclipse to "fight" -> commit noise etc.  If this is an intentional change then it should probably be documented somewhere obvious?


Reproducible: Always

Steps to Reproduce:
1. Open attached project, which appears to be called Stab, in 3.5.
2. Organise imports in Consumer.  It'll change the ordering.  Save.
3. Open saved project in 3.6.
4. Organise imports again.
Comment 1 Chris West (Faux) CLA 2010-05-20 18:13:59 EDT
Created attachment 169430 [details]
Project showing problem
Comment 2 Dani Megert CLA 2010-05-21 05:55:22 EDT
We fixed the wrong ordering of imports (see bug 194358) and adding a preference to keep the broken behavior would be overkill for imports, given that the changes are nicely collected in a single node in the Java compare editor. Who looks at imports anyway these days? ;-)