Bug 79760 - ASTRewrite should support replacing n nodes with m nodes to better maintain formatting
Summary: ASTRewrite should support replacing n nodes with m nodes to better maintain f...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-30 05:35 EST by Dirk Baeumer CLA
Modified: 2004-12-15 13:41 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2004-11-30 05:35:44 EST
I have the following case:

class A {
  public void foo() {
     int i= 10;

     foo();
     foo();

     i= 20;
  }
}

now I want to replace foo();foo(); with one statement. I didn't find a way to do
this without loosing either the empty line before or after the two statements.
What I want to achieve is

class A {
  public void foo() {
     int i= 10;

     extracted();

     i= 20;
  }
}
Comment 1 Martin Aeschlimann CLA 2004-12-10 10:27:39 EST
in I20041207
Comment 2 Frederic Fusier CLA 2004-12-15 09:55:33 EST
Martin,
I have found no test case in org.eclipse.jdt.core.model for this (search "79760"
text in this project returns 0 occurrences).
May you verify that it is fixed using last 3.1 M4 candidate (I200412142000) and
makr bug as VERIFIED?
Thanks
Comment 3 Martin Aeschlimann CLA 2004-12-15 10:31:26 EST
What I added is covered by ASTRewritingGroupNodeTest
Comment 4 Olivier Thomann CLA 2004-12-15 11:37:09 EST
Martin or Dirk, could you please verify this one?
Comment 5 Martin Aeschlimann CLA 2004-12-15 13:41:08 EST
verified