Merge branch '2.7.x' into 3.0.x

This commit is contained in:
Phillip Webb
2023-02-21 23:15:40 -08:00
1890 changed files with 27173 additions and 21952 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 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.
@@ -73,7 +73,7 @@ public final class RemoteSpringApplication {
List<ApplicationListener<?>> listeners = new ArrayList<>();
listeners.add(new AnsiOutputApplicationListener());
listeners.add(EnvironmentPostProcessorApplicationListener
.with(EnvironmentPostProcessorsFactory.of(ConfigDataEnvironmentPostProcessor.class)));
.with(EnvironmentPostProcessorsFactory.of(ConfigDataEnvironmentPostProcessor.class)));
listeners.add(new LoggingApplicationListener());
listeners.add(new RemoteUrlPropertyExtractor());
return listeners;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 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.
@@ -189,8 +189,10 @@ public class DevToolsDataSourceAutoConfiguration {
BeanDefinition dataSourceDefinition = context.getRegistry().getBeanDefinition(dataSourceBeanNames[0]);
if (dataSourceDefinition instanceof AnnotatedBeanDefinition annotatedBeanDefinition
&& annotatedBeanDefinition.getFactoryMethodMetadata() != null
&& annotatedBeanDefinition.getFactoryMethodMetadata().getDeclaringClassName().startsWith(
DataSourceAutoConfiguration.class.getPackage().getName() + ".DataSourceConfiguration$")) {
&& annotatedBeanDefinition.getFactoryMethodMetadata()
.getDeclaringClassName()
.startsWith(DataSourceAutoConfiguration.class.getPackage().getName()
+ ".DataSourceConfiguration$")) {
return ConditionOutcome.match(message.foundExactly("auto-configured DataSource"));
}
return ConditionOutcome.noMatch(message.didNotFind("an auto-configured DataSource").atAll());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 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.
@@ -75,7 +75,8 @@ public class DevToolsR2dbcAutoConfiguration {
public void destroy() throws Exception {
if (shouldShutdown()) {
Mono.usingWhen(this.connectionFactory.create(), this::executeShutdown, this::closeConnection,
this::closeConnection, this::closeConnection).block();
this::closeConnection, this::closeConnection)
.block();
this.eventPublisher.publishEvent(new R2dbcDatabaseShutdownEvent(this.connectionFactory));
}
}
@@ -128,7 +129,7 @@ public class DevToolsR2dbcAutoConfiguration {
private boolean isAutoConfigured(AnnotatedBeanDefinition beanDefinition) {
MethodMetadata methodMetadata = beanDefinition.getFactoryMethodMetadata();
return methodMetadata != null && methodMetadata.getDeclaringClassName()
.startsWith(R2dbcAutoConfiguration.class.getPackage().getName());
.startsWith(R2dbcAutoConfiguration.class.getPackage().getName());
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 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.
@@ -70,7 +70,8 @@ public class ClassPathChangedEvent extends ApplicationEvent {
@Override
public String toString() {
return new ToStringCreator(this).append("changeSet", this.changeSet)
.append("restartRequired", this.restartRequired).toString();
.append("restartRequired", this.restartRequired)
.toString();
}
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2023 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.
@@ -134,7 +134,7 @@ public class DevToolsHomePropertiesPostProcessor implements EnvironmentPostProce
private boolean canLoadFileExtension(PropertySourceLoader loader, String name) {
return Arrays.stream(loader.getFileExtensions())
.anyMatch((fileExtension) -> StringUtils.endsWithIgnoreCase(name, fileExtension));
.anyMatch((fileExtension) -> StringUtils.endsWithIgnoreCase(name, fileExtension));
}
protected File getHomeDirectory() {

View File

@@ -135,7 +135,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
private static Map<String, Object> loadDefaultProperties() {
Properties properties = new Properties();
try (InputStream stream = DevToolsPropertyDefaultsPostProcessor.class
.getResourceAsStream("devtools-property-defaults.properties")) {
.getResourceAsStream("devtools-property-defaults.properties")) {
if (stream == null) {
throw new RuntimeException(
"Failed to load devtools-property-defaults.properties because it doesn't exist");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2023 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.
@@ -96,7 +96,8 @@ class Connection {
this.outputStream.writeHeaders("HTTP/1.1 101 Switching Protocols", "Upgrade: websocket", "Connection: Upgrade",
"Sec-WebSocket-Accept: " + accept);
new Frame("{\"command\":\"hello\",\"protocols\":[\"http://livereload.com/protocols/official-7\"],"
+ "\"serverName\":\"spring-boot\"}").write(this.outputStream);
+ "\"serverName\":\"spring-boot\"}")
.write(this.outputStream);
while (this.running) {
readWebSocketFrame();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 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.
@@ -95,7 +95,7 @@ public class RemoteClientConfiguration implements InitializingBean {
Proxy proxy = this.properties.getRemote().getProxy();
if (proxy.getHost() != null && proxy.getPort() != null) {
requestFactory
.setProxy(new java.net.Proxy(Type.HTTP, new InetSocketAddress(proxy.getHost(), proxy.getPort())));
.setProxy(new java.net.Proxy(Type.HTTP, new InetSocketAddress(proxy.getHost(), proxy.getPort())));
}
return new InterceptingClientHttpRequestFactory(requestFactory, interceptors);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 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.
@@ -106,7 +106,8 @@ final class ChangeableUrls implements Iterable<URL> {
return urlClassLoader.getURLs();
}
return Stream.of(ManagementFactory.getRuntimeMXBean().getClassPath().split(File.pathSeparator))
.map(ChangeableUrls::toURL).toArray(URL[]::new);
.map(ChangeableUrls::toURL)
.toArray(URL[]::new);
}
private static URL toURL(String classPathEntry) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2023 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.
@@ -74,7 +74,7 @@ final class ClassLoaderFilesResourcePatternResolver implements ResourcePatternRe
ClassLoaderFiles classLoaderFiles) {
this.classLoaderFiles = classLoaderFiles;
this.patternResolverDelegate = getResourcePatternResolverFactory()
.getResourcePatternResolver(applicationContext, retrieveResourceLoader(applicationContext));
.getResourcePatternResolver(applicationContext, retrieveResourceLoader(applicationContext));
}
private ResourceLoader retrieveResourceLoader(ApplicationContext applicationContext) {