Skip to content

Commit

Permalink
Recognize libcore.util.Nullable as type-use, and add a TODO about "hy…
Browse files Browse the repository at this point in the history
…brid" annotations.

PiperOrigin-RevId: 407607800
  • Loading branch information
cpovirk authored and Error Prone Team committed Nov 4, 2021
1 parent 0f34024 commit 0fc9146
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,12 @@ private static NullableAnnotationToUse pickNullableAnnotation(VisitorState state
}

private static boolean isTypeUse(String className) {
/*
* TODO(b/205115472): Make this tri-state ({type-use, declaration, both}) and avoid using "both"
* annotations in any cases in which they would be ambiguous (e.g., arrays/elements).
*/
switch (className) {
case "libcore.util.Nullable":
case "org.checkerframework.checker.nullness.qual.Nullable":
case "org.jspecify.nullness.Nullable":
return true;
Expand Down

0 comments on commit 0fc9146

Please sign in to comment.