Skip to content

Link the generic nullability mismatch diagnostic to an explanation of its lines #2203

Backlog

Description

@vlsi

Problem or use case

With #1828, a generic nullability mismatch prints source supertype:, numbered path: entries, note:, and possible fix: lines, and the diagnostic links http://t.uber.com/nullaway, the generic landing page. A user who meets these lines for the first time has no link that leads to an explanation of them.

Example and expected behavior

@NullMarked
class Test {
  Collection<Object> copy(List<?> list) {
    List<Object> result = new ArrayList<>();
    result.addAll(list); // incompatible nullability in type argument for E of Collection -> upper bound of wildcard: ...
    return result;
  }
}

The diagnostic carries a link, through Error Prone's Description.Builder.setLinkUrl, to the entry for incompatible nullability in … on the Error messages wiki page, and that entry describes each of those lines. JSpecify mode on.

Proposed solution

Publish the wiki entry first, then point the link of this diagnostic at its anchor.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions