Bug 103340 - "Change Method Signature" refactoring breaks code when comments are present
Summary: "Change Method Signature" refactoring breaks code when comments are present
Status: RESOLVED DUPLICATE of bug 95839
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-11 11:59 EDT by Marcus Crafter CLA
Modified: 2005-07-12 06:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***