-
Notifications
You must be signed in to change notification settings - Fork 923
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
Consider adopting NullAway into the build process #1680
Comments
Ah yeah now I remember this issue. Seems |
No. 😄 I didn't take a close look at all. IIRC JetBrains had some contract annotations, too. Not sure which is the best 🤔 |
I tried to test and compare NullAway and the Checker Framework. The Checker Framework - It does not support Java 13 yet.
So I don't think we need to go any further now. NullAwayIt produces some useful error messages. But it could not cover all of our null checking code. armeria/core/src/main/java/com/linecorp/armeria/common/SessionProtocol.java Lines 87 to 88 in bd28eb2
I am not sure that we can put NullAway into the build process. |
@ikhoon Since checker framework also can't be run together with error prone from what I understand, we'd have two builds anyways, and I guess with some configuration tweaks that could be set to Java 11. Probably not worth the trouble though, but I'm curious whether checker framework would catch |
It looks resolved in Error Prone 2.4.0
Yeah, let me push the branch tested locally. |
Motivation: Before adopting NullAway(line#1680) or other static analysis tools. Manually run it and clean up errors. Modifications: - Fix all true positives reported by NullAway Result: Less NullAway errors
Motivation: Before adopting NullAway(#1680) or other static analysis tools. Manually run it and clean up errors. Modifications: - Fix all true positives reported by NullAway Result: Less NullAway errors
Motivation: Before adopting NullAway(line#1680) or other static analysis tools. Manually run it and clean up errors. Modifications: - Fix all true positives reported by NullAway Result: Less NullAway errors
Motivation: It would be nice if we can fail our build if there is any potential `null` dereference, so our users have much less chance of getting `NullPointerException`. Modifications: - Updated the build so that NullAway plugin is enabled for `:core` - Note that the root `build.gradle` was modified so that we can enable NullAway for other projects in the future. - Other caveats: - NullAway is disabled for MR-JAR sources because it seems to make the build fail with unrelated errors (e.g. no symbol) - Added `assert` sentences and `@Nullable` annotations wherever applicable - Fixed a few minor potential `null` dereferences Result: - We're more confident about our `@Nullable` usages in our API. - Theoretically, there should be no chance of `NullPointerException` at least in the `:core`. - However, note that some `NullPointerException`s might have become `AssertionError`s, since we added a bunch of assertions in this PR, so please review carefully :-) - Partially resolves line#1680 and line#5184
Motivation: This is a follow-up PR for line#5820 It would be nice if we can fail our build if there is any potential `null` dereference, so our users have much less chance of getting `NullPointerException`. Modifications: - Enabled NullAway for all projects - Added `assert` sentences and `@Nullable` annotations wherever applicable - Fixed a few minor potential `null` dereferences Result: - Theoretically, there should be no chance of `NullPointerException` anymore. - However, note that some NullPointerExceptions might have become `AssertionError`s, since we added a bunch of assertions in this PR, so please review carefully :-) - Closes line#1680 - Closes line#5184
#5830 needs to be merged to close this. |
See: https://github.com/uber/NullAway
The text was updated successfully, but these errors were encountered: