| Summary: | [quick fix] Unnecessary imports being added for member types | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Raksha Vasisht <raksha.vasisht> |
| Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | markus.kell.r, Olivier_Thomann, srikanth_sankaran |
| Version: | 3.7 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | stalebug | ||
Moving to Core..Seems like a problem in org.eclipse.jdt.core.dom.rewrite.ImportRewrite.findInImports(String, String, int) The secondary type(s) are not recognised as known in the context, hence unnecessary imports are added. These are member types, not secondary types. Secondary types are top level types that are defined as non public types into a compilation unit with another public type. I'll investigate. Organize import properly removes these unused imports. (In reply to comment #2) > These are member types, not secondary types. Secondary types are top level > types that are defined as non public types into a compilation unit with another > public type. Oops, sorry I meant to write member types! Also happens without diamond if you use "new X<CI>()" with
class CI extends C implements I { }
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
BETA_JAVA7 public class test2 { class C {} interface I {} public class X<T extends C & I> { X() {} X f = new X<>(); } } ctrl +1 on X -> 'Change type to 'X<? extends C>' and 'Add type arguments to X' add unnecessary imports. I'll take a look.