Merge branch '3.2.x'

Closes gh-39093
This commit is contained in:
Andy Wilkinson
2024-01-11 11:25:26 +00:00
151 changed files with 354 additions and 349 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -1522,7 +1522,7 @@ public class SpringApplication {
* {@link SpringApplicationRunListener} to capture {@link Running} application
* details.
*/
private static class RunListener implements SpringApplicationRunListener, Running {
private static final class RunListener implements SpringApplicationRunListener, Running {
private final List<ConfigurableApplicationContext> contexts = Collections
.synchronizedList(new ArrayList<>());
@@ -1739,7 +1739,7 @@ public class SpringApplication {
/**
* Standard {@link Startup} implementation.
*/
private static class StandardStartup extends Startup {
private static final class StandardStartup extends Startup {
private final Long startTime = System.currentTimeMillis();
@@ -1768,7 +1768,7 @@ public class SpringApplication {
/**
* Coordinated-Restore-At-Checkpoint {@link Startup} implementation.
*/
private static class CoordinatedRestoreAtCheckpointStartup extends Startup {
private static final class CoordinatedRestoreAtCheckpointStartup extends Startup {
private final StandardStartup fallback = new StandardStartup();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -169,7 +169,7 @@ class SpringApplicationShutdownHook implements Runnable {
/**
* The handler actions for this shutdown hook.
*/
private class Handlers implements SpringApplicationShutdownHandlers, Runnable {
private final class Handlers implements SpringApplicationShutdownHandlers, Runnable {
private final Set<Runnable> actions = Collections.newSetFromMap(new IdentityHashMap<>());
@@ -207,7 +207,7 @@ class SpringApplicationShutdownHook implements Runnable {
/**
* {@link ApplicationListener} to track closed contexts.
*/
private class ApplicationContextClosedListener implements ApplicationListener<ContextClosedEvent> {
private final class ApplicationContextClosedListener implements ApplicationListener<ContextClosedEvent> {
@Override
public void onApplicationEvent(ContextClosedEvent event) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2024 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.
@@ -117,7 +117,7 @@ class SpringBootExceptionHandler implements UncaughtExceptionHandler {
/**
* Thread local used to attach and track handlers.
*/
private static class LoggedExceptionHandlerThreadLocal extends ThreadLocal<SpringBootExceptionHandler> {
private static final class LoggedExceptionHandlerThreadLocal extends ThreadLocal<SpringBootExceptionHandler> {
@Override
protected SpringBootExceptionHandler initialValue() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2024 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.
@@ -137,7 +137,7 @@ public class SpringApplicationAdminMXBeanRegistrar implements ApplicationContext
ManagementFactory.getPlatformMBeanServer().unregisterMBean(this.objectName);
}
private class SpringApplicationAdmin implements SpringApplicationAdminMXBean {
private final class SpringApplicationAdmin implements SpringApplicationAdminMXBean {
@Override
public boolean isReady() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2024 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.
@@ -60,7 +60,7 @@ public class ParentContextApplicationContextInitializer
}
}
private static class EventPublisher implements ApplicationListener<ContextRefreshedEvent>, Ordered {
private static final class EventPublisher implements ApplicationListener<ContextRefreshedEvent>, Ordered {
private static final EventPublisher INSTANCE = new EventPublisher();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -140,7 +140,7 @@ class EventPublishingRunListener implements SpringApplicationRunListener, Ordere
this.application.getListeners().forEach(this.initialMulticaster::addApplicationListener);
}
private static class LoggingErrorHandler implements ErrorHandler {
private static final class LoggingErrorHandler implements ErrorHandler {
private static final Log logger = LogFactory.getLog(EventPublishingRunListener.class);

View File

@@ -457,7 +457,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
this.parseArgs = parseArgs;
}
private class Lifecycle implements SmartLifecycle {
private final class Lifecycle implements SmartLifecycle {
private volatile boolean running;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -341,7 +341,7 @@ public class BindableRuntimeHintsRegistrar implements RuntimeHintsRegistrar {
/**
* Inner class to avoid a hard dependency on Kotlin at runtime.
*/
private static class KotlinDelegate {
private static final class KotlinDelegate {
static void handleConstructor(ReflectionHints hints, Constructor<?> constructor) {
KClass<?> kClass = JvmClassMappingKt.getKotlinClass(constructor.getDeclaringClass());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -169,7 +169,7 @@ class OriginTrackedYamlLoader extends YamlProcessor {
/**
* {@link Resolver} that limits {@link Tag#TIMESTAMP} tags.
*/
private static class NoTimestampResolver extends Resolver {
private static final class NoTimestampResolver extends Resolver {
@Override
public void addImplicitResolver(Tag tag, Pattern regexp, String first, int limit) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2024 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.
@@ -102,7 +102,7 @@ public final class DataSourceUnwrapper {
return null;
}
private static class DelegatingDataSourceUnwrapper {
private static final class DelegatingDataSourceUnwrapper {
private static DataSource getTargetDataSource(DataSource dataSource) {
if (dataSource instanceof DelegatingDataSource delegatingDataSource) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -191,7 +191,7 @@ public enum EmbeddedDatabaseConnection {
/**
* {@link ConnectionCallback} to determine if a connection is embedded.
*/
private static class IsEmbedded implements ConnectionCallback<Boolean> {
private static final class IsEmbedded implements ConnectionCallback<Boolean> {
@Override
public Boolean doInConnection(Connection connection) throws SQLException, DataAccessException {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2024 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.
@@ -68,11 +68,11 @@ public class JacksonJsonParser extends AbstractJsonParser {
return this.objectMapper;
}
private static class MapTypeReference extends TypeReference<Map<String, Object>> {
private static final class MapTypeReference extends TypeReference<Map<String, Object>> {
}
private static class ListTypeReference extends TypeReference<List<Object>> {
private static final class ListTypeReference extends TypeReference<List<Object>> {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -342,7 +342,7 @@ public final class LambdaSafe {
* {@link Filter} that matches when the callback has a single generic and primary
* argument is an instance of it.
*/
private static class GenericTypeFilter<C, A> implements Filter<C, A> {
private static final class GenericTypeFilter<C, A> implements Filter<C, A> {
@Override
public boolean match(Class<C> callbackType, C callbackInstance, A argument, Object[] additionalArguments) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -98,7 +98,7 @@ class JasperInitializer extends AbstractLifeCycle {
/**
* {@link URLStreamHandlerFactory} to support {@literal war} protocol.
*/
private static class WarUrlStreamHandlerFactory implements URLStreamHandlerFactory {
private static final class WarUrlStreamHandlerFactory implements URLStreamHandlerFactory {
@Override
public URLStreamHandler createURLStreamHandler(String protocol) {
@@ -115,7 +115,7 @@ class JasperInitializer extends AbstractLifeCycle {
* {@link URL urls} produced by
* {@link org.apache.tomcat.util.scan.JarFactory#getJarEntryURL(URL, String)}.
*/
private static class WarUrlStreamHandler extends URLStreamHandler {
private static final class WarUrlStreamHandler extends URLStreamHandler {
@Override
protected void parseURL(URL u, String spec, int start, int limit) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -42,7 +42,7 @@ class JettyEmbeddedWebAppContext extends WebAppContext {
((JettyEmbeddedServletHandler) getServletHandler()).deferredInitialize();
}
private static class JettyEmbeddedServletHandler extends ServletHandler {
private static final class JettyEmbeddedServletHandler extends ServletHandler {
@Override
public void initialize() throws Exception {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -777,7 +777,7 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
* {@link LifecycleListener} is used so not to interfere with Tomcat's default manager
* creation logic.
*/
private static class DisablePersistSessionListener implements LifecycleListener {
private static final class DisablePersistSessionListener implements LifecycleListener {
@Override
public void lifecycleEvent(LifecycleEvent event) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -285,7 +285,7 @@ public class ServletContextInitializerBeans extends AbstractCollection<ServletCo
/**
* {@link RegistrationBeanAdapter} for {@link Filter} beans.
*/
private static class FilterRegistrationBeanAdapter implements RegistrationBeanAdapter<Filter> {
private static final class FilterRegistrationBeanAdapter implements RegistrationBeanAdapter<Filter> {
@Override
public RegistrationBean createRegistrationBean(String name, Filter source, int totalNumberOfSourceBeans) {
@@ -299,7 +299,8 @@ public class ServletContextInitializerBeans extends AbstractCollection<ServletCo
/**
* {@link RegistrationBeanAdapter} for certain {@link EventListener} beans.
*/
private static class ServletListenerRegistrationBeanAdapter implements RegistrationBeanAdapter<EventListener> {
private static final class ServletListenerRegistrationBeanAdapter
implements RegistrationBeanAdapter<EventListener> {
@Override
public RegistrationBean createRegistrationBean(String name, EventListener source,

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -275,7 +275,7 @@ class DefaultBootstrapContextTests {
assertThat(supplier.get(null)).isEqualTo("test");
}
private static class TestCloseListener
private static final class TestCloseListener
implements ApplicationListener<BootstrapContextClosedEvent>, AssertProvider<CloseListenerAssert> {
private int called;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -129,7 +129,7 @@ class InactiveConfigDataAccessExceptionTests {
+ "cannot contain property 'spring' [origin: \"spring\" from property source \"mockProperties\"]");
}
private static class TestConfigDataResource extends ConfigDataResource {
private static final class TestConfigDataResource extends ConfigDataResource {
@Override
public String toString() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -149,7 +149,7 @@ class InvalidConfigDataPropertyExceptionTests {
InvalidConfigDataPropertyException.throwIfPropertyFound(contributor);
}
private static class TestConfigDataResource extends ConfigDataResource {
private static final class TestConfigDataResource extends ConfigDataResource {
@Override
public String toString() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -107,11 +107,11 @@ class ConversionServiceDeducerTests {
}
private static class TestApplicationConversionService extends ApplicationConversionService {
private static final class TestApplicationConversionService extends ApplicationConversionService {
}
private static class TestConverter implements Converter<InputStream, OutputStream> {
private static final class TestConverter implements Converter<InputStream, OutputStream> {
@Override
public OutputStream convert(InputStream source) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2024 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.
@@ -94,7 +94,7 @@ public class MockConfigurationPropertySource implements IterableConfigurationPro
return this.map.get(name);
}
private class NonIterable implements ConfigurationPropertySource {
private final class NonIterable implements ConfigurationPropertySource {
@Override
public Object getUnderlyingSource() {

View File

@@ -333,7 +333,7 @@ class ConnectionFactoryBuilderTests {
}
private static class MyConnectionFactory implements ConnectionFactory {
private static final class MyConnectionFactory implements ConnectionFactory {
@Override
public Publisher<? extends Connection> create() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -217,7 +217,7 @@ class ApplicationContextRequestMatcherTests {
}
private static class AssertingUncaughtExceptionHandler implements UncaughtExceptionHandler {
private static final class AssertingUncaughtExceptionHandler implements UncaughtExceptionHandler {
private volatile Throwable ex;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -576,7 +576,7 @@ class JettyServletWebServerFactoryTests extends AbstractServletWebServerFactoryT
throw new IllegalStateException("No WebAppContext found");
}
private static class CustomErrorHandler extends ErrorPageErrorHandler {
private static final class CustomErrorHandler extends ErrorPageErrorHandler {
}

View File

@@ -740,7 +740,7 @@ class TomcatServletWebServerFactoryTests extends AbstractServletWebServerFactory
return ((TomcatWebServer) this.webServer).getStartedLogMessage();
}
private static class RememberingHostnameVerifier implements HostnameVerifier {
private static final class RememberingHostnameVerifier implements HostnameVerifier {
private volatile String lastPrincipal;

View File

@@ -1574,7 +1574,7 @@ public abstract class AbstractServletWebServerFactoryTests {
protected abstract String startedLogMessage();
private class TestGzipInputStreamFactory implements InputStreamFactory {
private final class TestGzipInputStreamFactory implements InputStreamFactory {
private final AtomicBoolean requested = new AtomicBoolean();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@@ -252,7 +252,7 @@ class SpringBootServletInitializerTests {
}
private class CustomSpringBootServletInitializer extends MockSpringBootServletInitializer {
private final class CustomSpringBootServletInitializer extends MockSpringBootServletInitializer {
private final CustomSpringApplicationBuilder applicationBuilder = new CustomSpringApplicationBuilder();