nmatt opened a new issue, #9162:
URL: https://github.com/apache/netbeans/issues/9162

   ### Description
   
   The hint Assign Return Value To New Variable is available for most 
expressions, but not for switch expressions.
   
   ### Use case/motivation
   
   Example:
   ```java
   enum FooBar { FOO, BAR };
   FooBar fooBar = FooBar.FOO;
   switch (fooBar) { case FOO -> 10; case BAR -> 20; };
   ```
   The hint should be available on the *switch* line and result in:
   ```java
   int [name] = switch (fooBar) { case FOO -> 10; case BAR -> 20; };
   ```
   For comparison, it is available on:
   ```java
   fooBar == FooBar.FOO ? 10 : fooBar == FooBar.BAR ? 20 : -1;
   ```
   The usefulness should hopefully be obvious.
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to