Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313822 - [organize imports] 3.6 organize imports order differs to 3.5 with inner classes
Summary: [organize imports] 3.6 organize imports order differs to 3.5 with inner classes
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-20 18:13 EDT by Chris West (Faux) CLA
Modified: 2010-05-21 08:59 EDT (History)
3 users (show)

See Also:


Attachments
Project showing problem (4.15 KB, application/x-zip-compressed)
2010-05-20 18:13 EDT, Chris West (Faux) CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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? ;-)