| Summary: | Luna QuickFix does not insert first import statement into correct location. | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Alex Pogrebnyak <alex-pub.eclipse> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | Manoj N Palat <manoj.palat> |
| Severity: | normal | ||
| Priority: | P3 | CC: | jarthana, manoj.palat |
| Version: | 4.5 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | stalebug | ||
I can see the bug in Mars M2 as well. 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. |
Create this class foo/bar/Foo.java =============== package foo.bar /** * Copyright notice */ import java.util.List; public class Foo { List list; } =============== Save file. Now add reference to java.util.Calendar =============== package foo.bar /** * Copyright notice */ import java.util.List; public class Foo { Calendar calendar; List list; } =============== Eclipse correctly highlights error on a new line. Now QuickFix the calendar reference by accepting 'Import Calendar (java.util)'. BUG -> new import statement appears before Copyright notice. =============== package foo.bar import java.util.Calendar; /** * Copyright notice */ import java.util.List; public class Foo { Calendar calendar; List list; } ============= This behavior is new to Luna. Previously used Eclipse version (Kepler), inserted new import line right before 'import java.util.List;' statement. BTW, I do understand that it is not easy to find a correct place for the Only and First import statement, and for this, appending it after 'package' statement is as good default as any other. However, when there are already existing imports in the file, QuickFix should pay attention to where they start. This may be linked to issue with Cleanup eagerly removing first import statement -> https://bugs.eclipse.org/bugs/show_bug.cgi?id=475281