From d6e9562aebcd520b5edf1edd59b25768562efbdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Wed, 10 Apr 2024 14:39:47 +0200 Subject: [PATCH] Revert "Prevent compilation warnings with `@Nullable`" This reverts commit dc242df53378bfcc51fcdbe59e205235845d975d. --- .../src/main/java/org/springframework/lang/Nullable.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/lang/Nullable.java b/spring-core/src/main/java/org/springframework/lang/Nullable.java index a07eec0b7c0..324d28899a9 100644 --- a/spring-core/src/main/java/org/springframework/lang/Nullable.java +++ b/spring-core/src/main/java/org/springframework/lang/Nullable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2023 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. @@ -22,8 +22,9 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; import javax.annotation.meta.TypeQualifierNickname; +import javax.annotation.meta.When; /** * A common Spring annotation to declare that annotated elements can be {@code null} @@ -49,7 +50,7 @@ import javax.annotation.meta.TypeQualifierNickname; @Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) @Documented -@CheckForNull +@Nonnull(when = When.MAYBE) @TypeQualifierNickname public @interface Nullable { }