Skip to content
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

Closed
wborn opened this issue Mar 27, 2021 · 5 comments · Fixed by #16875
Closed

Upgrade lastnpe EEA to 2.4.0 #10396

wborn opened this issue Mar 27, 2021 · 5 comments · Fixed by #16875
Labels
enhancement An enhancement or new feature for an existing add-on

Comments

@wborn
Copy link
Member

wborn commented Mar 27, 2021

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 return null 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 Optionals only where they make sense such as with Streams.

WDYT @openhab/add-ons-maintainers?

@wborn wborn changed the title Upgrade to lastnpe EEA to 2.3.0 Upgrade lastnpe EEA to 2.3.0 Mar 27, 2021
@lsiepel
Copy link
Contributor

lsiepel commented Dec 29, 2022

Version 2.4.0 release: https://github.com/lastnpe/eclipse-null-eea-augments/releases/tag/v2.4.0
Isn't this allready upgraded?

@wborn
Copy link
Member Author

wborn commented Dec 29, 2022

No see:

<eea.version>2.2.1</eea.version>

@wborn wborn changed the title Upgrade lastnpe EEA to 2.3.0 Upgrade lastnpe EEA to 2.4.0 Dec 29, 2022
@lsiepel
Copy link
Contributor

lsiepel commented Dec 29, 2022

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

@lsiepel lsiepel added the enhancement An enhancement or new feature for an existing add-on label Jun 16, 2024
@lsiepel
Copy link
Contributor

lsiepel commented Jun 18, 2024

Can we somehow prevent lastnpe to check 3rdparty libs?

\bundles\org.openhab.binding.smsmodem\src\3rdparty\java\org\smslib\driver\AbstractModemDriver.java:[66,42] Null type mismatch: required 'java.io.@NonNull InputStream' but the provided value is inferred as @org.eclipse.jdt.annotation.Nullable

@wborn
Copy link
Member Author

wborn commented Jun 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants