Import ordering no longer working in 12.1.1?

I want my org.* imports as follows:

Screen Shot 2013-04-23 at 1.31.47 PM.png

But they keep being put at the bottom:

Screen Shot 2013-04-23 at 1.32.38 PM.png

Is this a known issue in 12.1.1 or am I missing something?


Hi Cedric,

I'm afraid I don't understand what result did you expect to get for the given settings and imports.



The org.* imports should be on top of the com.* imports (not shown in the screen shot, sorry if this was unclear) but they are at the bottom of the list and the com.* are above them.


What action do you call - reformat or 'optimize imports'?



Here is a more obvious example.


Screen Shot 2013-04-24 at 8.49.59 AM.png
If I select this block and call "Reformat", nothing happens. If I select "Optimize imports" on this file, I end up with:
Screen Shot 2013-04-24 at 8.49.13 AM.png
And again, here are my settings, which indicate that "org.*" should be on top of "com.*":

Screen Shot 2013-04-24 at 8.45.44 AM.png
Notice also that the "blank lines" are not respected (there should be a blank line between "com" and "org".



     Shouln't those imports read 'com.*' and 'org.*' not 'com.*.*' and 'org.*.*'?

     If you double click those and just change them to 'com' and 'org' IDEA 12 will add the '.*' for you. Give that a shot, it's not massively intuitive.

     I didn't know IDEA could do this. It's allowed me to ape the default Eclipse "reorganize imports" behaviour which causes me contant grief being the only
     IDEA developer among many eclipse ones. Seems to work for me.

- Richard


Good spot, Richard!

Just checked that the sample works fine when the rule is represented like 'com.*' but fails on 'com*.*'



Indeed, Richard, that was the problem! Specifying just "com" and "org" in my import settings fixed it.



Please sign in to leave a comment.