Browse Source

Fix SingletonSupplier.ofNullable(T) nullability

See gh-35559
pull/35567/head
Sébastien Deleuze 3 months ago
parent
commit
5138305e0b
  1. 2
      spring-core/src/main/java/org/springframework/util/function/SingletonSupplier.java

2
spring-core/src/main/java/org/springframework/util/function/SingletonSupplier.java

@ -143,7 +143,7 @@ public class SingletonSupplier<T extends @Nullable Object> implements Supplier<T @@ -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);
}

Loading…
Cancel
Save