Upgrade to spring-javaformat 0.0.28 and downgrade to Checkstyle 8.41
In order to be able to use text blocks and other new Java language features, we are upgrading to a recent version of Checkstyle. The latest version of spring-javaformat-checkstyle (0.0.28) is built against Checkstyle 8.32 which does not include support for language features such as text blocks. Support for text blocks was added in Checkstyle 8.36. In addition, there is a binary compatibility issue between spring-javaformat-checkstyle 0.0.28 and Checkstyle 8.42. Thus we cannot use Checkstyle 8.42 or higher. In this commit, we therefore upgrade to spring-javaformat-checkstyle 0.0.28 and downgrade to Checkstyle 8.41. This change is being applied to `5.3.x` as well as `main` in order to benefit from the enhanced checking provided in more recent versions of Checkstyle. Closes gh-27481
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -81,7 +81,7 @@ final class SimpleBufferingAsyncClientHttpRequest extends AbstractBufferingAsync
|
||||
if (getMethod() == HttpMethod.DELETE && bufferedOutput.length == 0) {
|
||||
this.connection.setDoOutput(false);
|
||||
}
|
||||
if (this.connection.getDoOutput() && outputStreaming) {
|
||||
if (this.connection.getDoOutput() && this.outputStreaming) {
|
||||
this.connection.setFixedLengthStreamingMode(bufferedOutput.length);
|
||||
}
|
||||
this.connection.connect();
|
||||
|
||||
@@ -132,7 +132,7 @@ public class JettyResourceFactory implements InitializingBean, DisposableBean {
|
||||
if (this.byteBufferPool == null) {
|
||||
this.byteBufferPool = new MappedByteBufferPool(2048,
|
||||
this.executor instanceof ThreadPool.SizedThreadPool
|
||||
? ((ThreadPool.SizedThreadPool) executor).getMaxThreads() / 2
|
||||
? ((ThreadPool.SizedThreadPool) this.executor).getMaxThreads() / 2
|
||||
: ProcessorUtils.availableProcessors() * 2);
|
||||
}
|
||||
if (this.scheduler == null) {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.http.codec.multipart;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -265,7 +265,6 @@ public class ProtobufDecoder extends ProtobufCodecSupport implements Decoder<Mes
|
||||
* Parse message size as a varint from the input stream, updating {@code messageBytesToRead} and
|
||||
* {@code offset} fields if needed to allow processing of upcoming chunks.
|
||||
* Inspired from {@link CodedInputStream#readRawVarint32(int, java.io.InputStream)}
|
||||
*
|
||||
* @return {code true} when the message size is parsed successfully, {code false} when the message size is
|
||||
* truncated
|
||||
* @see <a href="https://developers.google.com/protocol-buffers/docs/encoding#varints">Base 128 Varints</a>
|
||||
@@ -290,7 +289,7 @@ public class ProtobufDecoder extends ProtobufCodecSupport implements Decoder<Mes
|
||||
return false;
|
||||
}
|
||||
final int b = input.read();
|
||||
this.messageBytesToRead |= (b & 0x7f) << offset;
|
||||
this.messageBytesToRead |= (b & 0x7f) << this.offset;
|
||||
if ((b & 0x80) == 0) {
|
||||
this.offset = 0;
|
||||
return true;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.http.server;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.http.server.reactive;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.bind;
|
||||
|
||||
/**
|
||||
|
||||
@@ -169,7 +169,6 @@ public class DefaultResponseErrorHandler implements ResponseErrorHandler {
|
||||
* {@link HttpClientErrorException#create} for errors in the 4xx range, to
|
||||
* {@link HttpServerErrorException#create} for errors in the 5xx range,
|
||||
* or otherwise raises {@link UnknownHttpStatusCodeException}.
|
||||
*
|
||||
* @since 5.0
|
||||
* @see HttpClientErrorException#create
|
||||
* @see HttpServerErrorException#create
|
||||
|
||||
@@ -448,7 +448,6 @@ public interface RestOperations {
|
||||
/**
|
||||
* Delete the resources at the specified URI.
|
||||
* <p>URI Template variables are expanded using the given map.
|
||||
*
|
||||
* @param url the URL
|
||||
* @param uriVariables the variables to expand the template
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.context.request;
|
||||
|
||||
/**
|
||||
@@ -41,7 +42,6 @@ public interface AsyncWebRequestInterceptor extends WebRequestInterceptor{
|
||||
/**
|
||||
* Called instead of {@code postHandle} and {@code afterCompletion}, when the
|
||||
* handler started handling the request concurrently.
|
||||
*
|
||||
* @param request the current request
|
||||
*/
|
||||
void afterConcurrentHandlingStarted(WebRequest request);
|
||||
|
||||
@@ -63,7 +63,6 @@ public abstract class CorsUtils {
|
||||
* {@code "Forwarded"} and {@code "X-Forwarded-*"} headers that specify the
|
||||
* client-originated address. Consider using the {@code ForwardedHeaderFilter}
|
||||
* to extract and use, or to discard such headers.
|
||||
*
|
||||
* @return {@code true} if the request is a same-origin one, {@code false} in case
|
||||
* of a cross-origin request
|
||||
* @deprecated as of 5.2, same-origin checks are performed directly by {@link #isCorsRequest}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.cors.reactive;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.filter;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.filter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.server;
|
||||
|
||||
import java.security.Principal;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.util;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -53,11 +54,10 @@ public abstract class ServletRequestPathUtils {
|
||||
* {@link RequestPath} and save it in the request attribute
|
||||
* {@link #PATH_ATTRIBUTE} for subsequent use with
|
||||
* {@link org.springframework.web.util.pattern.PathPattern parsed patterns}.
|
||||
* The returned {@code RequestPath} will have both the contextPath and any
|
||||
* <p>The returned {@code RequestPath} will have both the contextPath and any
|
||||
* servletPath prefix omitted from the {@link RequestPath#pathWithinApplication()
|
||||
* pathWithinApplication} it exposes.
|
||||
*
|
||||
* <p>This method is typically called by the {@code DispatcherServlet} to
|
||||
* <p>This method is typically called by the {@code DispatcherServlet} to determine
|
||||
* if any {@code HandlerMapping} indicates that it uses parsed patterns.
|
||||
* After that the pre-parsed and cached {@code RequestPath} can be accessed
|
||||
* through {@link #getParsedRequestPath(ServletRequest)}.
|
||||
|
||||
@@ -757,7 +757,6 @@ public abstract class WebUtils {
|
||||
* {@code "Forwarded"} and {@code "X-Forwarded-*"} headers that specify the
|
||||
* client-originated address. Consider using the {@code ForwardedHeaderFilter}
|
||||
* to extract and use, or to discard such headers.
|
||||
*
|
||||
* @return {@code true} if the request origin is valid, {@code false} otherwise
|
||||
* @since 4.1.5
|
||||
* @see <a href="https://tools.ietf.org/html/rfc6454">RFC 6454: The Web Origin Concept</a>
|
||||
|
||||
@@ -44,12 +44,10 @@ public class PathPatternParser {
|
||||
/**
|
||||
* Whether a {@link PathPattern} produced by this parser should
|
||||
* automatically match request paths with a trailing slash.
|
||||
*
|
||||
* <p>If set to {@code true} a {@code PathPattern} without a trailing slash
|
||||
* will also match request paths with a trailing slash. If set to
|
||||
* {@code false} a {@code PathPattern} will only match request paths with
|
||||
* a trailing slash.
|
||||
*
|
||||
* <p>The default is {@code true}.
|
||||
*/
|
||||
public void setMatchOptionalTrailingSeparator(boolean matchOptionalTrailingSeparator) {
|
||||
|
||||
Reference in New Issue
Block a user