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.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core.codec;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
@@ -573,7 +573,7 @@ final class TypeMappedAnnotation<A extends Annotation> extends AbstractMergedAnn
|
||||
}
|
||||
if (this.source != null) {
|
||||
if (this.source instanceof Class) {
|
||||
return ((Class<?>) source).getClassLoader();
|
||||
return ((Class<?>) this.source).getClassLoader();
|
||||
}
|
||||
if (this.source instanceof Member) {
|
||||
((Member) this.source).getDeclaringClass().getClassLoader();
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core.codec;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core.codec;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
@@ -138,7 +138,6 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
|
||||
customizePropertySources(propertySources);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Factory method used to create the {@link ConfigurablePropertyResolver}
|
||||
* instance used by the Environment.
|
||||
@@ -168,6 +167,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
|
||||
* sources using {@link MutablePropertySources#addLast(PropertySource)} such that
|
||||
* further subclasses may call {@code super.customizePropertySources()} with
|
||||
* predictable results. For example:
|
||||
*
|
||||
* <pre class="code">
|
||||
* public class Level1Environment extends AbstractEnvironment {
|
||||
* @Override
|
||||
@@ -187,11 +187,13 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
* In this arrangement, properties will be resolved against sources A, B, C, D in that
|
||||
*
|
||||
* <p>In this arrangement, properties will be resolved against sources A, B, C, D in that
|
||||
* order. That is to say that property source "A" has precedence over property source
|
||||
* "D". If the {@code Level2Environment} subclass wished to give property sources C
|
||||
* and D higher precedence than A and B, it could simply call
|
||||
* {@code super.customizePropertySources} after, rather than before adding its own:
|
||||
*
|
||||
* <pre class="code">
|
||||
* public class Level2Environment extends Level1Environment {
|
||||
* @Override
|
||||
@@ -202,25 +204,24 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
* The search order is now C, D, A, B as desired.
|
||||
*
|
||||
* <p>Beyond these recommendations, subclasses may use any of the {@code add*},
|
||||
* <p>The search order is now C, D, A, B as desired.
|
||||
* <p>Beyond these recommendations, subclasses may use any of the {@code add*},
|
||||
* {@code remove}, or {@code replace} methods exposed by {@link MutablePropertySources}
|
||||
* in order to create the exact arrangement of property sources desired.
|
||||
*
|
||||
* <p>The base implementation registers no property sources.
|
||||
*
|
||||
* <p>Note that clients of any {@link ConfigurableEnvironment} may further customize
|
||||
* property sources via the {@link #getPropertySources()} accessor, typically within
|
||||
* an {@link org.springframework.context.ApplicationContextInitializer
|
||||
* ApplicationContextInitializer}. For example:
|
||||
*
|
||||
* <pre class="code">
|
||||
* ConfigurableEnvironment env = new StandardEnvironment();
|
||||
* env.getPropertySources().addLast(new PropertySourceX(...));
|
||||
* </pre>
|
||||
*
|
||||
* <h2>A warning about instance variable access</h2>
|
||||
* Instance variables declared in subclasses and having default initial values should
|
||||
* <p>Instance variables declared in subclasses and having default initial values should
|
||||
* <em>not</em> be accessed from within this method. Due to Java object creation
|
||||
* lifecycle constraints, any initial value will not yet be assigned when this
|
||||
* callback is invoked by the {@link #AbstractEnvironment()} constructor, which may
|
||||
@@ -229,7 +230,6 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
|
||||
* property source manipulation and instance variable access directly within the
|
||||
* subclass constructor. Note that <em>assigning</em> values to instance variables is
|
||||
* not problematic; it is only attempting to read default values that must be avoided.
|
||||
*
|
||||
* @see MutablePropertySources
|
||||
* @see PropertySourcesPropertyResolver
|
||||
* @see org.springframework.context.ApplicationContextInitializer
|
||||
|
||||
@@ -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.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core.io.buffer;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core.io.buffer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -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.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@@ -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.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core.io.buffer;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@@ -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.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.util.concurrent;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
Reference in New Issue
Block a user