Skip to content

Improve, document, and link tools for automatically adding nullness annotations #553

@cpovirk

Description

@cpovirk

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationFor issues related to user-facing documentationtrackingkeeping track of our needs from projects

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions