Skip to content

Commit 5b960b2

Browse files
committed
Merge branch '3.4.x' into 3.5.x
2 parents 0ab3139 + f1957a9 commit 5b960b2

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/pulsar/PulsarReactiveAutoConfiguration.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,9 @@
7373
@Import(PulsarConfiguration.class)
7474
public class PulsarReactiveAutoConfiguration {
7575

76-
private final PulsarProperties properties;
77-
7876
private final PulsarReactivePropertiesMapper propertiesMapper;
7977

8078
PulsarReactiveAutoConfiguration(PulsarProperties properties) {
81-
this.properties = properties;
8279
this.propertiesMapper = new PulsarReactivePropertiesMapper(properties);
8380
}
8481

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/EmbeddedWebServerFactoryCustomizerAutoConfiguration.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ public JettyWebServerFactoryCustomizer jettyWebServerFactoryCustomizer(Environme
9191

9292
@Bean
9393
@ConditionalOnThreading(Threading.VIRTUAL)
94-
JettyVirtualThreadsWebServerFactoryCustomizer jettyVirtualThreadsWebServerFactoryCustomizer(
95-
ServerProperties serverProperties) {
96-
return new JettyVirtualThreadsWebServerFactoryCustomizer(serverProperties);
94+
JettyVirtualThreadsWebServerFactoryCustomizer jettyVirtualThreadsWebServerFactoryCustomizer() {
95+
return new JettyVirtualThreadsWebServerFactoryCustomizer();
9796
}
9897

9998
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyVirtualThreadsWebServerFactoryCustomizer.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,18 @@
3535
public class JettyVirtualThreadsWebServerFactoryCustomizer
3636
implements WebServerFactoryCustomizer<ConfigurableJettyWebServerFactory>, Ordered {
3737

38-
private final ServerProperties serverProperties;
38+
public JettyVirtualThreadsWebServerFactoryCustomizer() {
3939

40+
}
41+
42+
/**
43+
* Create a new JettyVirtualThreadsWebServerFactoryCustomizer.
44+
* @param serverProperties server properties
45+
* @deprecated since 3.4.12 for removal in 4.0.0 in favor of
46+
* {@link JettyVirtualThreadsWebServerFactoryCustomizer}.
47+
*/
48+
@Deprecated(since = "3.4.12", forRemoval = true)
4049
public JettyVirtualThreadsWebServerFactoryCustomizer(ServerProperties serverProperties) {
41-
this.serverProperties = serverProperties;
4250
}
4351

4452
@Override

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/JettyVirtualThreadsWebServerFactoryCustomizerTests.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.junit.jupiter.api.condition.EnabledForJreRange;
2222
import org.junit.jupiter.api.condition.JRE;
2323

24-
import org.springframework.boot.autoconfigure.web.ServerProperties;
2524
import org.springframework.boot.web.embedded.jetty.ConfigurableJettyWebServerFactory;
2625

2726
import static org.assertj.core.api.Assertions.assertThat;
@@ -39,9 +38,7 @@ class JettyVirtualThreadsWebServerFactoryCustomizerTests {
3938
@Test
4039
@EnabledForJreRange(min = JRE.JAVA_21)
4140
void shouldConfigureVirtualThreads() {
42-
ServerProperties properties = new ServerProperties();
43-
JettyVirtualThreadsWebServerFactoryCustomizer customizer = new JettyVirtualThreadsWebServerFactoryCustomizer(
44-
properties);
41+
JettyVirtualThreadsWebServerFactoryCustomizer customizer = new JettyVirtualThreadsWebServerFactoryCustomizer();
4542
ConfigurableJettyWebServerFactory factory = mock(ConfigurableJettyWebServerFactory.class);
4643
customizer.customize(factory);
4744
then(factory).should().setThreadPool(assertArg((threadPool) -> {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
import org.springframework.util.Assert;
6868
import org.springframework.util.StreamUtils;
6969
import org.springframework.util.StringUtils;
70+
import org.springframework.util.function.ThrowingSupplier;
7071

7172
/**
7273
* A {@link CopyAction} for creating a Spring Boot zip archive (typically a jar or war).
@@ -349,7 +350,7 @@ private void writeJarToolsIfNecessary() throws IOException {
349350
private void writeJarModeLibrary(String location, JarModeLibrary library) throws IOException {
350351
String name = location + library.getName();
351352
writeEntry(name, ZipEntryContentWriter.fromInputStream(library.openStream()), false,
352-
(entry) -> prepareStoredEntry(library.openStream(), false, entry));
353+
(entry) -> prepareStoredEntry(library::openStream, false, entry));
353354
if (BootZipCopyAction.this.layerResolver != null) {
354355
Layer layer = BootZipCopyAction.this.layerResolver.getLayer(library);
355356
this.layerIndex.add(layer, name);
@@ -447,12 +448,12 @@ private void prepareEntry(ZipArchiveEntry entry, String name, Long time, int mod
447448
}
448449

449450
private void prepareStoredEntry(FileCopyDetails details, ZipArchiveEntry archiveEntry) throws IOException {
450-
prepareStoredEntry(details.open(), BootZipCopyAction.this.requiresUnpack.isSatisfiedBy(details),
451+
prepareStoredEntry(details::open, BootZipCopyAction.this.requiresUnpack.isSatisfiedBy(details),
451452
archiveEntry);
452453
}
453454

454-
private void prepareStoredEntry(InputStream input, boolean unpack, ZipArchiveEntry archiveEntry)
455-
throws IOException {
455+
private void prepareStoredEntry(ThrowingSupplier<InputStream> input, boolean unpack,
456+
ZipArchiveEntry archiveEntry) throws IOException {
456457
new StoredEntryPreparator(input, unpack).prepareStoredEntry(archiveEntry);
457458
}
458459

@@ -578,10 +579,10 @@ private static class StoredEntryPreparator {
578579

579580
private long size;
580581

581-
StoredEntryPreparator(InputStream inputStream, boolean unpack) throws IOException {
582+
StoredEntryPreparator(ThrowingSupplier<InputStream> input, boolean unpack) throws IOException {
582583
this.messageDigest = (unpack) ? sha1Digest() : null;
583-
try (inputStream) {
584-
load(inputStream);
584+
try (InputStream stream = input.get()) {
585+
load(stream);
585586
}
586587
}
587588

0 commit comments

Comments
 (0)