diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/ServerWebExchangeUtils.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/ServerWebExchangeUtils.java index d174d3ce..17e16036 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/ServerWebExchangeUtils.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/ServerWebExchangeUtils.java @@ -21,7 +21,6 @@ import java.net.URI; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.Map; -import java.util.Objects; import java.util.function.Predicate; import org.apache.commons.logging.Log; @@ -31,6 +30,7 @@ import reactor.core.publisher.Mono; import org.springframework.cloud.gateway.handler.AsyncPredicate; import org.springframework.http.HttpStatus; import org.springframework.http.server.reactive.AbstractServerHttpResponse; +import org.springframework.util.Assert; import org.springframework.web.server.ServerWebExchange; /** @@ -125,7 +125,7 @@ public class ServerWebExchangeUtils { } public static AsyncPredicate toAsyncPredicate(Predicate predicate) { - Objects.requireNonNull(predicate, "predicate must not be null"); + Assert.notNull(predicate, "predicate must not be null"); return t -> Mono.just(predicate.test(t)); }