Skip to content

Field in unannotated code should be considered non-null only for field reads #1101

@agrieve

Description

@agrieve

(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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions