Reformat code following spring-javaformat upgrade

This commit is contained in:
Phillip Webb
2023-02-21 22:49:23 -08:00
parent b93c9f7fec
commit df5898a146
1878 changed files with 27649 additions and 22403 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.
@@ -189,8 +189,9 @@ public class DevToolsDataSourceAutoConfiguration {
if (dataSourceDefinition instanceof AnnotatedBeanDefinition
&& ((AnnotatedBeanDefinition) dataSourceDefinition).getFactoryMethodMetadata() != null
&& ((AnnotatedBeanDefinition) dataSourceDefinition).getFactoryMethodMetadata()
.getDeclaringClassName().startsWith(DataSourceAutoConfiguration.class.getPackage().getName()
+ ".DataSourceConfiguration$")) {
.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.
@@ -50,8 +50,13 @@ class RemoteDevtoolsSecurityConfiguration {
@ConditionalOnMissingBean(org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.class)
@SuppressWarnings("deprecation")
SecurityFilterChain devtoolsSecurityFilterChain(HttpSecurity http) throws Exception {
http.requestMatcher(new AntPathRequestMatcher(this.url)).authorizeRequests().anyRequest().anonymous().and()
.csrf().disable();
http.requestMatcher(new AntPathRequestMatcher(this.url))
.authorizeRequests()
.anyRequest()
.anonymous()
.and()
.csrf()
.disable();
return http.build();
}

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

@@ -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.
@@ -65,7 +65,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
static {
Properties properties = new Properties();
try (InputStream stream = DevToolsPropertyDefaultsPostProcessor.class
.getResourceAsStream("devtools-property-defaults.properties")) {
.getResourceAsStream("devtools-property-defaults.properties")) {
properties.load(stream);
}
catch (IOException ex) {

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-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.
@@ -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-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.
@@ -106,7 +106,8 @@ final class ChangeableUrls implements Iterable<URL> {
return ((URLClassLoader) classLoader).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) {