Community
Participate
Working Groups
Currently, as document described (http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fpreferences%2Fjava%2Fcodestyle%2Fref-preferences-organize-imports.htm), the organize import feature does only match the prefix of imports, but not the qualified class name. If I want to make some class always be the first import in the file, like the android's "R" class, it is not possible. I hope the organize import feature can handle the exact class and put them to the position I set.
When adding a new entry via New... button, one can already select a type, but that ends up as a package in the list. And later, its order is not honored.
Currently you can specify a qualified type name in your Organize Imports order because a type can be an import container. I.e. if you have "com.foo.Class" in your import order, then Organize Imports should place "import com.foo.Class.Foo;" and "import com.foo.Class.Bar;" in that spot. A question: If you have both "com.foo" and "com.foo.Class" as entries in your import order, should "import com.foo.Class;" match "com.foo" (in which it is contained) or "com.foo.Class" (which it is)? I guess the expected organized imports, given an import order configured like this com.foo.Class java.util com.foo would be import com.foo.Class; import com.foo.Class.*; import com.foo.Class.Foo; import java.util.ArrayList; import com.foo.OtherClass; Note that I am currently rewriting ImportRewriteAnalyzer and I should be able to implement this change there.
(In reply to John Glassmyer from comment #2) > Currently you can specify a qualified type name in your Organize Imports > order because a type can be an import container. I.e. if you have > "com.foo.Class" in your import order, then Organize Imports should place > "import com.foo.Class.Foo;" and "import com.foo.Class.Bar;" in that spot. > > A question: If you have both "com.foo" and "com.foo.Class" as entries in > your import order, should "import com.foo.Class;" match "com.foo" (in which > it is contained) or "com.foo.Class" (which it is)? The latter.
John, can I assign this bug to you?
(In reply to Dani Megert from comment #4) > John, can I assign this bug to you? Sure, please do.
Fixed via bug 430303.