Skip to content

Commit 51b606e

Browse files
committed
Polish
1 parent c5e28c9 commit 51b606e

File tree

11 files changed

+27
-37
lines changed

11 files changed

+27
-37
lines changed

buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/DependencyVersionUpgradeTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.junit.jupiter.params.provider.Arguments;
3232
import org.junit.jupiter.params.provider.ArgumentsProvider;
3333
import org.junit.jupiter.params.provider.ArgumentsSource;
34+
import org.junit.jupiter.params.support.ParameterDeclarations;
3435

3536
import static org.assertj.core.api.Assertions.assertThat;
3637

@@ -244,7 +245,8 @@ void isUpgradeWhenReleaseTrainToSnapshotAndMovingToSnapshotsShouldReturnTrue(Dep
244245
static class InputProvider implements ArgumentsProvider {
245246

246247
@Override
247-
public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
248+
public Stream<? extends Arguments> provideArguments(ParameterDeclarations parameterDeclarations,
249+
ExtensionContext context) {
248250
Method testMethod = context.getRequiredTestMethod();
249251
Stream<Arguments> artifactVersions = artifactVersions(testMethod)
250252
.map((artifactVersion) -> Arguments.of(VersionType.ARTIFACT_VERSION.parse(artifactVersion.current()),

core/spring-boot/src/main/java/org/springframework/boot/builder/ParentContextCloserApplicationListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@
4040
public class ParentContextCloserApplicationListener
4141
implements ApplicationListener<ParentContextAvailableEvent>, ApplicationContextAware, Ordered {
4242

43-
private static final int order = Ordered.LOWEST_PRECEDENCE - 10;
43+
private static final int ORDER = Ordered.LOWEST_PRECEDENCE - 10;
4444

4545
@SuppressWarnings("NullAway.Init")
4646
private ApplicationContext context;
4747

4848
@Override
4949
public int getOrder() {
50-
return this.order;
50+
return ORDER;
5151
}
5252

5353
@Override

core/spring-boot/src/main/java/org/springframework/boot/convert/ApplicationConversionService.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,13 +379,6 @@ else if (bean instanceof Parser<?> parserBean) {
379379
}
380380
}
381381

382-
private static <B, T> void addBean(FormatterRegistry registry, B bean, @Nullable ResolvableType beanType,
383-
Class<T> type, Consumer<B> standardRegistrar,
384-
BiFunction<B, @Nullable ResolvableType, BeanAdapter<?>> beanAdapterFactory) {
385-
addBean(registry, bean, beanType, type, standardRegistrar,
386-
() -> registry.addConverter(beanAdapterFactory.apply(bean, beanType)));
387-
}
388-
389382
private static <B, T> void addBeanWithType(FormatterRegistry registry, B bean, ResolvableType beanType,
390383
Class<T> type, Consumer<B> standardRegistrar,
391384
BiFunction<B, ResolvableType, BeanAdapter<?>> beanAdapterFactory) {

core/spring-boot/src/main/java/org/springframework/boot/retry/RetryPolicySettings.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ public void setMaxDelay(Duration maxDelay) {
181181

182182
/**
183183
* Set the factory to use to create the {@link RetryPolicy}, or {@code null} to use
184-
* the default. The function takes a {@link RetryPolicy.Builder} initialized with the
185-
* state of this instance that can be further configured, or ignored to restart from
186-
* scratch.
184+
* the default. The function takes a {@link Builder RetryPolicy.Builder} initialized
185+
* with the state of this instance that can be further configured, or ignored to
186+
* restart from scratch.
187187
* @param factory a factory to customize the retry policy.
188188
*/
189-
public void setFactory(@Nullable Function<Builder, RetryPolicy> factory) {
189+
public void setFactory(@Nullable Function<RetryPolicy.Builder, RetryPolicy> factory) {
190190
this.factory = factory;
191191
}
192192

core/spring-boot/src/main/java/org/springframework/boot/task/SimpleAsyncTaskExecutorBuilder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ public SimpleAsyncTaskExecutorBuilder virtualThreads(@Nullable Boolean virtualTh
107107
/**
108108
* Set whether to cancel remaining tasks on close. By default {@code false} not
109109
* tracking active threads at all or just interrupting any remaining threads that
110-
* still have not finished after the specified {@link #taskTerminationTimeout
111-
* taskTerminationTimeout}. Switch this to {@code true} for immediate interruption on
112-
* close, either in combination with a subsequent termination timeout or without any
113-
* waiting at all, depending on whether a {@code taskTerminationTimeout} has been
114-
* specified as well.
110+
* still have not finished after the specified
111+
* {@link #taskTerminationTimeout(Duration) taskTerminationTimeout}. Switch this to
112+
* {@code true} for immediate interruption on close, either in combination with a
113+
* subsequent termination timeout or without any waiting at all, depending on whether
114+
* a {@code taskTerminationTimeout} has been specified as well.
115115
* @param cancelRemainingTasksOnClose whether to cancel remaining tasks on close
116116
* @return a new builder instance
117117
* @since 4.0.0

core/spring-boot/src/test/java/org/springframework/boot/context/metrics/buffering/BufferingApplicationStartupTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ void startRecordingShouldFailIfEventsWereRecorded() {
9292
}
9393

9494
@Test
95+
@SuppressWarnings("resource")
9596
void taggingShouldFailWhenEventAlreadyRecorded() {
9697
BufferingApplicationStartup applicationStartup = new BufferingApplicationStartup(2);
9798
StartupStep step = applicationStartup.start("first");

documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/kafka/streams/MyKafkaStreamsConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
public class MyKafkaStreamsConfiguration {
3434

3535
@Bean
36-
@SuppressWarnings("removal")
36+
@SuppressWarnings({ "deprecation", "removal" })
3737
public KStream<Integer, String> kStream(StreamsBuilder streamsBuilder) {
3838
KStream<Integer, String> stream = streamsBuilder.stream("ks1In");
3939
stream.map(this::uppercaseValue)

module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/InfoPropertiesInfoContributor.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616

1717
package org.springframework.boot.actuate.info;
1818

19+
import java.util.ArrayList;
1920
import java.util.Collections;
2021
import java.util.LinkedHashMap;
22+
import java.util.List;
2123
import java.util.Map;
2224
import java.util.Properties;
2325

@@ -99,11 +101,13 @@ protected Map<String, Object> extractContent(PropertySource<?> propertySource) {
99101
}
100102

101103
private Iterable<ConfigurationPropertySource> ensureNonNullContent(
102-
Iterable<@Nullable ConfigurationPropertySource> adapted) {
103-
for (ConfigurationPropertySource source : adapted) {
104-
Assert.state(source != null, "'source' must not be null");
104+
Iterable<@Nullable ConfigurationPropertySource> sources) {
105+
List<ConfigurationPropertySource> nonNullSources = new ArrayList<>(1);
106+
for (ConfigurationPropertySource source : sources) {
107+
Assert.notNull(source, "'source' must not be null");
108+
nonNullSources.add(source);
105109
}
106-
return (Iterable<ConfigurationPropertySource>) adapted;
110+
return nonNullSources;
107111
}
108112

109113
/**

module/spring-boot-graphql/src/main/java/org/springframework/boot/graphql/autoconfigure/GraphQlAutoConfiguration.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
import org.springframework.aot.hint.RuntimeHints;
3434
import org.springframework.aot.hint.RuntimeHintsRegistrar;
35-
import org.springframework.beans.factory.ListableBeanFactory;
3635
import org.springframework.beans.factory.ObjectProvider;
3736
import org.springframework.beans.factory.annotation.Qualifier;
3837
import org.springframework.boot.autoconfigure.AutoConfiguration;
@@ -84,12 +83,6 @@ public final class GraphQlAutoConfiguration {
8483

8584
private static final Log logger = LogFactory.getLog(GraphQlAutoConfiguration.class);
8685

87-
private final ListableBeanFactory beanFactory;
88-
89-
GraphQlAutoConfiguration(ListableBeanFactory beanFactory) {
90-
this.beanFactory = beanFactory;
91-
}
92-
9386
@Bean
9487
@ConditionalOnMissingBean
9588
GraphQlSource graphQlSource(ResourcePatternResolver resourcePatternResolver, GraphQlProperties properties,

module/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/JettyHandlerWrappers.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.eclipse.jetty.server.Handler;
2222
import org.eclipse.jetty.server.Request;
2323
import org.eclipse.jetty.server.Response;
24-
import org.eclipse.jetty.server.handler.gzip.GzipHandler;
2524
import org.eclipse.jetty.util.Callback;
2625

2726
import org.springframework.boot.web.server.Compression;
@@ -36,9 +35,9 @@ final class JettyHandlerWrappers {
3635
private JettyHandlerWrappers() {
3736
}
3837

39-
@SuppressWarnings("removal")
38+
@SuppressWarnings({ "deprecation", "removal" })
4039
static Handler.Wrapper createGzipHandlerWrapper(Compression compression) {
41-
GzipHandler handler = new GzipHandler();
40+
org.eclipse.jetty.server.handler.gzip.GzipHandler handler = new org.eclipse.jetty.server.handler.gzip.GzipHandler();
4241
handler.setMinGzipSize((int) compression.getMinResponseSize().toBytes());
4342
handler.setIncludedMimeTypes(compression.getMimeTypes());
4443
for (HttpMethod httpMethod : HttpMethod.values()) {

0 commit comments

Comments
 (0)