| Summary: | [organize import] Adding a type results in adding a package and later does not honor order | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | JasonMing <JasonMing> |
| Component: | UI | Assignee: | John Glassmyer <eclipse> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, eclipse.sprigogin, eclipse, markus.kell.r |
| Version: | 4.4 | ||
| Target Milestone: | 4.5 M6 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 430303 | ||
|
Description
JasonMing
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. |