mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-05-02 19:30:23 +01:00
Polish
This commit is contained in:
+3
-1
@@ -31,6 +31,7 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.ArgumentsProvider;
|
||||
import org.junit.jupiter.params.provider.ArgumentsSource;
|
||||
import org.junit.jupiter.params.support.ParameterDeclarations;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -244,7 +245,8 @@ class DependencyVersionUpgradeTests {
|
||||
static class InputProvider implements ArgumentsProvider {
|
||||
|
||||
@Override
|
||||
public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
|
||||
public Stream<? extends Arguments> provideArguments(ParameterDeclarations parameterDeclarations,
|
||||
ExtensionContext context) {
|
||||
Method testMethod = context.getRequiredTestMethod();
|
||||
Stream<Arguments> artifactVersions = artifactVersions(testMethod)
|
||||
.map((artifactVersion) -> Arguments.of(VersionType.ARTIFACT_VERSION.parse(artifactVersion.current()),
|
||||
|
||||
+2
-2
@@ -40,14 +40,14 @@ import org.springframework.util.ObjectUtils;
|
||||
public class ParentContextCloserApplicationListener
|
||||
implements ApplicationListener<ParentContextAvailableEvent>, ApplicationContextAware, Ordered {
|
||||
|
||||
private static final int order = Ordered.LOWEST_PRECEDENCE - 10;
|
||||
private static final int ORDER = Ordered.LOWEST_PRECEDENCE - 10;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private ApplicationContext context;
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
return ORDER;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
-7
@@ -379,13 +379,6 @@ public class ApplicationConversionService extends FormattingConversionService {
|
||||
}
|
||||
}
|
||||
|
||||
private static <B, T> void addBean(FormatterRegistry registry, B bean, @Nullable ResolvableType beanType,
|
||||
Class<T> type, Consumer<B> standardRegistrar,
|
||||
BiFunction<B, @Nullable ResolvableType, BeanAdapter<?>> beanAdapterFactory) {
|
||||
addBean(registry, bean, beanType, type, standardRegistrar,
|
||||
() -> registry.addConverter(beanAdapterFactory.apply(bean, beanType)));
|
||||
}
|
||||
|
||||
private static <B, T> void addBeanWithType(FormatterRegistry registry, B bean, ResolvableType beanType,
|
||||
Class<T> type, Consumer<B> standardRegistrar,
|
||||
BiFunction<B, ResolvableType, BeanAdapter<?>> beanAdapterFactory) {
|
||||
|
||||
+4
-4
@@ -181,12 +181,12 @@ public final class RetryPolicySettings {
|
||||
|
||||
/**
|
||||
* Set the factory to use to create the {@link RetryPolicy}, or {@code null} to use
|
||||
* the default. The function takes a {@link RetryPolicy.Builder} initialized with the
|
||||
* state of this instance that can be further configured, or ignored to restart from
|
||||
* scratch.
|
||||
* the default. The function takes a {@link Builder RetryPolicy.Builder} initialized
|
||||
* with the state of this instance that can be further configured, or ignored to
|
||||
* restart from scratch.
|
||||
* @param factory a factory to customize the retry policy.
|
||||
*/
|
||||
public void setFactory(@Nullable Function<Builder, RetryPolicy> factory) {
|
||||
public void setFactory(@Nullable Function<RetryPolicy.Builder, RetryPolicy> factory) {
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -107,11 +107,11 @@ public class SimpleAsyncTaskExecutorBuilder {
|
||||
/**
|
||||
* Set whether to cancel remaining tasks on close. By default {@code false} not
|
||||
* tracking active threads at all or just interrupting any remaining threads that
|
||||
* still have not finished after the specified {@link #taskTerminationTimeout
|
||||
* taskTerminationTimeout}. Switch this to {@code true} for immediate interruption on
|
||||
* close, either in combination with a subsequent termination timeout or without any
|
||||
* waiting at all, depending on whether a {@code taskTerminationTimeout} has been
|
||||
* specified as well.
|
||||
* still have not finished after the specified
|
||||
* {@link #taskTerminationTimeout(Duration) taskTerminationTimeout}. Switch this to
|
||||
* {@code true} for immediate interruption on close, either in combination with a
|
||||
* subsequent termination timeout or without any waiting at all, depending on whether
|
||||
* a {@code taskTerminationTimeout} has been specified as well.
|
||||
* @param cancelRemainingTasksOnClose whether to cancel remaining tasks on close
|
||||
* @return a new builder instance
|
||||
* @since 4.0.0
|
||||
|
||||
+1
@@ -92,6 +92,7 @@ class BufferingApplicationStartupTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
void taggingShouldFailWhenEventAlreadyRecorded() {
|
||||
BufferingApplicationStartup applicationStartup = new BufferingApplicationStartup(2);
|
||||
StartupStep step = applicationStartup.start("first");
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import org.springframework.kafka.annotation.EnableKafkaStreams;
|
||||
public class MyKafkaStreamsConfiguration {
|
||||
|
||||
@Bean
|
||||
@SuppressWarnings("removal")
|
||||
@SuppressWarnings({ "deprecation", "removal" })
|
||||
public KStream<Integer, String> kStream(StreamsBuilder streamsBuilder) {
|
||||
KStream<Integer, String> stream = streamsBuilder.stream("ks1In");
|
||||
stream.map(this::uppercaseValue)
|
||||
|
||||
+8
-4
@@ -16,8 +16,10 @@
|
||||
|
||||
package org.springframework.boot.actuate.info;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
@@ -99,11 +101,13 @@ public abstract class InfoPropertiesInfoContributor<T extends InfoProperties> im
|
||||
}
|
||||
|
||||
private Iterable<ConfigurationPropertySource> ensureNonNullContent(
|
||||
Iterable<@Nullable ConfigurationPropertySource> adapted) {
|
||||
for (ConfigurationPropertySource source : adapted) {
|
||||
Assert.state(source != null, "'source' must not be null");
|
||||
Iterable<@Nullable ConfigurationPropertySource> sources) {
|
||||
List<ConfigurationPropertySource> nonNullSources = new ArrayList<>(1);
|
||||
for (ConfigurationPropertySource source : sources) {
|
||||
Assert.notNull(source, "'source' must not be null");
|
||||
nonNullSources.add(source);
|
||||
}
|
||||
return (Iterable<ConfigurationPropertySource>) adapted;
|
||||
return nonNullSources;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
-7
@@ -32,7 +32,6 @@ import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.aot.hint.RuntimeHints;
|
||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
@@ -84,12 +83,6 @@ public final class GraphQlAutoConfiguration {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(GraphQlAutoConfiguration.class);
|
||||
|
||||
private final ListableBeanFactory beanFactory;
|
||||
|
||||
GraphQlAutoConfiguration(ListableBeanFactory beanFactory) {
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
GraphQlSource graphQlSource(ResourcePatternResolver resourcePatternResolver, GraphQlProperties properties,
|
||||
|
||||
+2
-3
@@ -21,7 +21,6 @@ import org.eclipse.jetty.http.HttpMethod;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.Response;
|
||||
import org.eclipse.jetty.server.handler.gzip.GzipHandler;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
|
||||
import org.springframework.boot.web.server.Compression;
|
||||
@@ -36,9 +35,9 @@ final class JettyHandlerWrappers {
|
||||
private JettyHandlerWrappers() {
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
@SuppressWarnings({ "deprecation", "removal" })
|
||||
static Handler.Wrapper createGzipHandlerWrapper(Compression compression) {
|
||||
GzipHandler handler = new GzipHandler();
|
||||
org.eclipse.jetty.server.handler.gzip.GzipHandler handler = new org.eclipse.jetty.server.handler.gzip.GzipHandler();
|
||||
handler.setMinGzipSize((int) compression.getMinResponseSize().toBytes());
|
||||
handler.setIncludedMimeTypes(compression.getMimeTypes());
|
||||
for (HttpMethod httpMethod : HttpMethod.values()) {
|
||||
|
||||
+1
-3
@@ -60,9 +60,7 @@ public class SampleWebSecureJdbcApplication implements WebMvcConfigurer {
|
||||
|
||||
@Bean
|
||||
public JdbcUserDetailsManager jdbcUserDetailsManager(DataSource dataSource) {
|
||||
JdbcUserDetailsManager jdbcUserDetailsManager = new JdbcUserDetailsManager();
|
||||
jdbcUserDetailsManager.setDataSource(dataSource);
|
||||
return jdbcUserDetailsManager;
|
||||
return new JdbcUserDetailsManager(dataSource);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user