You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2019/01/04 11:52:11 UTC

[GitHub] sarveshkesharwani opened a new pull request #1071: [NETBEANS-1728] fix for Exception encountered when break returns value

sarveshkesharwani opened a new pull request #1071: [NETBEANS-1728] fix for Exception encountered when break returns value
URL: https://github.com/apache/incubator-netbeans/pull/1071
 
 
   In JDK 12, when we try to return a value with a break statement, (for example in a switch statement), for eg. 
   `String str = switch(i) {
               case 1 :
                   System.out.println("one");
                   break "one";
               default :
                   System.out.println("def");
                   break "def";
   };`
   
   Now, in such a scenario, the break target forms an Expression Tree, whereas, a Statement Tree is expected wherever it is being called from (for eg., IfToSwitchSupport).
   I have tested the existing functionalities like switching from If to Switch, and the hint for no value being returned in the above scenario gives the appropriate hint too (missing break value) .

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists