Summary: | Organize Imports removes nested class import used in generic of top level class | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Jan Bernitt <jan.bernitt> |
Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> |
Status: | VERIFIED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | srikanth_sankaran |
Version: | 3.7 | ||
Target Milestone: | 3.6 M6 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: |
Description
Jan Bernitt
2010-08-09 14:51:28 EDT
Can you please include more detailed examples showing how the code looks before and after the organize import operation ? Thanks. Before: import some.package.TopLevelType.InnerType; class TopLevelType implements SomeInterfaceType<InnerType> { static class InnerType { ... } ... } After: Same but without the import statement. This is necessary since I use the inner type already as generic type argument. I also have to say that there is another issue with inner types and organize imports that might be connected to this one: If you use for example the InnerType from the example above in another type (file) and you don't want to refer to it through TopLevelType.InnerType you'll have to do the import on your own (no automatic import by auto-complete as normal). If than organize imports is performed this import is removed sometimes. I think this happens when the InnerType is contained in a file that is in the same package as the file where I want to use it again. Us lazy folks prefer a self contained piece of code that could be pasted into package explorer as it is, such as: // -------------------------------8<----------------------------- package some.pakage; import some.pakage.TopLevelType.InnerType; class TopLevelType implements SomeInterfaceType<InnerType> { static class InnerType { } } interface SomeInterfaceType<T> {} // -------------------------------8<----------------------------- This problem does not show up on HEAD (3.7 stream). I'll dig up the duplicate number shortly. Most likely a duplicate of bug 294057 which got fixed in 3.6 M6. Jan, are you in a position to check against 3.6 ? Can I also request you to test the "another issue with inner types" that you refer to against 3.6 and report if it persists ? Thanks in advance. (In reply to comment #4) > Most likely a duplicate of bug 294057 which > got fixed in 3.6 M6. > > Jan, are you in a position to check against 3.6 ? I have verified that this is a duplicate of bug 294057 by checking that this problem shows up on 3.6 M5 and does not show up on 3.6 M6. Closing as duplicate of bug 294057 Jan, for the other issues you refer to, please check if they exist on 3.6 and if they do, raise separate defects with suitable test cases, TIA. *** This bug has been marked as a duplicate of bug 294057 *** Verified for 3.6.1 |