-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade lastnpe EEA to 2.4.0 #10396
Comments
Version 2.4.0 release: https://github.com/lastnpe/eclipse-null-eea-augments/releases/tag/v2.4.0 |
No see: Line 74 in dbaf081
|
Well, i'm no maintainer, but i would suggest we upgrade this as part of 4.0.0? Especially because binding codeowners might refactor their bindings to move to java 17. A good moment to also check these null annotations |
Can we somehow prevent lastnpe to check 3rdparty libs?
|
It's a compilation error generated by the compiler and AFAIK you can't disable these for certain dirs/files or use some annotation to suppress them. |
There is a new release we should upgrade to:
https://github.com/lastnpe/eclipse-null-eea-augments/releases/tag/v2.3.0
I already upgraded to this version in the other repos. For the add-ons it is a bit more work.
The reason is that the new version fixes that
Optional.orElse
can returnnull
values (based on the parameter).There is quite some code using
Optional.orElse
expecting the result to be non-null.One way could be to use a workaround like enclosing such statements with
Objects.requireNonNull(..)
.Another fix could be to rewrite such code to not use optionals. IMHO we should use only one way to prevent NPEs (the annotations) and use
Optional
s only where they make sense such as withStream
s.WDYT @openhab/add-ons-maintainers?
The text was updated successfully, but these errors were encountered: