Bug 151476

Summary: Move method: prepended comments are removed
Product: [Eclipse Project] JDT Reporter: Michael Schneider <m_schnei>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Michael Schneider CLA 2006-07-21 17:20:15 EDT
When a method is moved to another class, all '//' comments directly prepending this method are silently removed.

For example:

  public class C  {

    D aD;
    
    // Here is some comment
    
    public void f() { }
    
  }

When now moving (ALT+SHIFT+V) method 'f' to class 'D', 
also the comment '// Here is...' is removed. This is bad,
because such a comment in general must be regarded as related
to method f(). In the worst case (which happend to me), the
comment is some important outcommented code (in my case
it were a bunch of JUnit testcases, which I had planned 
to use later in the future).

Proposed fix: Do not remove prepending comments.
Comment 1 Martin Aeschlimann CLA 2006-07-27 05:01:18 EDT

*** This bug has been marked as a duplicate of 150558 ***