From 62674de4728ad542a57e4c438eed1c20c3cde07c Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Thu, 6 Jul 2023 15:57:25 -0400 Subject: [PATCH] Skip int conversion in ClientHttpRequestFactories @poutsma added `JdkClientHttpRequestFactory.setReadTimeout(Duration)` so the conversion to and from int is no longer needed. See gh-36270 --- .../boot/web/client/ClientHttpRequestFactories.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/ClientHttpRequestFactories.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/ClientHttpRequestFactories.java index 0d9847c623..93e4e407c8 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/ClientHttpRequestFactories.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/ClientHttpRequestFactories.java @@ -285,7 +285,7 @@ public final class ClientHttpRequestFactories { java.net.http.HttpClient httpClient = createHttpClient(settings.connectTimeout(), settings.sslBundle()); JdkClientHttpRequestFactory requestFactory = new JdkClientHttpRequestFactory(httpClient); PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull(); - map.from(settings::readTimeout).asInt(Duration::toMillis).to(requestFactory::setReadTimeout); + map.from(settings::readTimeout).to(requestFactory::setReadTimeout); return requestFactory; }