Below enhancements/fixes are based on JEP-325
- New hint to convert switch-cases to rule kind cases
After implementing the hint fix - New hint to convert mixed case kind in Switch-Expression/Switch-Cases to rule kind cases
All mixed kind of cases ( i.e., having both : and -> ) will be converted to rule(->) kind cases
hint for converting mixed case type in Switch to rule kind cases.
After implementing the error fix:
Hint for converting mixed type in Switch expression to to rule kind cases.
After implementing the error fix: - Formatting and re-indentation of Switch-Expression and Rule Switch.
a. switch-expression before formatting :
switch-expression after formatting :
b. switch-expression with rule cases before formatting:
switch-expression with rule cases after formatting: - Auto complete of enum case values in Switch-Expression
Bug-Fixes:
- NETBEANS-1728: ClassCastException in Switch Expression
- NETBEANS-1674: NPE thrown while formatting the switch expression
Steps to enable preview features in NetBeans IDE :
- Goto Project → Properties
- Goto Build → Compiling pane : Uncheck 'Run Compilation in External VM' and Add '--enable-preview' in Additional Compiler Options
- Goto Run pane : Add '--enable-preview' in VM Options