From d512aafc36d0c194e755759f60550d0efe40e212 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 11 Dec 2024 16:58:37 +0100 Subject: [PATCH] Avoid javadoc references to deprecated types/methods (cherry picked from commit 68997d84162f9fdfccb17c23006f3c4f0620a993) --- .../AbstractAsyncReturnValueHandler.java | 6 ++---- .../AsyncHandlerMethodReturnValueHandler.java | 5 ++--- .../client/SimpleClientHttpRequestFactory.java | 18 +++--------------- .../http/client/support/HttpAccessor.java | 4 ++-- .../web/socket/sockjs/client/SockJsClient.java | 12 ++++++------ 5 files changed, 15 insertions(+), 30 deletions(-) diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AbstractAsyncReturnValueHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AbstractAsyncReturnValueHandler.java index 520d3b27bc4..38801e420d8 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AbstractAsyncReturnValueHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AbstractAsyncReturnValueHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 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. @@ -22,9 +22,7 @@ import org.springframework.messaging.Message; /** * Convenient base class for {@link AsyncHandlerMethodReturnValueHandler} - * implementations that support only asynchronous (Future-like) return values - * and merely serve as adapters of such types to Spring's - * {@link org.springframework.util.concurrent.ListenableFuture ListenableFuture}. + * implementations that support only asynchronous (Future-like) return values. * * @author Sebastien Deleuze * @since 4.2 diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AsyncHandlerMethodReturnValueHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AsyncHandlerMethodReturnValueHandler.java index 311969d82c6..3dde07d15b4 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AsyncHandlerMethodReturnValueHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AsyncHandlerMethodReturnValueHandler.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. @@ -24,8 +24,6 @@ import org.springframework.lang.Nullable; /** * An extension of {@link HandlerMethodReturnValueHandler} for handling async, * Future-like return value types that support success and error callbacks. - * Essentially anything that can be adapted to a - * {@link org.springframework.util.concurrent.ListenableFuture ListenableFuture}. * *

Implementations should consider extending the convenient base class * {@link AbstractAsyncReturnValueHandler}. @@ -71,6 +69,7 @@ public interface AsyncHandlerMethodReturnValueHandler extends HandlerMethodRetur @Nullable default org.springframework.util.concurrent.ListenableFuture toListenableFuture( Object returnValue, MethodParameter returnType) { + CompletableFuture result = toCompletableFuture(returnValue, returnType); return (result != null ? new org.springframework.util.concurrent.CompletableToListenableFutureAdapter<>(result) : diff --git a/spring-web/src/main/java/org/springframework/http/client/SimpleClientHttpRequestFactory.java b/spring-web/src/main/java/org/springframework/http/client/SimpleClientHttpRequestFactory.java index ec2b075bd53..9c5982f213b 100644 --- a/spring-web/src/main/java/org/springframework/http/client/SimpleClientHttpRequestFactory.java +++ b/spring-web/src/main/java/org/springframework/http/client/SimpleClientHttpRequestFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 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. @@ -62,16 +62,9 @@ public class SimpleClientHttpRequestFactory implements ClientHttpRequestFactory /** * Indicate whether this request factory should buffer the * {@linkplain ClientHttpRequest#getBody() request body} internally. - *

Default is {@code true}. When sending large amounts of data via POST or PUT, - * it is recommended to change this property to {@code false}, so as not to run - * out of memory. This will result in a {@link ClientHttpRequest} that either - * streams directly to the underlying {@link HttpURLConnection} (if the - * {@link org.springframework.http.HttpHeaders#getContentLength() Content-Length} - * is known in advance), or that will use "Chunked transfer encoding" - * (if the {@code Content-Length} is not known in advance). * @see #setChunkSize(int) - * @see HttpURLConnection#setFixedLengthStreamingMode(int) - * @deprecated since 6.1 requests are never buffered, as if this property is {@code false} + * @deprecated since 6.1 requests are never buffered, + * as if this property is {@code false} */ @Deprecated(since = "6.1", forRemoval = true) public void setBufferRequestBody(boolean bufferRequestBody) { @@ -80,11 +73,6 @@ public class SimpleClientHttpRequestFactory implements ClientHttpRequestFactory /** * Set the number of bytes to write in each chunk when not buffering request * bodies locally. - *

Note that this parameter is only used when - * {@link #setBufferRequestBody(boolean) bufferRequestBody} is set to {@code false}, - * and the {@link org.springframework.http.HttpHeaders#getContentLength() Content-Length} - * is not known in advance. - * @see #setBufferRequestBody(boolean) */ public void setChunkSize(int chunkSize) { this.chunkSize = chunkSize; diff --git a/spring-web/src/main/java/org/springframework/http/client/support/HttpAccessor.java b/spring-web/src/main/java/org/springframework/http/client/support/HttpAccessor.java index 1ac8b7969c8..58d8cec61ae 100644 --- a/spring-web/src/main/java/org/springframework/http/client/support/HttpAccessor.java +++ b/spring-web/src/main/java/org/springframework/http/client/support/HttpAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 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. @@ -67,7 +67,7 @@ public abstract class HttpAccessor { * @see #createRequest(URI, HttpMethod) * @see SimpleClientHttpRequestFactory * @see org.springframework.http.client.HttpComponentsClientHttpRequestFactory - * @see org.springframework.http.client.OkHttp3ClientHttpRequestFactory + * @see org.springframework.http.client.JdkClientHttpRequestFactory */ public void setRequestFactory(ClientHttpRequestFactory requestFactory) { Assert.notNull(requestFactory, "ClientHttpRequestFactory must not be null"); diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/SockJsClient.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/SockJsClient.java index 559ac54ffd7..a7dfe0837af 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/SockJsClient.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/SockJsClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 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. @@ -116,13 +116,13 @@ public class SockJsClient implements WebSocketClient, Lifecycle { /** - * The names of HTTP headers that should be copied from the handshake headers - * of each call to {@link SockJsClient#doHandshake(WebSocketHandler, WebSocketHttpHeaders, URI)} - * and also used with other HTTP requests issued as part of that SockJS - * connection, e.g. the initial info request, XHR send or receive requests. + * The names of HTTP headers that should be copied from the handshake headers of each + * call to {@link SockJsClient#execute(WebSocketHandler, WebSocketHttpHeaders, URI)} + * and also used with other HTTP requests issued as part of that SockJS connection, + * for example, the initial info request, XHR send or receive requests. *

By default if this property is not set, all handshake headers are also * used for other HTTP requests. Set it if you want only a subset of handshake - * headers (e.g. auth headers) to be used for other HTTP requests. + * headers (for example, auth headers) to be used for other HTTP requests. * @param httpHeaderNames the HTTP header names */ public void setHttpHeaderNames(@Nullable String... httpHeaderNames) {