mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Fix SingletonSupplier.ofNullable(T) nullability
See gh-35559
This commit is contained in:
@@ -143,7 +143,7 @@ public class SingletonSupplier<T extends @Nullable Object> implements Supplier<T
|
||||
* @return the singleton supplier, or {@code null} if the instance was {@code null}
|
||||
*/
|
||||
@Contract("null -> null; !null -> !null")
|
||||
public static <T extends @Nullable Object> @Nullable SingletonSupplier<T> ofNullable(T instance) {
|
||||
public static <T extends @Nullable Object> @Nullable SingletonSupplier<T> ofNullable(@Nullable T instance) {
|
||||
return (instance != null ? new SingletonSupplier<>(instance) : null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user