You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Laszlo Kishalmi (JIRA)" <ji...@apache.org> on 2019/03/09 04:11:00 UTC
[jira] [Resolved] (NETBEANS-1675) Java Hint to fix error :different
case kinds used in the switch in switch expressions
[ https://issues.apache.org/jira/browse/NETBEANS-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Laszlo Kishalmi resolved NETBEANS-1675.
---------------------------------------
Resolution: Implemented
Fix Version/s: 11.0
> Java Hint to fix error :different case kinds used in the switch in switch expressions
> -------------------------------------------------------------------------------------
>
> Key: NETBEANS-1675
> URL: https://issues.apache.org/jira/browse/NETBEANS-1675
> Project: NetBeans
> Issue Type: Improvement
> Reporter: ARUNAVA SINHA
> Assignee: vikas kumar prabhakar
> Priority: Major
> Labels: NB-JDK12, pull-request-available
> Fix For: 11.0
>
> Time Spent: 3h 40m
> Remaining Estimate: 0h
>
> Code:
> int i=10;
> final String val =
> switch (i)
> { case 1 : break "one"; case 2 -> "two"; }
> ;
> Error will be displayed in editor 'different case kinds used in the switch'
> Proposed fix:
> Scenario 1: Switch Statements
> int k = 1;
> switch(k) {
> case 1 :
> System.out.println( "one");
> break;
> case 2 -> System.out.println( "two");
> }
> After Fix:
> ink k = 1;
> switch (k){
> case 1 -> System.out.println( "one");
> case 2 -> System.out.println( "two");
> }
> Scenario 2: Switch Expression
> int k= 1;
> var val =
> switch(k){
> case 1 :
> break("one");
> case 2 -> "two";
> };
> After Fix:
> int k= 1;
> var val =
> switch(k){
> case 1 -> "one";
> case 2 -> "two";
> };
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists