| Summary: | Organize imports adds unused import | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Caspar D. <caspar_d> | ||||
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | jarthana | ||||
| Version: | 4.2 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
PS. The reason I didn't provide a simpler example (i.e. one without the EMF dependency) that reproduces the behavior , is that I was unable to do so. A simple iteration over the map entries in a main() method, *does* require the import. I don't know what it is about my code that makes the import unnecessary, but as stated that's what the compiler reports. Reproduced in 4.3 RC4. Will take a look at in 4.4. 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. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. 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. |
Created attachment 232375 [details] Java code to reproduce the problem See attached Java source code. (Requires EMF to compile.) The 'organize imports' feature will add an import of java.util.Map.Entry in this source file (see line 2), which is unnecessary. The compiler issues a warning about it. (I don't know *why* the import is unnecessary, but that's what the compiler says. And sure enough, when I disable the 'organize imports' feature and remove the import, it compiles okay.)