| Summary: | [12][quick fix][switch expression] 'Add default case' | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Noopur Gupta <noopur_gupta> |
| Component: | UI | Assignee: | Noopur Gupta <noopur_gupta> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | 4.11 | ||
| Target Milestone: | 4.12 M3 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://bugs.eclipse.org/bugs/show_bug.cgi?id=543665 https://git.eclipse.org/r/142119 https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=ef6b732ee8f3f3920f99576ea4b9909d2098a45c https://git.eclipse.org/r/142125 https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=1c1f0a2d35513d79532a8d03f58f693a3b855608 https://git.eclipse.org/r/142486 https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=d30e4b27fddd3a9a8d3ba1434d4217e648fad060 |
||
| Whiteboard: | |||
| Bug Depends on: | 545255 | ||
| Bug Blocks: | 545120 | ||
public class SE_Default { public static void bar3 (int input) { int num= switch (input) { case 60, 600 -> 6; case 70 -> 7; case 80 -> 8; case 90, 900 -> 9; }; System.out.println(num); } public static void bar4 (int input) { int num= switch (input) { case 60, 600: break 6; case 70: break 7; case 80: break 8; case 90, 900: break 9; }; System.out.println(num); } } - We get the error: "A switch expression should have a default case". - A QF should be added to 'Add default case'. It should use : or -> based on existing usage.