Skip to content

Commit 1aa9747

Browse files
committed
rename method
1 parent bbfd36c commit 1aa9747

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

nullaway/src/main/java/com/uber/nullaway/NullabilityUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
/**

nullaway/src/main/java/com/uber/nullaway/Nullness.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff 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())

0 commit comments

Comments
 (0)