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

Bug 545340

Summary: [12][quick fix][switch expression] 'Add missing case statements'
Product: [Eclipse Project] JDT Reporter: Noopur Gupta <noopur_gupta>
Component: UIAssignee: Noopur Gupta <noopur_gupta>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert
Version: 4.11   
Target Milestone: 4.12 M3   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/142449
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=79cf9b81881fac0e5dd969c2a8bcdbf86602b21f
https://git.eclipse.org/r/142478
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=2ff097fcac0f0c5a5b8e51c1b378e2f8dbe910b6
https://git.eclipse.org/r/142487
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=a07e7d98b59b701173951c3a500a6bd2e5578de0
https://git.eclipse.org/r/142578
https://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=233a77c5208ecc8d1c38ed91676602c35b128662
Whiteboard:
Bug Depends on:    
Bug Blocks: 545120    

Description Noopur Gupta CLA 2019-03-13 05:44:13 EDT
public static void bar2(Day day) {
			int num= switch (day) {
				case MONDAY, FRIDAY -> 6;
				case TUESDAY                -> 7;
				case THURSDAY, SATURDAY     -> 8;
				case WEDNESDAY              -> 9;
			};
		}

- We get the error: A Switch expression should cover all possible values.
- We should have a quick fix 'Add missing case statements' similar to switch statements.
Comment 1 Noopur Gupta CLA 2019-05-20 02:27:56 EDT
Working on it now...
Comment 2 Eclipse Genie CLA 2019-05-20 11:28:16 EDT
New Gerrit change created: https://git.eclipse.org/r/142449
Comment 4 Noopur Gupta CLA 2019-05-20 13:15:33 EDT
TODO: Add tests and N&N entry.
Comment 5 Eclipse Genie CLA 2019-05-21 04:25:22 EDT
New Gerrit change created: https://git.eclipse.org/r/142478
Comment 7 Noopur Gupta CLA 2019-05-21 05:13:02 EDT
(In reply to Eclipse Genie from comment #6)
> Gerrit change https://git.eclipse.org/r/142478 was merged to [master].
> Commit:
> http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=2ff097fcac0f0c5a5b8e51c1b378e2f8dbe910b6
Added tests (with bad formatting - bug 545831).
Comment 8 Eclipse Genie CLA 2019-05-21 05:23:38 EDT
New Gerrit change created: https://git.eclipse.org/r/142487
Comment 9 Eclipse Genie CLA 2019-05-21 05:24:19 EDT
Gerrit change https://git.eclipse.org/r/142487 was merged to [BETA_JAVA_12].
Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=a07e7d98b59b701173951c3a500a6bd2e5578de0
Comment 10 Eclipse Genie CLA 2019-05-22 07:23:31 EDT
New Gerrit change created: https://git.eclipse.org/r/142578
Comment 12 Noopur Gupta CLA 2019-05-23 04:44:51 EDT
Verified in I20190522-1800.