Deprecate Spring nullability annotations

JSpecify annotations should be used instead.

See gh-28797
This commit is contained in:
Sébastien Deleuze
2024-12-03 15:22:50 +01:00
parent 0e85d950b3
commit 61545fabfc
4 changed files with 11 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,6 +42,7 @@ import javax.annotation.meta.TypeQualifierNickname;
* @author Sebastien Deleuze
* @author Juergen Hoeller
* @since 5.0
* @deprecated since 7.0; use {@link org.jspecify.annotations.NonNull} instead
* @see NonNullApi
* @see NonNullFields
* @see Nullable
@@ -51,5 +52,6 @@ import javax.annotation.meta.TypeQualifierNickname;
@Documented
@Nonnull
@TypeQualifierNickname
@Deprecated
public @interface NonNull {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,6 +38,7 @@ import javax.annotation.meta.TypeQualifierDefault;
* @author Sebastien Deleuze
* @author Juergen Hoeller
* @since 5.0
* @deprecated since 7.0; use {@link org.jspecify.annotations.NullMarked} instead
* @see NonNullFields
* @see Nullable
* @see NonNull
@@ -47,5 +48,6 @@ import javax.annotation.meta.TypeQualifierDefault;
@Documented
@Nonnull
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER})
@Deprecated
public @interface NonNullApi {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,6 +37,7 @@ import javax.annotation.meta.TypeQualifierDefault;
*
* @author Sebastien Deleuze
* @since 5.0
* @deprecated since 7.0; use {@link org.jspecify.annotations.NullMarked} instead
* @see NonNullApi
* @see Nullable
* @see NonNull
@@ -46,5 +47,6 @@ import javax.annotation.meta.TypeQualifierDefault;
@Documented
@Nonnull
@TypeQualifierDefault(ElementType.FIELD)
@Deprecated
public @interface NonNullFields {
}

View File

@@ -42,6 +42,7 @@ import javax.annotation.meta.TypeQualifierNickname;
* @author Sebastien Deleuze
* @author Juergen Hoeller
* @since 5.0
* @deprecated since 7.0; use {@link org.jspecify.annotations.Nullable} instead
* @see NonNullApi
* @see NonNullFields
* @see NonNull
@@ -51,5 +52,6 @@ import javax.annotation.meta.TypeQualifierNickname;
@Documented
@CheckForNull
@TypeQualifierNickname
@Deprecated
public @interface Nullable {
}