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

Bug 331115

Summary: Replace if-else with conditional removes comment right above if-else
Product: [Eclipse Project] JDT Reporter: Robert Munteanu <robert.munteanu>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.6   
Target Milestone: 3.7 M4   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Robert Munteanu CLA 2010-11-25 07:16:50 EST
If I apply the mentioned quick fix to an if-else block which has a comment above, the comment is removed. Please see the below class for an example.

pre.. 
public class Bug {

	public static void main(String[] args) {
		boolean flag = false;
		String value;
		// this comment will be erased
		if ( flag )
			value = "true";
		else
			value = "false";
		
		System.out.format("flag: %b, value: %s%n", flag, value);
	}
}
Comment 1 Markus Keller CLA 2010-11-25 11:15:40 EST
Fixed in AdvancedQuickAssistProcessor.