Comments (6)
Thanks for the report and the fix.
As for @NullMarked
and @NullUnmarked
: My read is that Lombok's lists are for copying annotations from fields only. If so, then we wouldn't have reason to list those annotations, as they aren't applicable to fields (only to methods/classes/packages/modules).
from nullaway.
Thanks for the info. I tried your suggestion on https://github.com/kjim/nullaway-example/pull/1/files and the issue has been gone.
In my case, simply adding the following one settings seems to solve the problem (since I donβt use @NonNull
).
lombok.copyableAnnotations+=org.jspecify.annotations.Nullable
This workaround seems to work well. Until jspecify annotation is added (or changed?) on lombok side, I can proceed with the migration by adding this setting. Thanks!
from nullaway.
I opened a PR to fix this upstream in Lombok: projectlombok/lombok#3613
from nullaway.
Fixed upstream in projectlombok/lombok#3608
from nullaway.
Thanks for this report! This is not intentional behavior; it's quite surprising in fact. Let me dig a bit to see if I can fix.
from nullaway.
Based on projectlombok/lombok#3346 I figured out the right config required here:
lombok.copyableAnnotations+=org.jspecify.annotations.NonNull
lombok.copyableAnnotations+=org.jspecify.annotations.Nullable
If you want Lombok to use JSpecify annotations for generated code you can also do:
lombok.addNullAnnotations = CUSTOM:TYPE_USE:org.jspecify.annotations.NonNull:org.jspecify.annotations.Nullable
To avoid needing any extra config, I think these two lines in Lombok need to be updated to use the latest JSpecify package names and to refer to @NonNull
instead of @NullnessUnspecified
:
(@cpovirk should @NullMarked
/ @NullUnmarked
be in that list as well?)
In any case, let me know if the above config works for you. I'll leave this issue open until we can open an appropriate PR / issue on Lombok.
from nullaway.
Related Issues (20)
- jdk Files false positive/wrong line HOT 3
- Update JSpecify package in docs HOT 1
- Method references of nullable instances are not detected HOT 1
- Detected NPE causes EP's Var rule to go nuts. HOT 5
- Validation of null in a switch-case with pattern matching does not work as expected. HOT 1
- False positive warning on switch statements with case null
- Build failure : 'options.compilerArgumentProviders.errorprone$0.name' is missing an input or output annotation. HOT 1
- Support org.apache.commons.lang3.StringUtils.isNotEmpty HOT 3
- Support for `collect()` in Streams API HOT 4
- Control flow analysis fails within a stream collector HOT 5
- Validation of null in a method used in a boolean expression does not work as expected. HOT 1
- `if (Foo.this.bar != null)` in nested class not properly analyzed HOT 1
- Rename the Jar Infer Flags `JarInferEnabled`,`JarInferUseReturnAnnotations`
- Variable checked non-null outside a `forEach` or `Stream` lambda triggers an error HOT 13
- `if` statement on a boolean does not prevent a dereferenced nullable error HOT 1
- Null `if` check and failing function to taken in account HOT 2
- Extract methods in StreamNullabilityPropagator
- ignoring generic Nullable on Supplier HOT 14
- Published NonNull Present HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nullaway.