-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Field in unannotated code should be considered non-null only for field reads #1101
Comments
This is not expected. How is the code designated as unannotated? Is it generated into a different package? |
I'm setting |
Thanks for the report; a PR fix is up now. This bug has existed in NullAway for years! |
@agrieve would it be helpful to you to have a release with this fix? |
Thanks for such a quick fix! I've fixed our main code generator that emitted these fields, so I don't think there'd be many other instances, so I wouldn't cut a release just for this if there's some overhead in doing so. |
Ok, sounds good. I might wait then until we can get a couple more fixes in. |
(Sorry if this is filed somewhere already)
It's come up a couple times now where we have generated code that creates struct-like classes with public fields. The NullAway default for unannotated code is to treat public fields as non-null, which removes warnings for field reads, but not for field writes. It would be great if fields of of unannotated classes would be considered
@Nullable
in the context of field writes.In the particular case I'm working, I can update our code generator to annotate the fields, but thought I'd file this anyways.
The text was updated successfully, but these errors were encountered: