diff --git a/nullaway/src/test/java/com/uber/nullaway/TypeUseAnnotationsTests.java b/nullaway/src/test/java/com/uber/nullaway/TypeUseAnnotationsTests.java index 8acf95fbc2..3f57ef4b40 100644 --- a/nullaway/src/test/java/com/uber/nullaway/TypeUseAnnotationsTests.java +++ b/nullaway/src/test/java/com/uber/nullaway/TypeUseAnnotationsTests.java @@ -126,12 +126,13 @@ public void annotationAppliedToInnerTypeExplicitly() { "import org.checkerframework.checker.nullness.qual.Nullable;", "class Test {", " Test.@Nullable Foo f1;", + " // @Nullable does not apply to the inner type", + " // BUG: Diagnostic contains: @NonNull field f2 not initialized", " @Nullable Test.Foo f2;", " class Foo { }", " public void test() {", " // BUG: Diagnostic contains: dereferenced", " f1.hashCode();", - " // BUG: Diagnostic contains: dereferenced", " f2.hashCode();", " }", "}") @@ -154,11 +155,12 @@ public void annotationAppliedToInnerTypeExplicitly2() { "import org.checkerframework.checker.nullness.qual.Nullable;", "class Test {", " Bar.@Nullable Foo f1;", + " // @Nullable does not apply to the inner type", + " // BUG: Diagnostic contains: @NonNull field f2 not initialized", " @Nullable Bar.Foo f2;", " public void test() {", " // BUG: Diagnostic contains: dereferenced", " f1.hashCode();", - " // BUG: Diagnostic contains: dereferenced", " f2.hashCode();", " }", "}")