From ac667a1e2b24baa432653603aba8ae81218f7006 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 2 Dec 2022 20:57:35 +0100 Subject: [PATCH] Upgrade to Apache HttpClient 5.2 Includes JRuby 9.4, Groovy 4.0.6, Hibernate ORM 5.6.14, HSQLDB 2.7.1, SLF4J 2.0.5, Caffeine 3.1.2, Gson 2.10, POI 5.2.3, Protobuf 3.21.10, WebJars Locator 0.52, HtmlUnit 2.67, Mockito 4.9, Checkstyle 10.5 Closes gh-29627 --- build.gradle | 2 +- framework-platform/framework-platform.gradle | 30 +++++++++---------- .../HttpComponentsClientHttpRequest.java | 1 + ...ttpComponentsClientHttpRequestFactory.java | 4 +-- ...pComponentsStreamingClientHttpRequest.java | 1 + 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/build.gradle b/build.gradle index 8f7736ee0e25..eb0882bf3755 100644 --- a/build.gradle +++ b/build.gradle @@ -78,7 +78,7 @@ configure([rootProject] + javaProjects) { project -> } checkstyle { - toolVersion = "10.4" + toolVersion = "10.5.0" configDirectory.set(rootProject.file("src/checkstyle")) } diff --git a/framework-platform/framework-platform.gradle b/framework-platform/framework-platform.gradle index 5d5a48e7c59f..f7e4428f8c6d 100644 --- a/framework-platform/framework-platform.gradle +++ b/framework-platform/framework-platform.gradle @@ -13,23 +13,23 @@ dependencies { api(platform("io.netty:netty5-bom:5.0.0.Alpha5")) api(platform("io.projectreactor:reactor-bom:2022.0.0")) api(platform("io.rsocket:rsocket-bom:1.1.3")) - api(platform("org.apache.groovy:groovy-bom:4.0.5")) + api(platform("org.apache.groovy:groovy-bom:4.0.6")) api(platform("org.apache.logging.log4j:log4j-bom:2.19.0")) api(platform("org.eclipse.jetty:jetty-bom:11.0.12")) api(platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4")) api(platform("org.jetbrains.kotlinx:kotlinx-serialization-bom:1.4.0")) api(platform("org.junit:junit-bom:5.9.1")) - api(platform("org.mockito:mockito-bom:4.8.1")) + api(platform("org.mockito:mockito-bom:4.9.0")) constraints { - api("com.fasterxml.woodstox:woodstox-core:6.4.0") api("com.fasterxml:aalto-xml:1.3.1") - api("com.github.ben-manes.caffeine:caffeine:3.1.1") + api("com.fasterxml.woodstox:woodstox-core:6.4.0") + api("com.github.ben-manes.caffeine:caffeine:3.1.2") api("com.github.librepdf:openpdf:1.3.30") api("com.google.code.findbugs:findbugs:3.0.1") api("com.google.code.findbugs:jsr305:3.0.2") - api("com.google.code.gson:gson:2.9.1") - api("com.google.protobuf:protobuf-java-util:3.21.5") + api("com.google.code.gson:gson:2.10") + api("com.google.protobuf:protobuf-java-util:3.21.10") api("com.googlecode.protobuf-java-format:protobuf-java-format:1.4") api("com.h2database:h2:2.1.214") api("com.jayway.jsonpath:json-path:2.7.0") @@ -87,7 +87,7 @@ dependencies { api("jaxen:jaxen:1.2.0") api("junit:junit:4.13.2") api("net.sf.jopt-simple:jopt-simple:5.0.4") - api("net.sourceforge.htmlunit:htmlunit:2.66.0") + api("net.sourceforge.htmlunit:htmlunit:2.67.0") api("org.apache-extras.beanshell:bsh:2.0b6") api("org.apache.activemq:activemq-broker:5.16.2") api("org.apache.activemq:activemq-kahadb-store:5.16.2") @@ -96,9 +96,9 @@ dependencies { api("org.apache.derby:derby:10.16.1.1") api("org.apache.derby:derbyclient:10.16.1.1") api("org.apache.derby:derbytools:10.16.1.1") - api("org.apache.httpcomponents.client5:httpclient5:5.1.3") - api("org.apache.httpcomponents.core5:httpcore5-reactive:5.1.3") - api("org.apache.poi:poi-ooxml:5.2.2") + api("org.apache.httpcomponents.client5:httpclient5:5.2") + api("org.apache.httpcomponents.core5:httpcore5-reactive:5.2") + api("org.apache.poi:poi-ooxml:5.2.3") api("org.apache.tomcat.embed:tomcat-embed-core:10.1.1") api("org.apache.tomcat.embed:tomcat-embed-websocket:10.1.1") api("org.apache.tomcat:tomcat-util:10.1.1") @@ -124,11 +124,11 @@ dependencies { api("org.glassfish:jakarta.el:4.0.2") api("org.graalvm.sdk:graal-sdk:22.3.0") api("org.hamcrest:hamcrest:2.2") - api("org.hibernate:hibernate-core-jakarta:5.6.12.Final") + api("org.hibernate:hibernate-core-jakarta:5.6.14.Final") api("org.hibernate:hibernate-validator:7.0.5.Final") - api("org.hsqldb:hsqldb:2.7.0") + api("org.hsqldb:hsqldb:2.7.1") api("org.javamoney:moneta:1.4.2") - api("org.jruby:jruby:9.3.8.0") + api("org.jruby:jruby:9.4.0.0") api("org.junit.support:testng-engine:1.0.4") api("org.mozilla:rhino:1.7.11") api("org.ogce:xpp3:1.1.6") @@ -137,10 +137,10 @@ dependencies { api("org.seleniumhq.selenium:htmlunit-driver:2.66.0") api("org.seleniumhq.selenium:selenium-java:3.141.59") api("org.skyscreamer:jsonassert:1.5.0") - api("org.slf4j:slf4j-api:2.0.3") + api("org.slf4j:slf4j-api:2.0.5") api("org.testng:testng:7.6.1") api("org.webjars:underscorejs:1.8.3") - api("org.webjars:webjars-locator-core:0.48") + api("org.webjars:webjars-locator-core:0.52") api("org.xmlunit:xmlunit-assertj:2.9.0") api("org.xmlunit:xmlunit-matchers:2.9.0") api("org.yaml:snakeyaml:1.30") diff --git a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java index 17dc755a0bc3..12c4958838fb 100644 --- a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java @@ -82,6 +82,7 @@ HttpContext getHttpContext() { } + @SuppressWarnings("deprecation") // execute(ClassicHttpRequest, HttpContext) @Override protected ClientHttpResponse executeInternal(HttpHeaders headers, byte[] bufferedOutput) throws IOException { addHeaders(this.httpRequest, headers); diff --git a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.java b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.java index f7fe4ed69b01..f1bc8145d5b1 100644 --- a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.java +++ b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.java @@ -149,8 +149,7 @@ public void setConnectionRequestTimeout(int connectionRequestTimeout) { /** * As of version 6.0, setting this property has no effect. - * - *

To change the socket read timeout, use {@link SocketConfig.Builder#setSoTimeout(Timeout)}, + *

To change the socket read timeout, use {@link SocketConfig.Builder#setSoTimeout(Timeout)}, * supply the resulting {@link SocketConfig} to * {@link org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder#setDefaultSocketConfig(SocketConfig)}, * use the resulting connection manager for @@ -249,6 +248,7 @@ protected RequestConfig createRequestConfig(Object client) { * @return the merged request config * @since 4.2 */ + @SuppressWarnings("deprecation") // setConnectTimeout protected RequestConfig mergeRequestConfig(RequestConfig clientConfig) { if (this.connectTimeout == -1 && this.connectionRequestTimeout == -1) { // nothing to merge return clientConfig; diff --git a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsStreamingClientHttpRequest.java b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsStreamingClientHttpRequest.java index 708303eb66a7..9c12d187b4b1 100644 --- a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsStreamingClientHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsStreamingClientHttpRequest.java @@ -94,6 +94,7 @@ protected OutputStream getBodyInternal(HttpHeaders headers) { throw new UnsupportedOperationException("getBody not supported"); } + @SuppressWarnings("deprecation") // execute(ClassicHttpRequest, HttpContext) @Override protected ClientHttpResponse executeInternal(HttpHeaders headers) throws IOException { HttpComponentsClientHttpRequest.addHeaders(this.httpRequest, headers);