Void should be annotated @Nullable
- Dominant language
- Java
- Stars
- 7.2k
- Forks
- 820
- Avg merge
- 5h 9m
- Merged PRs (30d)
- 50
Description
There are multiple methods using `java.lang.Void` as return or parameter type, not annotated as `@Nullable`. Examples:
com.google.errorprone.bugpatterns.threadsafety.ConstantExpressions::visitIdentifier
com.google.errorprone.bugpatterns.threadsafety.ConstantExpressions::visitParenthesized
com.google.errorprone.bugpatterns.threadsafety.ConstantExpressions::visitBinary
com.google.errorprone.bugpatterns.threadsafety.DoubleCheckedLocking::vistBlock
com.google.errorprone.bugpatterns.threadsafety.ImmutableChecker::visitMemberSelect
com.google.errorprone.refaster.RefasterScanner::scan
etc
As `Void` cannot be instantiated, the respective values must be `null` and should therefore be annotated to aid static checkers, and error-prone actually contains a rule saying this:
https://errorprone.info/bugpattern/VoidMissingNullable
Contributor guide
Assessment
This issue has not been assessed yet.