Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 139712

Summary: [Quick assist] Remove surrounding for statement removes comments
Product: [Eclipse Project] JDT Reporter: Johannes Rieken <johannes_rieken>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Johannes Rieken CLA 2006-05-02 11:13:01 EDT
steps:
1 - take the following code
public class Brause {
	
	void m() {
//		int i = 123 * 321;
//		this is a comment, not code
		for(;;) {
			;
		}
	}
}
2 - select line of for-loop, quick assist (CTRL+1), and select 'Remove surrounding for...'
3 - you'll end up with an empty method - even the comment is getting removed 

Note: I could see this behaviour only with comments, not with code.
Comment 1 Markus Keller CLA 2006-05-03 15:45:36 EDT
Looks like an ASTRewrite problem.
Comment 2 Eclipse Genie CLA 2019-09-15 04:14:26 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.