| Summary: | [12] Quick fix inserts wrong kind of case statement | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Jay Arthanareeswaran <jarthana> |
| Component: | UI | Assignee: | 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 | ||
Should be handled with bug 543665. *** This bug has been marked as a duplicate of bug 543665 *** |
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.