Update code regarding null-safety semantics
See gh-30083
This commit is contained in:
@@ -21,6 +21,7 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
@@ -142,6 +143,7 @@ public class CompositeRequestCondition extends AbstractRequestCondition<Composit
|
||||
* <p>An empty {@code CompositeRequestCondition} matches to all requests.
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public CompositeRequestCondition getMatchingCondition(ServerWebExchange exchange) {
|
||||
if (isEmpty()) {
|
||||
return this;
|
||||
|
||||
@@ -194,6 +194,7 @@ public final class ConsumesRequestCondition extends AbstractRequestCondition<Con
|
||||
* or {@code null} if no expressions match.
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public ConsumesRequestCondition getMatchingCondition(ServerWebExchange exchange) {
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
if (CorsUtils.isPreFlightRequest(request)) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
@@ -104,6 +105,7 @@ public final class ParamsRequestCondition extends AbstractRequestCondition<Param
|
||||
* or {@code null} otherwise.
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public ParamsRequestCondition getMatchingCondition(ServerWebExchange exchange) {
|
||||
for (ParamExpression expression : this.expressions) {
|
||||
if (!expression.match(exchange)) {
|
||||
|
||||
@@ -99,6 +99,7 @@ public final class RequestConditionHolder extends AbstractRequestCondition<Reque
|
||||
* holder, return the same holder instance.
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public RequestConditionHolder getMatchingCondition(ServerWebExchange exchange) {
|
||||
if (this.condition == null) {
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user