Merge branch '5.3.x'

# Conflicts:
#	build.gradle
#	spring-messaging/src/main/java/org/springframework/messaging/rsocket/DefaultRSocketRequesterBuilder.java
#	spring-messaging/src/main/java/org/springframework/messaging/rsocket/MetadataEncoder.java
#	spring-messaging/src/main/java/org/springframework/messaging/simp/broker/OrderedMessageChannelDecorator.java
#	spring-messaging/src/main/java/org/springframework/messaging/simp/user/DefaultUserDestinationResolver.java
#	spring-test/src/main/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilder.java
#	spring-web/src/main/java/org/springframework/http/HttpRange.java
#	spring-webflux/src/main/java/org/springframework/web/reactive/result/view/RedirectView.java
#	spring-webflux/src/main/java/org/springframework/web/reactive/socket/CloseStatus.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/RedirectViewControllerRegistration.java
This commit is contained in:
Sam Brannen
2022-11-05 14:50:18 +01:00
27 changed files with 57 additions and 55 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 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.
@@ -31,8 +31,8 @@ import org.springframework.web.server.ServerWebExchange;
* ensure all conditions match a given request.
*
* <p>When {@code CompositeRequestCondition} instances are combined or compared
* they are expected to (a) contain the same number of conditions and (b) that
* conditions in the respective index are of the same type. It is acceptable to
* is expected that (a) they contain the same number of conditions and (b)
* conditions at the same index are of the same type. It is acceptable to
* provide {@code null} conditions or no conditions at all to the constructor.
*
* @author Rossen Stoyanchev
@@ -105,7 +105,7 @@ public class CompositeRequestCondition extends AbstractRequestCondition<Composit
/**
* If one instance is empty, return the other.
* If both instances have conditions, combine the individual conditions
* <p>If both instances have conditions, combine the individual conditions
* after ensuring they are of the same type and number.
*/
@Override
@@ -131,8 +131,8 @@ public class CompositeRequestCondition extends AbstractRequestCondition<Composit
private void assertNumberOfConditions(CompositeRequestCondition other) {
Assert.isTrue(getLength() == other.getLength(),
"Cannot combine CompositeRequestConditions with a different number of conditions. " +
ObjectUtils.nullSafeToString(this.requestConditions) + " and " +
() -> "Cannot combine CompositeRequestConditions with a different number of conditions. " +
ObjectUtils.nullSafeToString(this.requestConditions) + " and " +
ObjectUtils.nullSafeToString(other.requestConditions));
}

View File

@@ -98,7 +98,7 @@ public class RedirectView extends AbstractUrlBasedView {
* {@link HttpStatus#PERMANENT_REDIRECT}.
*/
public void setStatusCode(HttpStatusCode statusCode) {
Assert.isTrue(statusCode.is3xxRedirection(), "Not a redirect status code");
Assert.isTrue(statusCode.is3xxRedirection(), () -> "Not a redirect status code: " + statusCode);
this.statusCode = statusCode;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 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.
@@ -154,7 +154,7 @@ public final class CloseStatus {
* @param reason the reason
*/
public CloseStatus(int code, @Nullable String reason) {
Assert.isTrue((code >= 1000 && code < 5000), "Invalid status code");
Assert.isTrue((code >= 1000 && code < 5000), () -> "Invalid status code: " + code);
this.code = code;
this.reason = reason;
}