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

Bug 543891

Summary: [12] Quick fix inserts wrong kind of case statement
Product: [Eclipse Project] JDT Reporter: Jay Arthanareeswaran <jarthana>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, noopur_gupta
Version: 4.10   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 545120    

Description Jay Arthanareeswaran CLA 2019-01-28 06:09:27 EST
We emit the warning for missing enum constant in switch case even for the case constant with ->, which is good. However, the quick fix for inserting the missing constant produces the below code with error:

	public static void bar(MyDay day) {
		switch (day) {
		case SATURDAY ->
			System.out.println(MyDay.SATURDAY);
		case SUNDAY:
			break;
		default:
			break;
		}                          
	}

UI should be smart enough to insert the case with -> rather than ":".

Probably some help is needed from the Core API, but for now we can have this investigated in the UI.
Comment 1 Noopur Gupta CLA 2019-01-28 09:53:15 EST
Should be handled with bug 543665.

*** This bug has been marked as a duplicate of bug 543665 ***