Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331115 - Replace if-else with conditional removes comment right above if-else
Summary: Replace if-else with conditional removes comment right above if-else
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.7 M4   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-25 07:16 EST by Robert Munteanu CLA
Modified: 2010-11-25 11:15 EST (History)
1 user (show)

See Also:


Attachments

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