Skip to content

Commit

Permalink
Deprecate ResultIgnorabilityUnspecified.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 562876689
  • Loading branch information
kluever authored and Error Prone Team committed Sep 6, 2023
1 parent d546886 commit 83ce08c
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ private boolean enclosingAnnotationDefaultsNonTypeVariablesToNonNull(
if (hasAnnotation(sym, "com.google.protobuf.Internal$ProtoNonnullApi", state)) {
return true;
}
if (hasAnnotation(sym, "org.jspecify.nullness.NullMarked", state)
if (hasAnnotation(sym, "org.jspecify.annotations.NullMarked", state)
&& weTrustNullMarkedOn(sym, state)) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static boolean nullnessChecksShouldBeConservative(ErrorProneFlags flags) {

static boolean isInNullMarkedScope(Symbol sym, VisitorState state) {
for (; sym != null; sym = sym.getEnclosingElement()) {
if (hasAnnotation(sym, "org.jspecify.nullness.NullMarked", state)) {
if (hasAnnotation(sym, "org.jspecify.annotations.NullMarked", state)) {
return true;
}
}
Expand Down Expand Up @@ -353,7 +353,7 @@ private static NullableAnnotationToUse pickNullableAnnotation(VisitorState state
.orElse(
state.isAndroidCompatible()
? "androidx.annotation.Nullable"
: "org.jspecify.nullness.Nullable");
: "org.jspecify.annotations.Nullable");
if (sym != null) {
ClassSymbol classSym = (ClassSymbol) sym;
if (classSym.isAnnotationType()) {
Expand Down Expand Up @@ -381,8 +381,8 @@ private static boolean isTypeUse(String className) {
case "org.checkerframework.checker.nullness.qual.Nullable":
case "org.jspecify.annotations.NonNull":
case "org.jspecify.annotations.Nullable":
case "org.jspecify.nullness.NonNull":
case "org.jspecify.nullness.Nullable":
case "org.jspecify.annotations.NonNull":
case "org.jspecify.annotations.Nullable":
return true;
default:
// TODO(cpovirk): Detect type-use-ness from the class symbol if it's available?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void methodReturnsOptionalWithAnotherNullableAnnotation_showsError() {
.addSourceLines(
"Test.java",
"import java.util.Optional;",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"final class Test {",
" @Nullable",
" // BUG: Diagnostic contains:",
Expand Down Expand Up @@ -136,7 +136,7 @@ public void methodReturnsNonOptionalWithAnotherNullableAnnotation_noError() {
compilationHelper
.addSourceLines(
"Test.java",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"final class Test {",
" @Nullable",
" private Object foo() {",
Expand All @@ -151,7 +151,7 @@ public void methodHasNullableNonOptionalAsParameter_noError() {
compilationHelper
.addSourceLines(
"Test.java",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"final class Test {",
" private void foo(@Nullable Object object) {}",
"}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void positiveConservativeNullMarked() {
conservativeHelper
.addSourceLines(
"Foo.java",
"import org.jspecify.nullness.NullMarked;",
"import org.jspecify.annotations.NullMarked;",
"@NullMarked",
"abstract class Foo {",
" // BUG: Diagnostic contains: @Nullable",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ public void nonAnnotationNullable() {
.addOutputLines(
"out/Test.java",
"class T {",
" private final @org.jspecify.nullness.Nullable Object obj2 = null;",
" private final @org.jspecify.annotations.Nullable Object obj2 = null;",
" class Nullable {}",
"}")
.doTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public void positiveNullMarkedOtherPackageAggressive() {
aggressiveHelper
.addSourceLines(
"Foo.java",
"import org.jspecify.nullness.NullMarked;",
"import org.jspecify.annotations.NullMarked;",
"@NullMarked",
"class Foo {",
" void consume(String s) {}",
Expand All @@ -194,7 +194,7 @@ public void negativeNullMarkedNonComGoogleCommonPackageConservative() {
conservativeHelper
.addSourceLines(
"Foo.java",
"import org.jspecify.nullness.NullMarked;",
"import org.jspecify.annotations.NullMarked;",
"@NullMarked",
"class Foo {",
" void consume(String s) {}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ public void removeSuppressWarnings_removeNullnessReturnWarning() {
.addOutputLines(
"com/google/errorprone/bugpatterns/nullness/LiteralNullReturnTest.java",
"package com.google.errorprone.bugpatterns.nullness;",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"public class LiteralNullReturnTest {",
"",
" public @Nullable String getMessage(boolean b) {",
Expand Down Expand Up @@ -1689,8 +1689,8 @@ public void nonAnnotationNullable() {
.addOutputLines(
"out/Test.java",
"class T {",
" @org.jspecify.nullness.Nullable private final Object method(boolean b) { return b ?"
+ " null : 0; }",
" @org.jspecify.annotations.Nullable private final Object method(boolean b) { return b"
+ " ? null : 0; }",
" class Nullable {}",
"}")
.doTest();
Expand All @@ -1712,7 +1712,7 @@ public void multipleNullReturns() {
"}")
.addOutputLines(
"out/Test.java",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"class T {",
" private final @Nullable Object method(boolean b) {",
" if (b) {",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public void positiveConservativeNullMarked() {
.addSourceLines(
"Test.java",
"import javax.annotation.Nullable;",
"import org.jspecify.nullness.NullMarked;",
"import org.jspecify.annotations.NullMarked;",
"@NullMarked",
"class Test {",
" // BUG: Diagnostic contains: @Nullable",
Expand Down

0 comments on commit 83ce08c

Please sign in to comment.