You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
@interface Nullable {}
enumSomeEnum { FOO, BAR, BAZ }
classTest {
voidtestSwitch(@NullableSomeEnumsomeEnum) {
// incorrectly reports null warning on the next line:switch (someEnum) {
caseFOO -> { /* do stuff with FOO */ }
caseBAR -> { /* do stuff with BAR */ }
caseBAZ -> { /* do stuff with BAZ */ }
casenull -> { /* do stuff with null */ }
}
}
}
Apache NetBeans version
Apache NetBeans 23
What happened
When any
switch
statement or expression has a nullable parameter andcase null
, it won’t implicitly throw aNullPointerException
, so NPECheck shouldn’t report a warning in that case.Language / Project Type / NetBeans Component
No response
How to reproduce
Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows 11
JDK
OpenJDK Runtime Environment Temurin-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
The text was updated successfully, but these errors were encountered: