Bug 546072

Summary: [13][quick fix] Assign to Local variable Quick fix can be added for Switch Expression
Product: [Eclipse Project] JDT Reporter: Sarika Sinha <sarika.sinha>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 Keywords: helpwanted
Version: 4.12   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 545120    

Description Sarika Sinha CLA 2019-04-02 16:14:42 EDT
switch (day) {
		    case MONDAY, TUESDAY  -> 1;
		    case WEDNESDAY, THURSDAY, FRIDAY -> 2;
		    case SATURDAY, SUNDAY -> {
		    	System.out.println("End of the Week");
		    	break 3;
		    }
	    };

This leads to compiler error "Invalid expression as statement".
We can have a quick fix to assign the value of Switch expression to a local variable to fix this error.