Bug 103340

Summary: "Change Method Signature" refactoring breaks code when comments are present
Product: [Eclipse Project] JDT Reporter: Marcus Crafter <crafterm>
Component: UIAssignee: Martin Aeschlimann <martinae>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.2   
Hardware: All   
OS: All   
Whiteboard:

Description Marcus Crafter CLA 2005-07-11 11:59:38 EDT
Hi All,

Hope all is going well.

If I have the following code

object.method(
  param1, // text about param1
  param2  // text about param2
);

and I perform a "Change Method Signature" refactoring, and add an additional
parameter to the method signature, the above caller code is changed to:

object.method(
  param1, // text about param1
  param2  // text about param2, param3
);

ie. the 3rd parameter is appended to the end of the line, but the comment keeps
it out of compilation space.

This naturally causes compilation errors in the project after the refactoring.

Ideally, it could recognize that it's a comment and append it to the next line,
inserting a comma in the right place.

Cheers,

Marcus
Comment 1 Olivier Thomann CLA 2005-07-11 15:31:37 EDT
Move to JDT/UI
Comment 2 Dirk Baeumer CLA 2005-07-12 06:02:43 EDT
Martin, this looks like a AST rewriting problem ?
Comment 3 Martin Aeschlimann CLA 2005-07-12 06:10:27 EDT

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