-
Notifications
You must be signed in to change notification settings - Fork 38
Description
We have a few in Error Prone's nullness directory, notably ReturnMissingNullable, which we have used to great effect. All those could be improved in various ways, and we have Google-internal issues filed about a few of those ways.
A bigger win would probably be to be able to run each one of them as a standalone Java binary, one that requires downloading no dependencies and one that can operate on an isolated source file without need of its dependencies. Doing this would restrict what we can do somewhat, but we can still easily add @Nullable to methods that return null, for example :)
The existing tools are not well documented. Part of the problem is that Error Prone's patching mode is complex, but we can sidestep that for the standalone tool I referred to above. Still, there will be more to document. A big part of that is documenting how to have the tools make all the changes that are 99.9999% likely to be correct (which you barely have to look at), then the changes that are merely very likely to be correct (which you can review more carefully), and perhaps so on down the line for changes that we're even less confident in but that still make a useful start for a human that is viewing them more as of a best guess that might save you some typing than as a near-indisputably correct judgment.
Then we'd want to direct users there from our documentation, such as from our forthcoming 1.0 blog post.
And we're not the only one with such tools:
- https://checkerframework.org/manual/#nullness-inference
- https://checkerframework.org/manual/#whole-program-inference
- I think https://github.com/uber/NullAway/blob/master/jar-infer/jar-infer-cli/README.md is somewhat different, but the NullAway folks may have pointers, and so may other people inside and outside the group.