ExE-Boss opened a new issue, #7949:
URL: https://github.com/apache/netbeans/issues/7949

   ### Apache NetBeans version
   
   Apache NetBeans 23
   
   ### What happened
   
   When any `switch` statement or expression has a nullable parameter and `case 
null`, it won’t implicitly throw a `NullPointerException`, so **NPECheck** 
shouldn’t report a warning in that case.
   
   ### Language / Project Type / NetBeans Component
   
   _No response_
   
   ### How to reproduce
   
   ```java
   @interface Nullable {}
   
   enum SomeEnum { FOO, BAR, BAZ }
   
   class Test {
        void testSwitch(@Nullable SomeEnum someEnum) {
                // incorrectly reports null warning on the next line:
                switch (someEnum) {
                        case FOO        -> { /* do stuff with FOO       */ }
                        case BAR        -> { /* do stuff with BAR       */ }
                        case BAZ        -> { /* do stuff with BAZ       */ }
                        case null       -> { /* do stuff with null      */ }
                }
        }
   }
   ```
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Windows 11
   
   ### JDK
   
   OpenJDK Runtime Environment [Temurin](https://adoptium.net/)-23+37 (build 
23+37)
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   _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