diff --git a/spring-context/src/test/java/org/springframework/scheduling/concurrent/AbstractSchedulingTaskExecutorTests.java b/spring-context/src/test/java/org/springframework/scheduling/concurrent/AbstractSchedulingTaskExecutorTests.java
index 5d817ee9e1..7d2746f90f 100644
--- a/spring-context/src/test/java/org/springframework/scheduling/concurrent/AbstractSchedulingTaskExecutorTests.java
+++ b/spring-context/src/test/java/org/springframework/scheduling/concurrent/AbstractSchedulingTaskExecutorTests.java
@@ -209,18 +209,10 @@ abstract class AbstractSchedulingTaskExecutorTests {
CompletableFuture> future1 = executor.submitCompletable(new TestTask(this.testName, -1));
CompletableFuture> future2 = executor.submitCompletable(new TestTask(this.testName, -1));
shutdownExecutor();
-
- try {
+ assertThatExceptionOfType(TimeoutException.class).isThrownBy(() -> {
future1.get(1000, TimeUnit.MILLISECONDS);
- }
- catch (Exception ex) {
- // ignore
- }
- Awaitility.await()
- .atMost(5, TimeUnit.SECONDS)
- .pollInterval(10, TimeUnit.MILLISECONDS)
- .untilAsserted(() -> assertThatExceptionOfType(TimeoutException.class)
- .isThrownBy(() -> future2.get(1000, TimeUnit.MILLISECONDS)));
+ future2.get(1000, TimeUnit.MILLISECONDS);
+ });
}
@Test
diff --git a/spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java b/spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java
index f219bea1f7..d37b21ef5f 100644
--- a/spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java
+++ b/spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java
@@ -182,10 +182,10 @@ public class SqlScriptsTestExecutionListener extends AbstractTestExecutionListen
@Override
public void processAheadOfTime(RuntimeHints runtimeHints, Class> testClass, ClassLoader classLoader) {
getSqlAnnotationsFor(testClass).forEach(sql ->
- registerClasspathResources(getScripts(sql, testClass, null, true), runtimeHints, classLoader));
+ registerClasspathResources(getScripts(sql, testClass, null, true), runtimeHints, classLoader));
getSqlMethods(testClass).forEach(testMethod ->
- getSqlAnnotationsFor(testMethod).forEach(sql ->
- registerClasspathResources(getScripts(sql, testClass, testMethod, false), runtimeHints, classLoader)));
+ getSqlAnnotationsFor(testMethod).forEach(sql ->
+ registerClasspathResources(getScripts(sql, testClass, testMethod, false), runtimeHints, classLoader)));
}
/**
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 f89063d8df..844996abb7 100644
--- a/spring-web/src/main/java/org/springframework/http/MediaType.java
+++ b/spring-web/src/main/java/org/springframework/http/MediaType.java
@@ -853,7 +853,7 @@ public class MediaType extends MimeType implements Serializable {
*
audio/basic == text/html
* audio/basic == audio/wave
* @param mediaTypes the list of media types to be sorted
- * @deprecated As of 6.0, in favor of {@link MimeTypeUtils#sortBySpecificity(List)}
+ * @deprecated as of 6.0, in favor of {@link MimeTypeUtils#sortBySpecificity(List)}
*/
@Deprecated(since = "6.0", forRemoval = true)
public static void sortBySpecificity(List mediaTypes) {
@@ -882,7 +882,7 @@ public class MediaType extends MimeType implements Serializable {
*
* @param mediaTypes the list of media types to be sorted
* @see #getQualityValue()
- * @deprecated As of 6.0, with no direct replacement
+ * @deprecated as of 6.0, with no direct replacement
*/
@Deprecated(since = "6.0", forRemoval = true)
public static void sortByQualityValue(List mediaTypes) {
@@ -895,9 +895,9 @@ public class MediaType extends MimeType implements Serializable {
/**
* Sorts the given list of {@code MediaType} objects by specificity as the
* primary criteria and quality value the secondary.
- * @deprecated As of 6.0, in favor of {@link MimeTypeUtils#sortBySpecificity(List)}
+ * @deprecated as of 6.0, in favor of {@link MimeTypeUtils#sortBySpecificity(List)}
*/
- @Deprecated(since = "6.0")
+ @Deprecated(since = "6.0", forRemoval = true)
public static void sortBySpecificityAndQuality(List mediaTypes) {
Assert.notNull(mediaTypes, "'mediaTypes' must not be null");
if (mediaTypes.size() > 1) {
@@ -908,7 +908,7 @@ public class MediaType extends MimeType implements Serializable {
/**
* Comparator used by {@link #sortByQualityValue(List)}.
- * @deprecated As of 6.0, with no direct replacement
+ * @deprecated as of 6.0, with no direct replacement
*/
@Deprecated(since = "6.0", forRemoval = true)
public static final Comparator QUALITY_VALUE_COMPARATOR = (mediaType1, mediaType2) -> {
@@ -948,7 +948,7 @@ public class MediaType extends MimeType implements Serializable {
/**
* Comparator used by {@link #sortBySpecificity(List)}.
- * @deprecated As of 6.0, with no direct replacement
+ * @deprecated as of 6.0, with no direct replacement
*/
@Deprecated(since = "6.0", forRemoval = true)
@SuppressWarnings("removal")
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultAsyncServerResponse.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultAsyncServerResponse.java
index c026e40d81..6db059f839 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultAsyncServerResponse.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultAsyncServerResponse.java
@@ -67,6 +67,7 @@ final class DefaultAsyncServerResponse extends ErrorHandlingServerResponse imple
this.timeout = timeout;
}
+
@Override
public ServerResponse block() {
try {
@@ -114,8 +115,8 @@ final class DefaultAsyncServerResponse extends ErrorHandlingServerResponse imple
}
}
- @Nullable
@Override
+ @Nullable
public ModelAndView writeTo(HttpServletRequest request, HttpServletResponse response, Context context)
throws ServletException, IOException {
@@ -169,6 +170,7 @@ final class DefaultAsyncServerResponse extends ErrorHandlingServerResponse imple
return result;
}
+
@SuppressWarnings({"rawtypes", "unchecked"})
public static AsyncServerResponse create(Object obj, @Nullable Duration timeout) {
Assert.notNull(obj, "Argument to async must not be null");
@@ -192,5 +194,4 @@ final class DefaultAsyncServerResponse extends ErrorHandlingServerResponse imple
throw new IllegalArgumentException("Asynchronous type not supported: " + obj.getClass());
}
-
}
diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/function/DefaultServerResponseBuilderTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/function/DefaultServerResponseBuilderTests.java
index 965a8233d1..5832ee575b 100644
--- a/spring-webmvc/src/test/java/org/springframework/web/servlet/function/DefaultServerResponseBuilderTests.java
+++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/function/DefaultServerResponseBuilderTests.java
@@ -54,6 +54,7 @@ class DefaultServerResponseBuilderTests {
static final ServerResponse.Context EMPTY_CONTEXT = Collections::emptyList;
+
@Test
@SuppressWarnings("removal")
void status() {
@@ -75,7 +76,6 @@ class DefaultServerResponseBuilderTests {
assertThat(result.cookies().getFirst("foo")).isEqualTo(cookie);
}
-
@Test
void ok() {
ServerResponse response = ServerResponse.ok().build();
diff --git a/spring-websocket/spring-websocket.gradle b/spring-websocket/spring-websocket.gradle
index 72df03b20d..95c9a3d0ff 100644
--- a/spring-websocket/spring-websocket.gradle
+++ b/spring-websocket/spring-websocket.gradle
@@ -16,13 +16,13 @@ dependencies {
exclude group: "org.apache.tomcat", module: "tomcat-servlet-api"
exclude group: "org.apache.tomcat", module: "tomcat-websocket-api"
}
- optional("org.eclipse.jetty.ee10:jetty-ee10-webapp") {
- exclude group: "jakarta.servlet", module: "jakarta.servlet-api"
- }
optional("org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-server")
optional("org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jetty-server") {
exclude group: "jakarta.servlet", module: "jakarta.servlet-api"
}
+ optional("org.eclipse.jetty.ee10:jetty-ee10-webapp") {
+ exclude group: "jakarta.servlet", module: "jakarta.servlet-api"
+ }
optional("org.glassfish.tyrus:tyrus-container-servlet")
testImplementation(testFixtures(project(":spring-core")))
testImplementation(testFixtures(project(":spring-web")))
diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardToWebSocketExtensionAdapter.java b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardToWebSocketExtensionAdapter.java
index af221926d6..f61d8978e9 100644
--- a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardToWebSocketExtensionAdapter.java
+++ b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardToWebSocketExtensionAdapter.java
@@ -34,12 +34,10 @@ import org.springframework.web.socket.WebSocketExtension;
*/
public class StandardToWebSocketExtensionAdapter extends WebSocketExtension {
-
public StandardToWebSocketExtensionAdapter(Extension extension) {
super(extension.getName(), initParameters(extension));
}
-
private static Map initParameters(Extension extension) {
List parameters = extension.getParameters();
Map result = new LinkedCaseInsensitiveMap<>(parameters.size(), Locale.ROOT);
diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/WebSocketToStandardExtensionAdapter.java b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/WebSocketToStandardExtensionAdapter.java
index f8334d3ff3..8455b8dd2c 100644
--- a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/WebSocketToStandardExtensionAdapter.java
+++ b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/WebSocketToStandardExtensionAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2024 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.
@@ -55,6 +55,7 @@ public class WebSocketToStandardExtensionAdapter implements Extension {
}
}
+
@Override
public String getName() {
return this.name;
diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketStompClient.java b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketStompClient.java
index 973376af70..9a519a0b8a 100644
--- a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketStompClient.java
+++ b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketStompClient.java
@@ -234,7 +234,7 @@ public class WebSocketStompClient extends StompClientSupport implements SmartLif
/**
* An overloaded version of
- * {@link #connect(String, StompSessionHandler, Object...)} that also
+ * {@link #connectAsync(String, StompSessionHandler, Object...)} that also
* accepts {@link WebSocketHttpHeaders} to use for the WebSocket handshake.
* @param url the url to connect to
* @param handshakeHeaders the headers for the WebSocket handshake
@@ -254,7 +254,7 @@ public class WebSocketStompClient extends StompClientSupport implements SmartLif
/**
* An overloaded version of
- * {@link #connect(String, StompSessionHandler, Object...)} that also
+ * {@link #connectAsync(String, StompSessionHandler, Object...)} that also
* accepts {@link WebSocketHttpHeaders} to use for the WebSocket handshake.
* @param url the url to connect to
* @param handshakeHeaders the headers for the WebSocket handshake
@@ -271,7 +271,7 @@ public class WebSocketStompClient extends StompClientSupport implements SmartLif
/**
* An overloaded version of
- * {@link #connect(String, StompSessionHandler, Object...)} that also accepts
+ * {@link #connectAsync(String, StompSessionHandler, Object...)} that also accepts
* {@link WebSocketHttpHeaders} to use for the WebSocket handshake and
* {@link StompHeaders} for the STOMP CONNECT frame.
* @param url the url to connect to
@@ -293,7 +293,7 @@ public class WebSocketStompClient extends StompClientSupport implements SmartLif
/**
* An overloaded version of
- * {@link #connect(String, StompSessionHandler, Object...)} that also accepts
+ * {@link #connectAsync(String, StompSessionHandler, Object...)} that also accepts
* {@link WebSocketHttpHeaders} to use for the WebSocket handshake and
* {@link StompHeaders} for the STOMP CONNECT frame.
* @param url the url to connect to
@@ -314,7 +314,7 @@ public class WebSocketStompClient extends StompClientSupport implements SmartLif
/**
* An overloaded version of
- * {@link #connect(String, WebSocketHttpHeaders, StompSessionHandler, Object...)}
+ * {@link #connectAsync(String, WebSocketHttpHeaders, StompSessionHandler, Object...)}
* that accepts a fully prepared {@link java.net.URI}.
* @param url the url to connect to
* @param handshakeHeaders the headers for the WebSocket handshake
@@ -334,7 +334,7 @@ public class WebSocketStompClient extends StompClientSupport implements SmartLif
/**
* An overloaded version of
- * {@link #connect(String, WebSocketHttpHeaders, StompSessionHandler, Object...)}
+ * {@link #connectAsync(String, WebSocketHttpHeaders, StompSessionHandler, Object...)}
* that accepts a fully prepared {@link java.net.URI}.
* @param url the url to connect to
* @param handshakeHeaders the headers for the WebSocket handshake
diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/DefaultTransportRequest.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/DefaultTransportRequest.java
index b637acbb01..d320ec3fd0 100644
--- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/DefaultTransportRequest.java
+++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/DefaultTransportRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2022 the original author or authors.
+ * Copyright 2002-2024 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.
@@ -278,6 +278,7 @@ class DefaultTransportRequest implements TransportRequest {
}
}
+
/**
* Updates the given (global) future based success or failure to connect for
* the entire SockJS request regardless of which transport actually managed