Skip to content

Alias @NullMarked to mark code as annotated #1299

@wmdietl

Description

@wmdietl

Splitting off from #1272 where @Ao-senXiong said:

Additionally,@AnnotatedFor("nullness") should be aliased to JSpecify's @NullMarked annotation to provide support for projects using this mechanism.

JSpecify's @NullMarked only makes a statement about nullness, neither initialization nor the keyfor hierarchies.

So, it would be closer to @AnnotatedFor("nullnessonly"), mirroring the corresponding warning suppression key.
However, for @AnnotatedFor we need to use a checker name, not a warning suppression key.

So, our options are:

  • "nullness": Mark the code as annotated for all three hierarchies.
  • "nullnessnoinit": the name of the checker that only handles nullness and keyfor.
  • Some other option? Introducing a new checker?

I think it is okay to go with "nullness". If the defaults for initialization and keyfor do not work, we will raise errors for the code.
@thisisalexandercook @Ao-senXiong opinions?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions