-
Notifications
You must be signed in to change notification settings - Fork 299
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
The combination of JSpecify + Lombok does not seem to work well #917
Comments
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. |
Based on projectlombok/lombok#3346 I figured out the right config required here:
If you want Lombok to use JSpecify annotations for generated code you can also do:
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 (@cpovirk should 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. |
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
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! |
I opened a PR to fix this upstream in Lombok: projectlombok/lombok#3613 |
Thanks for the report and the fix. As for |
Fixed upstream in projectlombok/lombok#3608 |
Background
Originally, I was using JSR 305 for
@Nullable
annotation and was recently trying to migrate to JSpecify, but with JSpecify's@Nullable
annotation, Lombok handling of NullAway written in the README does not seem to work well. I thought it was quite possible that this was intentional JSpecify support in NullAway, but it makes the transition to JSpecify for projects using NullAway very difficult.So I would like to know about the following:
Reproducer
Below is a sample code that I have tried. (The following code is committed to my github repo as reproducer)
This code will make the
. /gradlew check
will report an error due to NullAway as shown below.The text was updated successfully, but these errors were encountered: