Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use @org.jspecify.annotations.NonNull for @org.openrewrite.internal.lang.NonNull instead of @javax.annotation.Nonnull #4820

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

import javax.annotation.Nonnull;
import javax.annotation.meta.TypeQualifierNickname;
import java.lang.annotation.*;

/**
* A common annotation to declare that annotated elements cannot be {@code null}.
* Leverages JSR 305 meta-annotations to indicate nullability in Java to common tools with
* JSR 305 support and used by Kotlin to infer nullability of the API.
* Leverages JSpecify meta-annotations to indicate nullability in Java to common tools with
* JSpecify support and used by Kotlin to infer nullability of the API.
* <p>Should be used at parameter, return value, and field level. Method overrides should
* repeat parent {@code @NonNull} annotations unless they behave differently.
* <p>Use {@code @NonNullApi} (scope = parameters + return values) and/or {@code @NonNullFields}
Expand All @@ -40,7 +39,7 @@
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.TYPE, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Nonnull
@org.jspecify.annotations.NonNull
@TypeQualifierNickname
@Deprecated
public @interface NonNull {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

/**
* A common annotation to declare that annotated elements can be {@code null} under
* some circumstance. Leverages JSR 305 meta-annotations to indicate nullability in Java
* to common tools with JSR 305 support and used by Kotlin to infer nullability of the API.
* some circumstance. Leverages JSpecify meta-annotations to indicate nullability in Java
* to common tools with JSpecify support and used by Kotlin to infer nullability of the API.
* <p>Should be used at parameter, return value, and field level. Methods override should
* repeat parent {@code @Nullable} annotations unless they behave differently.
* <p>Can be used in association with {@code NonNullApi} or {@code @NonNullFields} to
Expand Down
Loading