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.
If I select this block and call "Reformat", nothing happens. If I select "Optimize imports" on this file, I end up with: And again, here are my settings, which indicate that "org.*" should be on top of "com.*":
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.
Hi Cedric,
I'm afraid I don't understand what result did you expect to get for the given settings and imports.
Denis
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'?
Denis
Here is a more obvious example.



Before:
If I select this block and call "Reformat", nothing happens. If I select "Optimize imports" on this file, I end up with:
And again, here are my settings, which indicate that "org.*" should be on top of "com.*":
Notice also that the "blank lines" are not respected (there should be a blank line between "com" and "org".
Cedric,
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
Why don't you use this plugin http://plugins.jetbrains.com/plugin/?idea&pluginId=6546 ?
Good spot, Richard!
Just checked that the sample works fine when the rule is represented like 'com.*' but fails on 'com*.*'
Denis
Indeed, Richard, that was the problem! Specifying just "com" and "org" in my import settings fixed it.
Thanks!