Bug 332879

Summary: Organize Imports deletes nearby comments
Product: [Eclipse Project] JDT Reporter: Sam Washburn <samw3office>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, samw3office, satyam.kandula
Version: 3.7   
Target Milestone: 3.8 M2   
Hardware: All   
OS: All   
Whiteboard:

Description Sam Washburn CLA 2010-12-18 00:00:33 EST
Build Identifier: M20100211-1343

If I have the following at the top of a file:

import java.io.File; // This is a comment

then go to Source->Organize Imports, the comment disappears.

import java.io.File;

It also happens if the comment is on a nearby line and also if I press the menu shortcut key.

I can't find any workaround without just not organizing imports, but I'm so used to pressing ctrl-shift-o all the time, I'm constantly deleting important stuff at the top of my clients' files.

Reproducible: Always

Steps to Reproduce:
1. Add line: import java.io.File; // This is a comment
2. Choose menu option: Source->Organize Imports
3. Watch the comment disappear :)
Comment 1 Dani Megert CLA 2010-12-20 04:18:12 EST

*** This bug has been marked as a duplicate of bug 24804 ***
Comment 2 Satyam Kandula CLA 2011-09-13 05:27:39 EDT
Verified for 3.8M2 using build I20110912-0800