Skip to content
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

@LazyInit not respected #64

Closed
ZacSweers opened this issue Dec 2, 2017 · 2 comments
Closed

@LazyInit not respected #64

ZacSweers opened this issue Dec 2, 2017 · 2 comments

Comments

@ZacSweers
Copy link
Contributor

If you use Error-Prone's @LazyInit annotation, nullaway still flags it as an error

warning: [NullAway] @NonNull field header not initialized
    @LazyInit private transient TeamHeader header;
                                           ^
    (see http://t.uber.com/nullaway )
@msridhar
Copy link
Collaborator

msridhar commented Dec 2, 2017

We don't have the ability to do any checking of @LazyInit right now. To suppress any warnings on such fields you can use the -XepOpt:NullAway:ExcludedFieldAnnotations option (see the docs). If this is a popular annotation we can think of suppressing by default.

@ZacSweers
Copy link
Contributor Author

ZacSweers commented Dec 2, 2017

It's built in to error-prone and used by libraries like guava and autovalue (in generated code). Seems like a good candidate for default suppression.

msridhar added a commit that referenced this issue Dec 14, 2017
Support @beforeeach and @BeforeAll as initializer annotations, and @Inject and @lazyinit as excluded field annotations.

Fixes #73, #64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants