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

Bug 545417

Summary: [12] New Code templates for Switch case and Expression
Product: [Eclipse Project] JDT Reporter: Sarika Sinha <sarika.sinha>
Component: TextAssignee: Kalyan Prasad Tatavarthi <kalyan_prasad>
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/142224
https://git.eclipse.org/r/142225
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=5d9ac75453e40030977cf42dab8bd0e476aee6e9
https://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=faa0a0aef4b0376d723906320a6d325f22c07447
https://git.eclipse.org/r/142230
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=36dbc24413b0d5c2977641cb4df2a318453ba140
https://git.eclipse.org/r/142231
https://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=9dc724a38e41281b17b24e67e1ec98afba2242aa
https://git.eclipse.org/r/142489
https://git.eclipse.org/r/142488
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=9c3a7f04436fbdb6eed1728ec283f98bb828383d
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=b7ba888612705256fba8f67a90bde5030465cf83
Whiteboard:
Bug Depends on:    
Bug Blocks: 545120    

Description Sarika Sinha CLA 2019-03-14 12:55:51 EDT
Currently, there is only 1 code template for switch case and that always produces ":". We should have another code template which can generate "->" for Java 12 and above with preview feature enabled. Also there should be a code template for Switch Expression which could add "break <expression>;" for  each switch case .
Comment 1 Eclipse Genie CLA 2019-05-16 02:42:38 EDT
New Gerrit change created: https://git.eclipse.org/r/142224
Comment 2 Eclipse Genie CLA 2019-05-16 02:44:12 EDT
New Gerrit change created: https://git.eclipse.org/r/142225
Comment 5 Kalyan Prasad Tatavarthi CLA 2019-05-16 02:52:35 EDT
I have added code templates for Switch Labeled Statement and Switch Expressions.

Currently there is no mechanism of showing the template only on a specific java version. This needs to be worked upon. So keeping this bug open to work on it.
Comment 6 Eclipse Genie CLA 2019-05-16 03:58:50 EDT
New Gerrit change created: https://git.eclipse.org/r/142230
Comment 8 Eclipse Genie CLA 2019-05-16 04:04:15 EDT
New Gerrit change created: https://git.eclipse.org/r/142231
Comment 10 Kalyan Prasad Tatavarthi CLA 2019-05-16 04:07:48 EDT
I have made changes so that these new templates are only available on Java Projects having compliance Java 12 or above. Also modified N&N entry to update this information.
Comment 11 Eclipse Genie CLA 2019-05-21 05:33:32 EDT
New Gerrit change created: https://git.eclipse.org/r/142489
Comment 12 Eclipse Genie CLA 2019-05-21 05:33:34 EDT
New Gerrit change created: https://git.eclipse.org/r/142488
Comment 13 Eclipse Genie CLA 2019-05-21 05:36:46 EDT
Gerrit change https://git.eclipse.org/r/142488 was merged to [BETA_JAVA_12].
Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=9c3a7f04436fbdb6eed1728ec283f98bb828383d
Comment 14 Eclipse Genie CLA 2019-05-21 05:41:01 EDT
Gerrit change https://git.eclipse.org/r/142489 was merged to [BETA_JAVA_12].
Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=b7ba888612705256fba8f67a90bde5030465cf83
Comment 15 Kalyan Prasad Tatavarthi CLA 2019-05-23 00:49:56 EDT
Verified in the build I20190522-1800