Community
Participate
Working Groups
Build ID: M20080911-1700 The "Inline local variable" refactoring removes comments that appear on the line(s) before the variable in question. For example: public void method() { // Another // Comment int x = 4; int y = x; } This results in the following after inlining 'x': public void method() { int y = 4; } Sometimes comments before variables are attached to them, and it makes sense to delete them. But more often, the comments are useful in their own right, and should not be deleted. The user can delete them if necessary later. This problem is somewhat dangerous, because if you're not paying attention, comments get deleted but you don't notice until much later.
*** This bug has been marked as a duplicate of bug 150558 ***
I protest! Although the underlying cause of this problem may have to do with the AST rewriter, I see no reason why an option can not be created (either for just this refactoring, or globally for the AST RW) that allows the user to control whether or not surrounding comments are grouped with a given element.