From 86fbb8678a505520caf4d23cbacee647a6cb2bb6 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 10 Nov 2022 18:24:57 +0100 Subject: [PATCH 1/3] Use unquoted value in assertion message in MediaType.checkParameters() Closes gh-29461 --- .../src/main/java/org/springframework/http/MediaType.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/http/MediaType.java b/spring-web/src/main/java/org/springframework/http/MediaType.java index d3e83775109..a7a95ba66f0 100644 --- a/spring-web/src/main/java/org/springframework/http/MediaType.java +++ b/spring-web/src/main/java/org/springframework/http/MediaType.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -534,7 +534,7 @@ public class MediaType extends MimeType implements Serializable { String unquotedValue = unquote(value); double d = Double.parseDouble(unquotedValue); Assert.isTrue(d >= 0D && d <= 1D, - () -> "Invalid quality value \"" + value + "\": should be between 0.0 and 1.0"); + () -> "Invalid quality value \"" + unquotedValue + "\": should be between 0.0 and 1.0"); } } From 330d2a59822b9c36bc1d9e46d7d6623bfe101a30 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 10 Nov 2022 18:25:55 +0100 Subject: [PATCH 2/3] Upgrade to Reactor 2020.0.24 Includes Netty 4.1.85, Tomcat 9.0.68, Jetty 9.4.49, Jetty Reactive HttpClient 1.1.13, Undertow 2.2.21, SmallRye Mutiny 1.8, Log4J 2.19, OpenPDF 1.3.30, Mockito 4.8.1, HtmlUnit 2.66, Checkstyle 10.4 Closes gh-29464 --- build.gradle | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 44cf39549f8..ca0145b8fcf 100644 --- a/build.gradle +++ b/build.gradle @@ -28,18 +28,18 @@ configure(allprojects) { project -> dependencyManagement { imports { mavenBom "com.fasterxml.jackson:jackson-bom:2.12.7" - mavenBom "io.netty:netty-bom:4.1.82.Final" - mavenBom "io.projectreactor:reactor-bom:2020.0.23" + mavenBom "io.netty:netty-bom:4.1.85.Final" + mavenBom "io.projectreactor:reactor-bom:2020.0.24" mavenBom "io.r2dbc:r2dbc-bom:Arabba-SR13" mavenBom "io.rsocket:rsocket-bom:1.1.3" - mavenBom "org.eclipse.jetty:jetty-bom:9.4.48.v20220622" + mavenBom "org.eclipse.jetty:jetty-bom:9.4.49.v20220914" mavenBom "org.jetbrains.kotlin:kotlin-bom:1.5.32" mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.5.2" mavenBom "org.jetbrains.kotlinx:kotlinx-serialization-bom:1.2.2" mavenBom "org.junit:junit-bom:5.8.2" } dependencies { - dependencySet(group: 'org.apache.logging.log4j', version: '2.18.0') { + dependencySet(group: 'org.apache.logging.log4j', version: '2.19.0') { entry 'log4j-api' entry 'log4j-core' entry 'log4j-jul' @@ -68,7 +68,7 @@ configure(allprojects) { project -> dependency "io.reactivex:rxjava-reactive-streams:1.2.1" dependency "io.reactivex.rxjava2:rxjava:2.2.21" dependency "io.reactivex.rxjava3:rxjava:3.1.5" - dependency "io.smallrye.reactive:mutiny:1.7.0" + dependency "io.smallrye.reactive:mutiny:1.8.0" dependency "io.projectreactor.tools:blockhound:1.0.6.RELEASE" dependency "com.caucho:hessian:4.0.63" @@ -96,7 +96,7 @@ configure(allprojects) { project -> dependency "com.h2database:h2:2.1.214" dependency "com.github.ben-manes.caffeine:caffeine:2.9.3" - dependency "com.github.librepdf:openpdf:1.3.29" + dependency "com.github.librepdf:openpdf:1.3.30" dependency "com.rometools:rome:1.18.0" dependency "commons-io:commons-io:2.5" dependency "io.vavr:vavr:0.10.4" @@ -128,18 +128,18 @@ configure(allprojects) { project -> dependency "org.webjars:webjars-locator-core:0.48" dependency "org.webjars:underscorejs:1.8.3" - dependencySet(group: 'org.apache.tomcat', version: '9.0.65') { + dependencySet(group: 'org.apache.tomcat', version: '9.0.68') { entry 'tomcat-util' entry('tomcat-websocket') { exclude group: "org.apache.tomcat", name: "tomcat-servlet-api" exclude group: "org.apache.tomcat", name: "tomcat-websocket-api" } } - dependencySet(group: 'org.apache.tomcat.embed', version: '9.0.65') { + dependencySet(group: 'org.apache.tomcat.embed', version: '9.0.68') { entry 'tomcat-embed-core' entry 'tomcat-embed-websocket' } - dependencySet(group: 'io.undertow', version: '2.2.19.Final') { + dependencySet(group: 'io.undertow', version: '2.2.21.Final') { entry 'undertow-core' entry('undertow-servlet') { exclude group: "org.jboss.spec.javax.servlet", name: "jboss-servlet-api_4.0_spec" @@ -150,7 +150,7 @@ configure(allprojects) { project -> } } - dependency "org.eclipse.jetty:jetty-reactive-httpclient:1.1.12" + dependency "org.eclipse.jetty:jetty-reactive-httpclient:1.1.13" dependency 'org.apache.httpcomponents.client5:httpclient5:5.1.3' dependency 'org.apache.httpcomponents.core5:httpcore5-reactive:5.1.3' dependency("org.apache.httpcomponents:httpclient:4.5.13") { @@ -198,7 +198,7 @@ configure(allprojects) { project -> exclude group: "org.hamcrest", name: "hamcrest-core" } } - dependencySet(group: 'org.mockito', version: '4.6.1') { + dependencySet(group: 'org.mockito', version: '4.8.1') { entry('mockito-core') { exclude group: "org.hamcrest", name: "hamcrest-core" } @@ -206,10 +206,10 @@ configure(allprojects) { project -> } dependency "io.mockk:mockk:1.12.1" - dependency("net.sourceforge.htmlunit:htmlunit:2.64.0") { + dependency("net.sourceforge.htmlunit:htmlunit:2.66.0") { exclude group: "commons-logging", name: "commons-logging" } - dependency("org.seleniumhq.selenium:htmlunit-driver:2.64.0") { + dependency("org.seleniumhq.selenium:htmlunit-driver:2.66.0") { exclude group: "commons-logging", name: "commons-logging" } dependency("org.seleniumhq.selenium:selenium-java:3.141.59") { @@ -340,7 +340,7 @@ configure([rootProject] + javaProjects) { project -> } checkstyle { - toolVersion = "10.3.4" + toolVersion = "10.4" configDirectory.set(rootProject.file("src/checkstyle")) } From d7d44c6c514f8e0ad46fb527f68cbcc9325b2f9e Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 10 Nov 2022 18:26:49 +0100 Subject: [PATCH 3/3] Polishing --- .../core/annotation/AnnotatedElementUtils.java | 12 +++++------- .../mock/web/MockHttpServletRequest.java | 4 ++-- .../mock/web/MockHttpServletResponse.java | 2 +- .../testfixture/servlet/MockHttpServletRequest.java | 4 ++-- .../testfixture/servlet/MockHttpServletResponse.java | 2 +- .../AbstractTyrusRequestUpgradeStrategy.java | 4 ++-- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java index 40c006b5e9d..1ac4f84a5e8 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java @@ -780,7 +780,7 @@ public abstract class AnnotatedElementUtils { if (containerType == null) { // Invoke RepeatableContainers.of() in order to adhere to the contract of // getMergedRepeatableAnnotations() which states that an IllegalArgumentException - // will be thrown if the the container cannot be resolved. + // will be thrown if the container cannot be resolved. // // In any case, we use standardRepeatables() in order to support repeatable // annotations on other types of repeatable annotations (i.e., nested repeatable @@ -807,7 +807,7 @@ public abstract class AnnotatedElementUtils { if (containerType == null) { // Invoke RepeatableContainers.of() in order to adhere to the contract of // findMergedRepeatableAnnotations() which states that an IllegalArgumentException - // will be thrown if the the container cannot be resolved. + // will be thrown if the container cannot be resolved. // // In any case, we use standardRepeatables() in order to support repeatable // annotations on other types of repeatable annotations (i.e., nested repeatable @@ -829,8 +829,7 @@ public abstract class AnnotatedElementUtils { } private static Comparator> highAggregateIndexesFirst() { - return Comparator.> comparingInt( - MergedAnnotation::getAggregateIndex).reversed(); + return Comparator.> comparingInt(MergedAnnotation::getAggregateIndex).reversed(); } @Nullable @@ -840,13 +839,12 @@ public abstract class AnnotatedElementUtils { if (!annotation.isPresent()) { return null; } - return annotation.asAnnotationAttributes( - Adapt.values(classValuesAsString, nestedAnnotationsAsMap)); + return annotation.asAnnotationAttributes(Adapt.values(classValuesAsString, nestedAnnotationsAsMap)); } /** - * Adapted {@link AnnotatedElement} that hold specific annotations. + * Adapted {@link AnnotatedElement} that holds specific annotations. */ private static class AnnotatedElementForAnnotations implements AnnotatedElement { diff --git a/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java b/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java index e12c278baca..f34a6bda5fe 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java +++ b/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,7 @@ import org.springframework.util.StringUtils; * is {@link Locale#ENGLISH}. This value can be changed via {@link #addPreferredLocale} * or {@link #setPreferredLocales}. * - *

As of Spring Framework 5.0, this set of mocks is designed on a Servlet 4.0 baseline. + *

As of Spring 5.0, this set of mocks is designed on a Servlet 4.0 baseline. * * @author Juergen Hoeller * @author Rod Johnson diff --git a/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java b/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java index 50c28212e7e..caeddbb69da 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java +++ b/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java @@ -53,7 +53,7 @@ import org.springframework.web.util.WebUtils; /** * Mock implementation of the {@link javax.servlet.http.HttpServletResponse} interface. * - *

As of Spring Framework 5.0, this set of mocks is designed on a Servlet 4.0 baseline. + *

As of Spring 5.0, this set of mocks is designed on a Servlet 4.0 baseline. * * @author Juergen Hoeller * @author Rod Johnson diff --git a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletRequest.java b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletRequest.java index d9023c3ca1e..cd262536d6f 100644 --- a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletRequest.java +++ b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,7 @@ import org.springframework.util.StringUtils; * is {@link Locale#ENGLISH}. This value can be changed via {@link #addPreferredLocale} * or {@link #setPreferredLocales}. * - *

As of Spring Framework 5.0, this set of mocks is designed on a Servlet 4.0 baseline. + *

As of Spring 5.0, this set of mocks is designed on a Servlet 4.0 baseline. * * @author Juergen Hoeller * @author Rod Johnson diff --git a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletResponse.java b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletResponse.java index dc46769a197..82e80e191c9 100644 --- a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletResponse.java +++ b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletResponse.java @@ -53,7 +53,7 @@ import org.springframework.web.util.WebUtils; /** * Mock implementation of the {@link javax.servlet.http.HttpServletResponse} interface. * - *

As of Spring Framework 5.0, this set of mocks is designed on a Servlet 4.0 baseline. + *

As of Spring 5.0, this set of mocks is designed on a Servlet 4.0 baseline. * * @author Juergen Hoeller * @author Rod Johnson diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/AbstractTyrusRequestUpgradeStrategy.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/AbstractTyrusRequestUpgradeStrategy.java index b6406ac82b4..65ce0200c2d 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/AbstractTyrusRequestUpgradeStrategy.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/AbstractTyrusRequestUpgradeStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,7 +73,7 @@ public abstract class AbstractTyrusRequestUpgradeStrategy extends AbstractStanda private static final Constructor constructor; - private static boolean constructorWithBooleanArgument; + private static final boolean constructorWithBooleanArgument; private static final Method registerMethod;