File tree Expand file tree Collapse file tree
nullaway/src/main/java/com/uber/nullaway Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -480,7 +480,7 @@ public static boolean mayBeNullFieldFromType(
480480 return !(symbol .getSimpleName ().toString ().equals ("class" )
481481 || symbol .isEnum ()
482482 || codeAnnotationInfo .isSymbolUnannotated (symbol , config , null ))
483- && Nullness .hasNullableFieldAnnotation (symbol , config );
483+ && Nullness .hasNullableOrMonotonicNonNullAnnotation (symbol , config );
484484 }
485485
486486 /**
Original file line number Diff line number Diff line change @@ -64,14 +64,15 @@ public static boolean isMonotonicNonNullAnnotation(String annotName) {
6464 }
6565
6666 /**
67- * For a field check for either a {@code @Nullable} annotation or a {@code @MonotonicNonNull}
68- * annotation
67+ * Check for either a {@code @Nullable} annotation or a {@code @MonotonicNonNull} annotation on
68+ * {@code symbol}. Used to reason whether a field may be null.
6969 */
70- public static boolean hasNullableFieldAnnotation (Symbol symbol , Config config ) {
71- return hasNullableFieldAnnotation (NullabilityUtil .getAllAnnotations (symbol , config ), config );
70+ public static boolean hasNullableOrMonotonicNonNullAnnotation (Symbol symbol , Config config ) {
71+ return hasNullableOrMonotonicNonNullAnnotation (
72+ NullabilityUtil .getAllAnnotations (symbol , config ), config );
7273 }
7374
74- private static boolean hasNullableFieldAnnotation (
75+ private static boolean hasNullableOrMonotonicNonNullAnnotation (
7576 Stream <? extends AnnotationMirror > annotations , Config config ) {
7677 return annotations
7778 .map (anno -> anno .getAnnotationType ().toString ())
You can’t perform that action at this time.
0 commit comments