Skip to content

Test for missing @NotNull / @Nullable annotations #361

@ljacqu

Description

@ljacqu

Write a unit test that scans the parameters of methods and constructors, and the return value of methods and that reports any that don't have @NotNull or @Nullable.

To do

  • Add org.reflections as a test dependency
  • Write a test that collects all classes of ConfigMe
    • Skip classes that end in "Test"
  • Collect all method/constructor params and method return values
  • Report all instances where neither nullability annotation is used
    • Special case arrays: T @NotNull [] is how the array itself is reported not null. Probably should also check the component if possible?
    • Begs the question what to do with other generic types such as List<String> (vs. List<@NotNull String>)...?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions