-
Notifications
You must be signed in to change notification settings - Fork 352
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
Can initialize with null value when using with Lombok @Builder together #5238
Comments
As I recall Lists in Builders are initialized to an empty list rather than |
Hi, msridhar, here's the generated class:
It looks like the LIst is not initialized to an empty list automatically, so when calling the
But I am curious when not specifying a default empty list why is nullity not checked at initialization time? |
@msridhar, is it possible you were thinking of the combination of the I don't think the Nullness Checker ought to do any special handling of lists that are not annotated as @blackdiz, I know that there are some situations in which the Checker Framework and Lombok do not play nicely together, as described in the manual here: https://checkerframework.org/manual/#lombok-typechecking. When debugging issues related to Lombok, I've definitely forgotten to delombok the code first and then been surprised by a missing error message... |
Yes that's what I was thinking of! Sorry for the confusion. |
I spent some time investigating this. Here is my branch: https://github.com/msridhar/tainting-example/tree/called-methods-lombok First, for the original example, we should not report an error. The reason is that the That said, even after adding the I also copied over a If you comment out line 13 in that file and run At this point, I suspect this issue is due to some Gradle / CF Gradle Plugin issue. In the main CF repo, I confirmed that if I modify @kelloggm do you have any time to investigate what is happening here? |
@blackdiz were you using the Checker Framework Gradle plugin when trying to compile your initial example? |
I'll look into it when I get a chance (unfortunately, not right now). One possibility that comes to mind: do you have a |
Good guess @kelloggm! Manually adding I've created an issue on the CF Gradle Plugin around this: kelloggm/checkerframework-gradle-plugin#220 Since there seems to be no issue in the Checker Framework proper, I'll go ahead and close this issue in favor of that one. |
I have a simple class:
And I use the builder to initialize an object without assigning the
test
field and expect the framework would raise an error:But the test passed, I am not sure if this is a bug or I just misconfigure.
The text was updated successfully, but these errors were encountered: