Bug 82494 - Extract Method removes comments surrounded by empty lines
Summary: Extract Method removes comments surrounded by empty lines
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Dirk Baeumer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 88594 88976 (view as bug list)
Depends on: 91938
Blocks:
  Show dependency tree
 
Reported: 2005-01-10 12:56 EST by Markus Keller CLA
Modified: 2005-05-02 06:45 EDT (History)
1 user (show)

See Also:


Attachments
Patch to fix the problem (3.64 KB, patch)
2005-04-26 10:22 EDT, Dirk Baeumer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2005-01-10 12:56:35 EST
I20050104-1600

In the example below, extract the whole body of m() (both sysout statements):

class C {
    void m() {
        System.out.println("start");
        
        //TODO: really need to implement this!
        
        System.out.println("end");
    }
}

Extract Method removes my precious TODO comment:

class C {
    void m() {
        extracted();
    }

    private void extracted() {
        System.out.println("start");
        System.out.println("end");
    }
}

The comments are not removed when they are not surrounded by empty lines.
Comment 1 Dirk Baeumer CLA 2005-02-11 04:35:13 EST
This needs more support in the AST rewrite which Martin is working on for M6.
Comment 2 Dirk Baeumer CLA 2005-03-21 05:00:54 EST
*** Bug 88594 has been marked as a duplicate of this bug. ***
Comment 3 Dirk Baeumer CLA 2005-03-24 06:35:36 EST
*** Bug 88976 has been marked as a duplicate of this bug. ***
Comment 4 Dirk Baeumer CLA 2005-03-29 07:49:36 EST
The API is there now, but it will not make it into M6. Will be early M7.
Comment 5 Dirk Baeumer CLA 2005-04-26 10:22:33 EDT
Created attachment 20362 [details]
Patch to fix the problem

A patch to fix the problem based on the patch from 91938
Comment 6 Dirk Baeumer CLA 2005-05-02 06:45:41 EDT
Fixed.