Skip to content

Add JSpecify annotations to all existing classes #3878

Open

Description

@dondonz

I made a classic NPE mistake today because I forgot to check if DataFetcherResult's data was null

Let's help everyone avoid classic NPEs by adding JSpecify annotations to all existing classes.

Note: this will take a while to complete, but we can chip away at it gradually

Activity

  1. mk868 commented on Apr 2, 2025

    @mk868
    Contributor

    Hello,
    Do you need help with this activity?
    If so, I can contribute

  2. dondonz commented on Apr 2, 2025

    @dondonz
    MemberAuthor

    Sure happy to receive contributions for this!

  3. dondonz commented on Apr 3, 2025

    @dondonz
    MemberAuthor

    One thing I'll add, we have a great many classes. It's better to start with the classes annotated with @PublicApi first. It's also great if the pull request only does a number of classes at a time, don't need to do all of them in one go

  4. added
    keep-openTells Stale Bot to keep PRs and issues open
    on Apr 4, 2025
  5. dondonz commented on Aug 16, 2025

    @dondonz
    MemberAuthor

    TIL: there's an Infer Nullity option in IntelliJ and there are other automated tools, which aren't perfect but can help

  6. dondonz commented on Aug 16, 2025

    @dondonz
    MemberAuthor

    Example of another automated tool: https://github.com/ucr-riple/NullAwayAnnotator

    Note for IntelliJ, you have to first change the nullability annotation package to JSpecify via options Settings → Editor → Code Style → Java → Code Generation → Annotations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    keep-openTells Stale Bot to keep PRs and issues open

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions