| Summary: | When removing unused import in cleanup, Luna strips all the comments before it as well. | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Alex Pogrebnyak <alex-pub.eclipse> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 4.5 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | stalebug | ||
This issue may be related to to https://bugs.eclipse.org/bugs/show_bug.cgi?id=475282 (Luna QuickFix does not insert first import statement into correct location.) 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. |
If you happen to remove a reference to a foreign package class and it happens to be a first import statement in the java file, it removes all comments in front of it as well. This is really unfortunate as it removes copyright headers. E.g. In Java Cleanup make sure that 'Remove Unused Imports' is checked. Create this class foo/bar/Foo.java package foo.bar /** * Copyright notice */ import java.lang.String public class Foo { } Click save. import statement and copyright notice are gone. This behavior is new to Luna. Previous version used by me (Kepler) worked as expected (remove unused import and left comments intact).