-
Notifications
You must be signed in to change notification settings - Fork 300
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
Feature request: Recognize common "assertThat(...).isNotNull()" statements #301
Comments
This sounds doable, but only with a custom handler, since library models are not currently expressive enough to reason across multiple chained calls like that (e.g. I think it should be a simple handler, the question is if it's one that we want enabled by default. Is Also, another quick question: what's the FQN of |
I think covering the standard libraries for this is probably a safe start Junit's is one, there's also AssertJ, Truth, probably some others. Maybe cover the common ones and add a hook for others to provide their own expressions? (not sure how simple that is) assertThat is pretty common in general I'd say, but running nullaway in tests probably isn't. I could see a good reason to make this off by default and opt-in to enable only in tests. |
Adds handling of some nullness assertions to NullAway. Specifically, this adds support for "assertThat(...).isNotNull()" statements and proves an initial fix for Issue #301 (other test APIs to come). This support is off by default, but can be enabled by passing `-XepOpt:NullAway:HandleTestAssertionLibraries=true`.
I'm pretty sure we fixed this one some time back |
These are common in tests
The text was updated successfully, but these errors were encountered: