Bug 34823 - Organize imports removes comments
Summary: Organize imports removes comments
Status: VERIFIED DUPLICATE of bug 24804
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0.2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.8 M2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-12 10:52 EST by Missing name CLA
Modified: 2011-09-13 05:19 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2003-03-12 10:52:44 EST
When there are comments between import statements they get removed when 
organizing imports.

Example:

import junit.framework.TestCase;
// JUnitDoclet begin import
import someotherclass;
// JUnitDoclet end import

becomes for instance

import java.io.File;
import java.util.List;
import java.util.Random;

import junit.framework.TestCase;

import org.apache.log4j.Logger;

import someotherclass;
// JUnitDoclet end import

The comment //JUnitDoclet begin import is lost.
Comment 1 Martin Aeschlimann CLA 2003-12-09 04:20:23 EST
the heuristic assigns the comment to the following import 'import
someotherclass;' which gets removed.

I think whatever heuristic I choose, threre are always corner cases where they
don't make sense. Setting to 'won't fin'
Comment 2 Dani Megert CLA 2009-02-05 02:32:25 EST

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