Skip to content

Commit

Permalink
Automatic code cleanup.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 648644801
  • Loading branch information
kluever authored and Error Prone Team committed Jul 2, 2024
1 parent cf25065 commit 2f6b8ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,7 @@ private boolean enclosingAnnotationDefaultsNonTypeVariablesToNonNull(
if (hasAnnotation(sym, "com.google.protobuf.Internal$ProtoNonnullApi", state)) {
return true;
}
if ((hasAnnotation(sym, "org.jspecify.annotations.NullMarked", state)
// We break this string to avoid having it rewritten by Copybara.
|| hasAnnotation(sym, "org.jspecify.null" + "ness.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 @@ -130,9 +130,7 @@ static boolean nullnessChecksShouldBeConservative(ErrorProneFlags flags) {

static boolean isInNullMarkedScope(Symbol sym, VisitorState state) {
for (; sym != null; sym = sym.getEnclosingElement()) {
if (hasAnnotation(sym, "org.jspecify.annotations.NullMarked", state)
// We break this string to avoid having it rewritten by Copybara.
|| hasAnnotation(sym, "org.jspecify.null" + "ness.NullMarked", state)) {
if (hasAnnotation(sym, "org.jspecify.annotations.NullMarked", state)) {
return true;
}
}
Expand Down Expand Up @@ -385,9 +383,6 @@ private static boolean isTypeUse(String className) {
case "org.checkerframework.checker.nullness.qual.Nullable":
case "org.jspecify.annotations.NonNull":
case "org.jspecify.annotations.Nullable":
// We break these strings to avoid having them rewritten by Copybara.
case "org.jspecify.null" + "ness.NonNull":
case "org.jspecify.null" + "ness.Nullable":
return true;
default:
// TODO(cpovirk): Detect type-use-ness from the class symbol if it's available?
Expand Down

0 comments on commit 2f6b8ff

Please sign in to comment.