Commit Graph

5309 Commits

Author SHA1 Message Date
Arjen Poutsma b65b3350be Merge branch '6.1.x' 2024-06-17 14:20:05 +02:00
Arjen Poutsma c38e9896c7 Remove use of ServletException in ModelFactory
This commit changes the use of HttpSessionRequiredException in
ModelFactory::initModel to an IllegalStateException, because the former
extends ServletException and cannot be used in WebFlux.

Closes gh-33043
2024-06-17 14:19:19 +02:00
Arjen Poutsma df01b013fa Merge branch '6.1.x' 2024-06-13 11:11:13 +02:00
Arjen Poutsma 6f32ff489a Use null stream in ReactorNettyClientResponse if no body is available
Closes gh-32805
2024-06-13 11:10:50 +02:00
Arjen Poutsma 099d016857 Handle trailing semicolon in Accept-Language
Closes gh-32259
2024-06-12 12:28:26 +02:00
Arjen Poutsma 60b5bbe334 Introduce request attributes in RestClient
This commit introduces request attributes in the RestClient and
underlying infrastructure (i.e. HttpRequest).

Closes gh-32027
2024-06-11 15:51:29 +02:00
Brian Clozel a6fb7e99a0 Support for Protobuf 4.x
This commit compiles our Protobuf against 4.27, effectively raising our
baseline to 3.9+.

This commit also re-generates all the Java messages from the .proto spec
using the latest protoc binary.

Closes gh-33011
2024-06-11 14:12:55 +02:00
Sébastien Deleuze 4c7374797e Polishing
Closes gh-32931
2024-06-11 10:20:14 +02:00
Sébastien Deleuze 611367e4bb Add coroutine variant of WebExceptionHandler
See gh-32931
2024-06-11 10:09:17 +02:00
Brian Clozel bc98410acf Merge branch '6.1.x' 2024-06-10 09:47:57 +02:00
Brian Clozel 0ca393c0dc Restrict memory allocation in ContentCachingRequestWrapper
Prior to this commit, the `ContentCachingRequestWrapper` could allocate
a `FastByteArrayOutputStream` block that was larger than the content
cache limit given as a consturctor argument. This was due to an
optimization applied in gh-31834 for allocating the right content cache
size when the request size is known.

Fixes gh-32987
2024-06-10 09:46:01 +02:00
Brian Clozel 24997b3356 Merge branch '6.1.x' 2024-06-07 19:02:53 +02:00
Brian Clozel 6681394886 Stop observations for async requests in Servlet filter
Prior to this commit, the `ServerHttpObservationFilter` would support
async dispatches and would do the following:

1. start the observation
2. call the filter chain
3. if async has started, do nothing
4. if not in async mode, stop the observation

This behavior would effectively rely on Async implementations to
complete and dispatch the request back to the container for an async
dispatch. This is what Spring web frameworks do and guarantee.

Some implementations complete the async request but do not dispatch
back; as a result, observations could leak as they are never stopped.

This commit changes the support of async requests. The filter now
opts-out of async dispatches - the filter will not be called for those
anymore. Instead, if the application started async mode during the
initial container dispatch, the filter will register an AsyncListener to
be notified of the outcome of the async handling.

Fixes gh-32730
2024-06-07 19:01:57 +02:00
Stéphane Nicoll 373cf30b75 Polish 2024-06-07 17:11:38 +02:00
Stéphane Nicoll 329b53309a Polish contribution
See gh-32941
2024-06-07 17:06:28 +02:00
Matteo Cristoforo 916ed5c0a9 Add support for specifying a read timeout for the reactive jdk client
See gh-32941
2024-06-07 17:01:23 +02:00
Brian Clozel e8c122c00a Fix MockCookie Partitioned support
See gh-31454
2024-06-07 14:49:15 +02:00
Sam Brannen 9cfd455dde Merge branch '6.1.x' 2024-06-07 14:19:38 +02:00
Thomas Deblock 47a5ebfde6 Support canEncode() for JAXBElement in Jaxb2XmlEncoder
Commit d7970e4ab8 introduced support for JAXBElement in
Jaxb2XmlEncoder's encodeValue() method; however, canEncode() still
returned false for a JAXBElement element type.

This commit revises canEncode() so that it returns true for an element
type that is assignable from JAXBElement.

See gh-30552
See gh-32972
Closes gh-32977
2024-06-07 14:13:59 +02:00
Arjen Poutsma 35e8f1c423 Support queries in opaque URLs
Closes gh-32920
2024-06-07 11:11:43 +02:00
Brian Clozel 7fc4937199 Add Partitioned cookie attribute support for servers
This commit adds support for the "Partitioned" cookie attribute in
WebFlux servers and the related testing infrastructure.
Note, Undertow does not support this feature at the moment.

Closes gh-31454
2024-06-07 10:03:52 +02:00
Juergen Hoeller 2aabe238c6 Merge branch '6.1.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java
2024-06-06 20:47:02 +02:00
Juergen Hoeller 2451bd62b0 Polishing 2024-06-06 20:43:31 +02:00
Arjen Poutsma 859b97ce05 Revert "Do not read Map in FormHttpMessageConverter"
This reverts commit 726ac9110c and
80faa94afc.

See gh-32826
2024-06-06 12:39:18 +02:00
Juergen Hoeller 09c1081645 Merge branch '6.1.x' 2024-06-06 08:55:16 +02:00
Juergen Hoeller 61d045ce52 Polishing 2024-06-06 08:54:37 +02:00
Juergen Hoeller c0bef2c693 Lazily start resources on demand (if necessary outside of lifecycle)
See gh-32945
2024-06-06 08:54:32 +02:00
Brian Clozel 316e531c69 Merge branch '6.1.x' 2024-06-05 20:05:50 +02:00
Brian Clozel 404c4d9d92 Support @Valid on container elements for handler arguments
Prior to this commit, #31870 added support for constraint annotations on
container elements for handler method argument validation. Supporting
this use case:

```
public void addNames(List<@NotEmpty String> names)
```

This commit does the same for `@Valid` annotation:

```
public void addPeople(List<@Valid Person> people)
```

Fixes gh-32964
2024-06-05 20:02:46 +02:00
Juergen Hoeller 3305485d1e Merge branch '6.1.x' 2024-06-05 16:33:44 +02:00
Juergen Hoeller 7785f94c4c Revise and align Reactor client lifecycle management
Closes gh-32945
2024-06-05 16:32:40 +02:00
Sam Brannen 9e1ef83669 Avoid issues with system line separator in tests
See f10caf6aa6
2024-06-05 12:36:58 +02:00
rstoyanchev 398aae2b9a Polishing in data binding tests
See gh-32676
2024-06-05 11:30:32 +01:00
Juergen Hoeller a26d31ee3a Merge branch '6.1.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2024-06-05 00:02:33 +02:00
Juergen Hoeller 6c054f88ea Defensively handle UncheckedIOException cause (for NullAway compliance) 2024-06-05 00:01:52 +02:00
Juergen Hoeller e5be10d53d Consistently throw IOException from ReactorNettyClientResponse
Aligned with ReactorNettyClientRequest.

See gh-32952
2024-06-04 23:43:10 +02:00
Juergen Hoeller 017bf4534d Merge branch '6.1.x' 2024-06-04 23:00:46 +02:00
Juergen Hoeller 524da905db Consistently throw IOException from ReactorNettyClientRequest
This commit renames ReactorNettyClientRequestFactoryTests.

Closes gh-32952
2024-06-04 22:59:29 +02:00
Juergen Hoeller 4323c60513 Common context lifecycle management for ReactorResourceFactory
This commit moves ReactorResourceFactoryTests to same package.

Closes gh-32945
2024-06-04 22:59:18 +02:00
Juergen Hoeller f10caf6aa6 Compare text with system line separator (for Windows compatibility)
See gh-32756
2024-06-04 22:50:14 +02:00
Arjen Poutsma 726ac9110c Do not read Map in FormHttpMessageConverter
This commit ensures that the FormHttpMessageConverter no longer supports
 reading Maps (just MultiValueMaps). Plain maps are often used to
 represent JSON.

See gh-32826
2024-05-28 15:25:08 +02:00
Sam Brannen 870d15c0b6 Merge branch '6.1.x' 2024-05-27 16:44:19 +02:00
Sam Brannen 8feb842df5 Upgrade to AssertJ 3.26.0
See https://github.com/assertj/assertj/issues/3322
2024-05-27 16:43:22 +02:00
Sam Brannen 7e3a4a12f8 Use consistent version strings for 6.2 2024-05-24 15:19:30 +02:00
Sam Brannen 159c2cd7c6 Remove obsolete code 2024-05-24 14:14:43 +02:00
Sam Brannen dac18a3ff1 Clean up warnings in Gradle build 2024-05-24 13:39:56 +02:00
Sam Brannen 77f7da01e4 Polishing 2024-05-24 13:39:56 +02:00
Sam Brannen e999f4e47d Sync changes to MockHttpServletRequest 2024-05-24 13:39:55 +02:00
Arjen Poutsma 903493e9a9 Various MultiValueMap improvements
This commit makes several improvements to MultiValueMap:
- asSingleValueMap offers a single-value view (as opposed to the
  existing toSingleValueMap, which offers a copy)
- fromSingleValue is a static method that adapts a Map<?,?> to the
  MultiValueMap interface
- fromMultiValue is a static method that adapts a Map<?,List<?>> to the
  MultiValueMap interface

Closes gh-32832
2024-05-24 11:44:55 +02:00
Arjen Poutsma 80faa94afc Support Map in FormHttpMessageConverter
This commit changes the FormHttpMessageConverter from a
HttpMessageConverter<MultiValueMap<String, ?>> to a
HttpMessageConverter<Map<String, ?>>, so that normal, single-value maps
can also be used as form representation, both for reading and writing.

Closes gh-32826
2024-05-23 10:33:49 +02:00
Arjen Poutsma 67d2b2566e Revert "WIP"
This reverts commit c09b0f57631905a7b9cca32be5516853e4263ac0.
2024-05-23 10:33:49 +02:00
Arjen Poutsma 14861024d5 WIP 2024-05-23 10:33:49 +02:00
Stéphane Nicoll fa275f908e Polish 2024-05-23 08:49:03 +02:00
Brian Clozel 1bd6b30ddd Allow ServerHttpObservationFilter to be extended
This commit allows to extend  the `ServerHttpObservationFilter` when the
observation scope is opened. This typically allows to add the current
traceId as a response header.

Closes gh-30632
2024-05-21 20:01:17 +02:00
Juergen Hoeller 6f6e25bd5b Merge branch '6.1.x' 2024-05-21 11:17:16 +02:00
Juergen Hoeller a4c2f291d9 Avoid creation of SAXParserFactory for every read operation
Includes JAXBContext locking revision (avoiding synchronization) and consistent treatment of DocumentBuilderFactory (in terms of caching as well as locking).

Closes gh-32851
2024-05-21 11:16:19 +02:00
Brian Clozel 4d4b343815 Support Content Negotiation with @ExceptionHandler
Prior to this commit, `@ExceptionHandler` annotated controller methods
could be mapped using the exception type declaration as an annotation
attribute, or as a method parameter.
While such methods support a wide variety of method arguments and return
types, it was not possible to declare the same exception type on
different methods (in the same controller/controller advice).

This commit adds a new `produces` attribute on `@ExceptionHandler`; with
that, applications can vary the HTTP response depending on the exception
type and the requested content-type by the client:

```
@ExceptionHandler(produces = "application/json")
public ResponseEntity<ErrorMessage> handleJson(IllegalArgumentException exc) {
	return ResponseEntity.badRequest().body(new ErrorMessage(exc.getMessage(), 42));
}

@ExceptionHandler(produces = "text/html")
public String handle(IllegalArgumentException exc, Model model) {
	model.addAttribute("error", new ErrorMessage(exc.getMessage(), 42));
	return "errorView";
}
```

This commit implements support in both Spring MVC and Spring WebFlux.

Closes gh-31936
2024-05-20 17:22:30 +02:00
Sam Brannen 93387e69b5 Polishing 2024-05-16 16:47:02 +02:00
rstoyanchev da3b59e7a9 Merge branch '6.1.x' 2024-05-15 20:07:13 +01:00
rstoyanchev 010e8a303b Polishing contribution
Closes gh-32799
2024-05-15 20:06:48 +01:00
Matteo Cristoforo 78549d4963 Fix cookie management in reactive JdkClientHttpRequest
Prevent cookies to be set to empty in the HTTP request if no cookie
is present

See gh-32799
2024-05-15 20:02:04 +01:00
rstoyanchev edb6bb717d Add UrlHandlerFilter
Closes gh-31366
2024-05-15 18:45:07 +01:00
rstoyanchev 48ad7b1bcd Remove unused code in WebHttpHandlerBuilder
The code was necessary while ForwardedHeaderFilter was deprecated
but still possible to use. When the filter was removed, this code
could have been removed as well.
2024-05-15 18:45:07 +01:00
mysend12 3547491590 Handle DataBufferLimitException as HTTP 413 responses
Prior to this commit, `DataBufferLimitException` would be thrown by
codecs when the request body was too large for the configured buffer
limit. This exception would not be handled by the web infrastructure and
would result in an HTTP 500 server error.

This commit introduces a new `PayloadTooLargeException` type that will
result in an HTTP 413 "Payload too large" response status.

Closes gh-32558
2024-05-13 14:07:21 +02:00
rstoyanchev 10e3d3b434 Merge branch '6.1.x' 2024-05-13 11:41:22 +01:00
rstoyanchev 2c9ed4608f Improve RequestAttributesThreadLocalAccessor
Ensure access to request attributes after initial REQUEST dispatch
is done, and the RequestAttributes markedCompleted.

Closes gh-32296
2024-05-13 11:41:07 +01:00
rstoyanchev 3ada9a0c79 Polishing in tests of ThreadLocalAccessor implementations
See gh-32296
2024-05-13 11:41:07 +01:00
rstoyanchev a5a1ef6b30 Use instance field for ProblemDetail in ErrorResponse's
Closes gh-32644
2024-05-13 11:40:32 +01:00
Brian Clozel 5cb4985234 Merge branch '6.1.x' 2024-05-13 10:44:09 +02:00
Brian Clozel 89ce63f1f3 Replace RFC7807 by RFC9457 in documentation
This commit updates all references to RFC7807 by RFC9457 since the
former is now obsolete.

Closes gh-32806
2024-05-13 10:42:35 +02:00
Juergen Hoeller 645556a28c Merge branch '6.1.x' 2024-05-07 15:53:00 +02:00
Juergen Hoeller 4f02be263f Polishing 2024-05-07 15:52:13 +02:00
Juergen Hoeller 3048cfe9d9 Polishing 2024-05-06 20:16:07 +02:00
Juergen Hoeller d9ca263065 Merge branch '6.1.x' 2024-05-06 20:11:56 +02:00
Juergen Hoeller 05d9b52b19 Polishing 2024-05-06 20:10:40 +02:00
Sébastien Deleuze 12272d6e41 Remove unneeded `@SuppressWarnings("NullAway")`
Closes gh-32542
2024-05-06 18:28:54 +02:00
Arjen Poutsma 8bca7cd8e7 Various UrlParser improvements
- Consistent use of codePointAt instead of charAt.
- Fix bug in domainToAscii

See gh-32513
2024-05-03 13:41:56 +02:00
Arjen Poutsma 4df80a8d09 Various CPU and memory improvements in UrlParser
Improvements include:
- Replace throwing exceptions with failure results in hot areas,
- Verify digits of a string before passing it to Integer::parseInt
- Lazily initialization of fields
- Using LinkedList instead of ArrayList where size is not known
  beforehand

See gh-32513
2024-05-03 13:41:55 +02:00
Stéphane Nicoll 305ebca56d Merge branch '6.1.x' 2024-05-02 17:02:08 +02:00
Stéphane Nicoll abcc1dfc6c Review usage of BindingReflectionHintsRegistrar#registerReflectionHints
Closes gh-32753
2024-05-02 16:53:59 +02:00
Brian Clozel 09ca4cdc70 Merge branch '6.1.x' 2024-05-02 16:01:56 +02:00
Brian Clozel 47c5cd208c Add missing "Content-Length: 0" header with HttpComponents
Prior to this commit, HTTP requests sent with the
`HttpComponentsClientHttpRequestFactory` would not set a
"Content-Length" header for empty request bodies. Setting a request
entity is the expected behavior for unsafe HTTP methods, and this would
align the behavior with other HTTP clients.
Developers would often rely on `BufferingClientHttpRequestFactory` to
set this information on the request.

This commit ensures that a `NullEntity` is used for unsafe HTTP methods,
when no body has been set for the request. This result in a
"Content-Length:0" request header.

Fixes gh-32678
2024-05-02 15:42:35 +02:00
Arjen Poutsma 7ccd4ce886 Reduce logging level in UrlParser
See gh-32513
2024-05-02 15:33:06 +02:00
Stéphane Nicoll 759ec52fd2 Merge branch '6.1.x' 2024-05-02 11:49:24 +02:00
Stéphane Nicoll f90bdbef42 Add noop implementation for ResponseErrorHandler
Closes gh-32750
2024-05-02 11:44:42 +02:00
Brian Clozel 02b3801f1a Merge branch '6.1.x' 2024-05-02 09:17:01 +02:00
Brian Clozel 64b0283042 Revert "Do not set 0 Content-Length header in BufferingClientHttpRequestFactory"
This reverts commit b3a45670f9.

See gh-32650
2024-05-02 09:11:54 +02:00
Arjen Poutsma 37dd47c6fc Set request timeout in JettyClientHttpRequestFactory
Closes gh-32330
2024-05-01 09:58:35 +02:00
Arjen Poutsma 0241a02e66 Fix guard against multiple subscriptions
This commit changes the guard against multiple subscriptions, as the
previously used doOnSubscribe hook could not function as guard in
certain scenarios.

Closes gh-32727
2024-04-30 16:07:03 +02:00
Arjen Poutsma a3afe51c9f Fix guard against multiple subscriptions
This commit changes the guard against multiple subscriptions, as the
previously used doOnSubscribe hook could not function as guard in
certain scenarios.

Closes gh-32727
2024-04-30 16:06:53 +02:00
Stéphane Nicoll f85c4e1ea7 Polish "Include URL and HTTP method in DefaultResponseErrorHandler"
See gh-28958
2024-04-30 11:34:17 +02:00
jerzykrlk 4972d18dd6 Include URL and HTTP method in DefaultResponseErrorHandler
See gh-28958
2024-04-30 11:34:17 +02:00
donghui a662f5e719 Add a requiredBody() extension to RestClient.ResponseSpec
Closes gh-32703
2024-04-26 16:21:32 +02:00
Arjen Poutsma 3cfa4ed4f7 Various UrlParser improvements
See gh-32513
2024-04-26 11:44:32 +02:00
Juergen Hoeller 0402ea13c0 Merge branch '6.1.x' 2024-04-24 13:42:43 +02:00
Juergen Hoeller 09b476ac18 Polishing 2024-04-24 13:42:02 +02:00
rstoyanchev 75a5409c97 Add PreFlightRequestHandler for Spring MVC
This is equivalent of the same contract for WebFlux. It is implemented
by HandlerMappingIntrospector, and may be called directly by Spring
Security to handle a pre-flight request without delegate to the rest
of the filter chain.

HandlerMappingIntrospector also has the boolean method
allHandlerMappingsUsePathPatternParser that checks whether all handler
mappings are configured to use parsed PathPattern's.

See gh-31823
2024-04-23 19:00:10 +01:00
Juergen Hoeller 3991cae875 Merge branch '6.1.x' 2024-04-23 16:07:46 +02:00
Juergen Hoeller 580adfcbed Polishing 2024-04-23 16:07:09 +02:00
Stéphane Nicoll a77895bd90 Merge branch '6.1.x' 2024-04-23 15:34:49 +02:00
Stéphane Nicoll 95ac0eae4a Update copyright year of changed files
See gh-32696
2024-04-23 15:32:59 +02:00
Johnny Lim cc73ccefef Polish
See gh-32696
2024-04-23 15:31:48 +02:00
Arjen Poutsma 6c5ef9715b Polishing external contribution
See gh-32622
2024-04-23 14:59:28 +02:00
Sergey Zolotaryov 3f8a10c19f Remove Content-Type when body is empty
Closes gh-32622
See gh-32620
2024-04-23 14:58:20 +02:00
Juergen Hoeller adc7f73170 Merge branch '6.1.x' 2024-04-23 13:17:08 +02:00
Juergen Hoeller d4ddbd537b Polishing 2024-04-23 13:16:33 +02:00
Brian Clozel c80bf57834 Merge branch '6.1.x' 2024-04-20 19:46:23 +02:00
Brian Clozel 5aa576f5c6 Register status handler exceptions in observations
Prior to this commit, `RestClientException` thrown by status handlers
would not be registered as observation errors. This commit ensures that
such exceptions are first caught, registered in the observation and
rethrown as expected.

Closes gh-32575
2024-04-20 19:44:11 +02:00
Brian Clozel 0893cf948d Merge branch '6.1.x' 2024-04-18 21:27:50 +02:00
Brian Clozel da4547a27e Extend observations to RestClient ResponseSpec
Prior to this commit, the `RestClient` observations would be stopped as
soon as the exchange function was called. This means that all errors
related to response decoding or mapping would not be recorded by the
obsevations.

This commit extends the observation recording to the `ResponseSpec` DSL
calls as well as custom exchange functions.

Fixes gh-32575
2024-04-18 21:26:18 +02:00
Arjen Poutsma 62a1b5558f Resolve UrlParser review comments
See gh-32513
2024-04-18 15:20:02 +02:00
Sam Brannen f96d0a6c4a Merge branch '6.1.x' 2024-04-18 11:54:02 +02:00
yhao3 7f27ba3902 Update links to HttpOnly documentation at OWASP in ResponseCookie
Closes gh-32663
2024-04-18 11:52:50 +02:00
rstoyanchev 0bc447c304 Jackson decoder supports array/Collection elements
Closes gh-32579
2024-04-18 10:40:25 +01:00
Onji Kim ec055da7c3 Reject negative Content-Length values in HttpHeaders
Prior to this commit, `HttpHeaders#setContentLength` would accept
negative values. Those are not allowed by the RFC and the headers
implementation only uses "-1" as a way to convey that no value was set.

This commit ensures that negative values are rejected.

Fixes gh-32660
2024-04-17 23:05:13 +02:00
Brian Clozel c03f798dad Merge branch '6.1.x' 2024-04-17 22:47:44 +02:00
Brian Clozel b3a45670f9 Do not set 0 Content-Length header in BufferingClientHttpRequestFactory
Prior to this commit, the `BufferingClientHttpRequestFactory`, through
the `AbstractBufferingClientHttpRequest`, would set a "Content-Length"
header value, even if the buffered body was empty.

This behavior is invalid since no request body would be set by the
client code in the first place.

This commit ensures that this header is only set if a request body has
been buffered and is about to be written to the request.

Fixes gh-32650
2024-04-17 22:44:36 +02:00
Arjen Poutsma af23cc233e Add support for state override in new URL parser
See gh-32513
2024-04-17 16:33:53 +02:00
Arjen Poutsma f21e05a9e4 Introduce new URL parser
This commit introduces a new URL parser based on algorithm provided in
the Living URL standard. This new UrlParser is used by
UriComponentsBuilder::fromUriString, replacing the regular expressions.

Closes gh-32513
2024-04-17 11:17:01 +02:00
Simon Baslé fe83003324 Merge branch '6.1.x' 2024-04-15 14:21:51 +02:00
Simon Baslé 1e54916119 Ensure multipart data is deleted in WebFlux when connection terminates
Before this change temporary files would not consistently be deleted
when the connection which uploads the multipart files closes naturally.

This change uses the usingWhen Reactor operator to ensure that the
termination of the connection doesn't prevent individual file parts
from being deleted due to a cancellation signal.

Closes gh-31217
2024-04-15 14:20:48 +02:00
Brian Clozel 54dab45151 Merge branch '6.1.x' 2024-04-11 08:51:13 +02:00
Brian Clozel 494ed4e852 Refine UriComponentsBuilder parsing
This commit refines the expressions for the scheme, user info, host and
port parts of the URL in UriComponentsBuilder to better conform to
RFC 3986.

Fixes gh-32616
2024-04-11 08:49:11 +02:00
Juergen Hoeller 77c6f160fe Merge branch '6.1.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java
#	spring-web/src/test/java/org/springframework/web/method/annotation/RequestParamMethodArgumentResolverTests.java
#	spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestParamMethodArgumentResolverTests.java
2024-04-10 18:29:48 +02:00
Juergen Hoeller 39cd31613b Polishing 2024-04-10 18:06:32 +02:00
Brian Clozel 35a0d24dc3 Merge branch '6.1.x' 2024-04-10 16:44:20 +02:00
Brian Clozel 019ce4418c BufferingClientHttpRequestWrapper should not write empty body
Prior to this commit, `BufferingClientHttpRequestWrapper` would always
write to the actual client request body, even if the buffered content
was empty (empty byte array).
This would cause issues with specific client request factories,
especially the OkHttp variant, that would consider empty byte arrays as
non-empty body and would reject such cases for GET requests with an
"IllegalArgumentException: method GET must not have a request body".

This commit only writes to the request if the buffered content is not
empty.

Fixes gh-32612
2024-04-10 16:41:16 +02:00
Sam Brannen bed3689001 Polishing 2024-04-10 10:56:41 +02:00
rstoyanchev a1586ff0a0 Merge branch '6.1.x' 2024-04-09 18:25:11 +01:00
rstoyanchev 8d05028c2e RequestParam resolver supports empty array suffix
Closes gh-32577
2024-04-09 18:24:57 +01:00
rstoyanchev 4a68c44a27 Update content-length when reconstructing body
Closes gh-32471
2024-04-09 18:24:57 +01:00
Juergen Hoeller 03dd8e20e2 Merge branch '6.1.x' 2024-04-05 18:05:37 +02:00
Juergen Hoeller 07472758ee Detect Undertow RequestTooBigException message in handleParseFailure
Closes gh-32549
2024-04-05 18:03:44 +02:00
Arjen Poutsma dcab1f2237 Merge branch '6.1.x' 2024-04-05 16:13:58 +02:00
Arjen Poutsma 47c9c7eb07 Update copyright
See gh-32528
2024-04-05 16:13:39 +02:00
Arjen Poutsma 08bc959c9b Merge branch '6.1.x' 2024-04-05 15:43:49 +02:00
Arjen Poutsma b24221754a ReactorNettyClientResponse should close response body
This commit ensures that the response body is drained and closed when
the response itself is closed, instead of disposing the connection, as
this will disable the connection pool.

Closes gh-32528
2024-04-05 15:38:18 +02:00
Sébastien Deleuze 7a666cfd86 Revert some null-safety changes
This commit reverts some null-safety changes which make sense
on main but are too impactful for 6.1.x for Kotlin developers
using -Xjsr305=strict.

See gh-32475
2024-04-05 14:59:39 +02:00
Sébastien Deleuze db1010f9c9 Add CBOR support to AllEncompassingFormHttpMessageConverter
Closes gh-32428
2024-03-28 14:59:22 +01:00
Sébastien Deleuze cf87441a26 Remove unnecessary method.isAccessible() invocation
Closes gh-32548
2024-03-28 11:50:29 +01:00
Sébastien Deleuze dc982d0d51 Merge branch '6.1.x' 2024-03-28 11:14:42 +01:00
Sébastien Deleuze 048e4f0aa2 Invoke KCallablesJvm.setAccessible only when required
Closes-32536
2024-03-28 11:12:50 +01:00
T45K b28153e1d7 Fix handling of value class with private constructor
See gh-32536
2024-03-28 11:11:58 +01:00
Sébastien Deleuze 8b51b36729 Perform NullAway build-time checks in more modules
This commit enables null-safety build-time checks in
all remaining modules except spring-test.

See gh-32475
2024-03-26 15:53:01 +01:00
Sébastien Deleuze 2fea3d7921 Merge branch '6.1.x' 2024-03-26 15:41:46 +01:00
Sébastien Deleuze 290a41d398 Refine null-safety in more modules
This commit refines the null-safety in all remaining modules
except spring-test.

See gh-32475
2024-03-26 15:39:18 +01:00
Sébastien Deleuze e52ee01ec8 Perform NullAway build-time checks in spring-web
Also in spring-websocket.

See gh-32475
2024-03-25 11:11:09 +01:00
Sébastien Deleuze 2b1eb488fc Merge branch '6.1.x' 2024-03-25 11:04:49 +01:00
Sébastien Deleuze a63ebe7e9d Refine null-safety in spring-web and spring-websocket
See gh-32475
2024-03-25 11:02:44 +01:00
Stéphane Nicoll 8736ca038a Merge branch '6.1.x' 2024-03-24 09:23:10 +01:00
Johnny Lim dca5f1dcd8 Add Javadoc since to KotlinSerializationStringEncoder.setStreamingMediaTypes()
See gh-32517
2024-03-24 09:21:36 +01:00
Sébastien Deleuze b1b9ee0ccf Merge branch '6.1.x' 2024-03-21 17:56:14 +01:00
Sébastien Deleuze 1e80694daf Fix a regression with Kotlin generic controllers
This commit reintroduces a more defensive parameter type check that
skips KClass casting for generic parameters.

Closes gh-32510
2024-03-21 17:55:57 +01:00
Sam Brannen a30c06b883 Polishing and consistent use of exception assertions 2024-03-21 16:36:14 +01:00
Andrea Mauro 458c30cb63 Resolve property-dependent parameter names for exception messages
Prior to this commit when a required parameter defined as a property or
expression placeholder was missing, the exception thrown would refer to
the placeholder instead of the resolved name.

This change covers messaging handlers and web controllers, both blocking
and reactive. It also fixes the error message when handling null values
for non-required parameters, as well as in cases that need conversion.

See gh-32323
Closes gh-32462
2024-03-20 17:40:38 +01:00
Sam Brannen 0a715bcab3 Merge branch '6.1.x' 2024-03-19 15:52:12 +01:00
Sam Brannen ef02f0bad8 Wrap InvalidMimeTypeException in HttpMediaTypeNotAcceptableException
The fix for #31254 resulted in an InvalidMimeTypeException being thrown
by MimeTypeUtils.sortBySpecificity() instead of an
IllegalArgumentException. However, InvalidMimeTypeException extends
IllegalArgumentException. Consequently, the change from
IllegalArgumentException to InvalidMimeTypeException did not result in
the desired effect in HeaderContentNegotiationStrategy.

HeaderContentNegotiationStrategy.resolveMediaTypes() still allows the
InvalidMimeTypeException to propagate as-is without wrapping it in an
HttpMediaTypeNotAcceptableException.

To address this issue, this commit catches InvalidMediaTypeException
and InvalidMimeTypeException in HeaderContentNegotiationStrategy and
wraps the exception in an HttpMediaTypeNotAcceptableException.

See gh-31254
See gh-31769
Closes gh-32483
2024-03-19 15:51:27 +01:00
Sam Brannen 836a0b3a40 Polishing 2024-03-19 14:19:01 +01:00
Juergen Hoeller e58ea0d945 Merge branch '6.1.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/core/CoroutinesUtils.java
2024-03-19 10:06:48 +01:00
Juergen Hoeller c531a8a705 Nullability refinements and related polishing
See gh-32475
2024-03-19 09:58:44 +01:00
Stéphane Nicoll 3e102e5d8e Merge branch '6.1.x' 2024-03-18 14:11:02 +01:00
Johnny Lim d50c94fca9 Add Javadoc since to AbstractClientHttpRequestFactoryWrapper.getDelegate()
See gh-32474
2024-03-18 14:08:59 +01:00
Juergen Hoeller 89d563097f Merge branch '6.1.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java
2024-03-16 23:24:51 +01:00
Juergen Hoeller eb8b7c4331 Remove superfluous @NonNull declarations 2024-03-16 14:22:17 +01:00
Sam Brannen 4a3daa7812 Polishing 2024-03-14 14:20:59 +01:00
rstoyanchev 1d2b55e670 Merge branch '6.1.x' 2024-03-14 08:46:46 +00:00
rstoyanchev 381f790329 Extract reusable checkSchemeAndPort method
Closes gh-32440
2024-03-14 08:45:38 +00:00
Juergen Hoeller 7f7c0d59f6 Merge branch '6.1.x' 2024-03-13 18:07:21 +01:00
Juergen Hoeller 54a6d89da7 Additional unit tests for operations on empty UriTemplate
See gh-32432
2024-03-13 18:06:17 +01:00
Stéphane Nicoll 7d4db434a5 Merge branch '6.1.x' 2024-03-13 17:28:23 +01:00
Stéphane Nicoll a34ceb405c Polish "Allow UriTemplate to be built with an empty template"
See gh-32432
2024-03-13 17:21:46 +01:00
Kasper Bisgaard 1b25a1506a Allow UriTemplate to be built with an empty template
See gh-32432
2024-03-13 17:20:08 +01:00
Sam Brannen 986c4fd926 Revise use of Objects.requireNonNull()
Historically, we have rarely intentionally thrown a
NullPointerException in the Spring Framework. Instead, we prefer to
throw either an IllegalArgumentException or IllegalStateException
instead of a NullPointerException.

However, changes to the code in recent times have introduced the use of
Objects.requireNonNull(Object) which throws a NullPointerException
without an explicit error message.

The latter ends up providing less context than a NullPointerException
thrown by the JVM (since Java 14) due to actually de-referencing a
null-pointer. See https://openjdk.org/jeps/358.

In light of that, this commit revises our current use of
Objects.requireNonNull(Object) by removing it or replacing it with
Assert.notNull().

However, we still use Objects.requireNonNull(T, String) in a few places
where we are required to throw a NullPointerException in order to
comply with a third-party contract such as Reactive Streams.

Closes gh-32430
2024-03-13 16:00:22 +01:00
Brian Clozel 4b732d62c2 Deprecate HttpHeaders.writableHttpHeaders
Prior to this commit, gh-21783 introduced `ReadOnlyHttpHeaders` to avoid
parsing media types multiple times during the lifetime of an HTTP
exchange: such values are cached and the headers map is made read-only.
This also added a new `HttpHeaders.writableHttpHeaders` method to unwrap
the read-only variant when needed.

It turns out this method sends the wrong signal to the community
because:
* the underlying map might be unmodifiable even if this is not an
  instance of ReadOnlyHttpHeaders
* developers were assuming that modifying the collection that backs the
  read-only instance would work around the cached values for
  Content-Type and Accept headers

This commit adds more documentation to highlight the desired behavior
for cached values by the read-only variant, and deprecates the
`writableHttpHeaders` method as `ReadOnlyHttpHeaders` is package private
and we should not surface that concept anyway.
Instead, this commit unwraps the read-only variant if needed when a new
HttpHeaders instance is created.

Closes gh-32116
2024-03-12 14:04:09 +01:00
rstoyanchev 6767f7010c Polishing contribution
Closes gh-29958
2024-03-12 10:43:32 +00:00
rstoyanchev 8af1d8e842 Remove applyAttributes flag from contribution
See gh-29958
2024-03-12 10:43:31 +00:00
PhilKes 052b6357c8 Apply attributes to the underlying HTTP request
See gh-29958
2024-03-12 10:43:31 +00:00
Stéphane Nicoll 6fc1f72704 Merge branch '6.1.x' 2024-03-12 08:21:08 +01:00
Stéphane Nicoll 88b3844d9b Fix default value in ReactorNettyClientRequestFactory#setExchangeTimeout
Closes gh-32419
2024-03-12 08:13:42 +01:00
Sébastien Deleuze 0435e9c49e Merge branch '6.1.x' 2024-03-11 13:40:23 +01:00
Sébastien Deleuze 80f3be6577 Replace getJvmErasure by getClassifier
Should be slightly faster.

See gh-32334
2024-03-11 13:37:41 +01:00
Sam Brannen c4e0f96ef7 Polishing 2024-03-11 11:28:59 +01:00
Sébastien Deleuze 5ee11fb1b3 Polish Yaml support
Closes gh-32345
2024-03-11 09:27:25 +01:00
Hyoungjune 6a8f0d6d7d Add web support for Yaml via Jackson
This commit adds support for application/yaml in MediaType and leverages
jackson-dataformat-yaml in order to support Yaml in RestTemplate,
RestClient and Spring MVC.

See gh-32345
2024-03-11 09:22:51 +01:00
Yanming Zhou 246e4977a2 Polishing Optional usage 2024-03-11 09:13:49 +01:00
Sam Brannen 6b64e9992a Merge branch '6.1.x' 2024-03-09 16:31:28 +01:00
Sam Brannen b4e743614e Restore link to Jakarta Servlet issue tracker 2024-03-09 16:30:14 +01:00
Stéphane Nicoll e53ed3e3c6 Merge branch '6.1.x' 2024-03-09 16:03:04 +01:00
Stéphane Nicoll 4983a802a7 Polish "Fix Javadoc"
See gh-32403
2024-03-09 16:02:01 +01:00
Maksim Sasnouski abdccffa39 Fix Javadoc
This commit fixes various Javadoc issues across the code base.

See gh-32403
2024-03-09 16:02:00 +01:00
rstoyanchev 38d5c0fed6 Add RFC-7807 response interception
Closes gh-31822
2024-03-08 16:56:38 +00:00
Sébastien Deleuze e66d965fed Merge branch '6.1.x' 2024-03-08 09:25:17 +01:00
Yanming Zhou 0e279fe666 Polishing
Closes gh-32397
2024-03-08 09:25:03 +01:00
Sébastien Deleuze 92f4e883b3 Merge branch '6.1.x' 2024-03-07 11:11:46 +01:00
Sébastien Deleuze c1d4b610ca Refine Kotlin inline class optimizations
Closes gh-32334
2024-03-07 11:11:20 +01:00
rstoyanchev 1a8d64f9d8 Merge branch '6.1.x' 2024-03-06 18:17:40 +00:00
rstoyanchev 5f601ceb45 Mark response errors from @ExceptionHandler as handled
Also fix a couple of related issues:
- add AsyncRequestNotUsableException to the list of exceptions
that imply response issues.
- handle exceptions from @ExceptionHandler regardless of whether
thrown immediately or via Publisher.

Closes gh-32359
2024-03-06 18:17:13 +00:00
rstoyanchev ddab971fca Merge branch '6.1.x' 2024-03-05 11:42:17 +00:00
rstoyanchev ef0717935b Test wrapping of response for async request
The following adjustments are also made as a result:
- Use int to check if lock is held and unlock is needed, given that
for non-async requests we don't need to obtain a lock.
- Protect access methods getOutputStream and getWriter with the
same locking and state checks.

Closes gh-32340
2024-03-05 11:42:03 +00:00
rstoyanchev 822e2447a0 Polishing StandardServletAsyncWebRequestTests
See gh-32340
2024-03-05 11:42:03 +00:00
Juergen Hoeller dc6c96de0a Merge branch '6.1.x'
# Conflicts:
#	spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/AbstractFallbackJCacheOperationSource.java
#	spring-context/src/main/java/org/springframework/cache/interceptor/AbstractFallbackCacheOperationSource.java
#	spring-tx/src/main/java/org/springframework/transaction/interceptor/AbstractFallbackTransactionAttributeSource.java
2024-03-04 22:50:22 +01:00
Juergen Hoeller e9110c0729 Polishing 2024-03-04 22:48:52 +01:00
Sébastien Deleuze 138e7a0e07 Use ServletResponse#getContentType in ServletServerHttpResponse
This commit updates ServletServerHttpResponse.ServletResponseHttpHeaders
in order to use ServletResponse#getContentType instead of
ServletResponse#getHeader.

It allows to have a consistent behavior between Tomcat (which sets only
the former) and Undertow/Jetty (which set both).

Closes gh-32339
2024-03-04 15:32:32 +01:00
Sébastien Deleuze 4ce2559980 Merge branch '6.1.x' 2024-03-04 14:43:18 +01:00
Sébastien Deleuze 7493ce86b6 Fix ServletResponseHttpHeaders#get null handling
ServletResponseHttpHeaders#get should be annotated with `@Nullable` and
return null instead of a singleton list containing null when there is no
content type header.

Closes gh-32362
2024-03-04 14:43:09 +01:00
Sébastien Deleuze ce9dc19a3c Optimize content type parsing
This commit avoids calling HttpHeaders#getContentType multiple times in
ServletServerHttpResponse#writeHeaders.

Closes gh-32361
2024-03-04 14:43:09 +01:00
rstoyanchev 1c5bb732b9 Merge branch '6.1.x' 2024-03-04 13:36:30 +00:00
rstoyanchev 4b96cd28c0 Add locking in ServletResponse#flushBuffer
In addition to using the ServletOutputStream, it's also possible to call
ServletResponse#flushBuffer, so the ServletOutputStream wrapper logic needs
to apply there as well.

See gh-32340
2024-03-04 13:35:46 +00:00
Sébastien Deleuze 219004ef13 Merge branch '6.1.x' 2024-03-03 22:26:37 +01:00
Sébastien Deleuze 516a203703 Support nullable Kotlin value class arguments
This commit skips the value class parameter instantiation for nullable
types when a null argument is passed.

Closes gh-32353
2024-03-03 22:26:21 +01:00
rstoyanchev 0758c8b14c Merge branch '6.1.x' 2024-03-03 20:53:36 +00:00
rstoyanchev 877e0b1483 Improve concurrent handling of result in WebAsyncManager
1. Use state transitions
2. Increase synchronized scope in setConcurrentResultAndDispatch

See gh-32340
2024-03-03 20:44:52 +00:00
rstoyanchev 379ffac508 Add state and response wrapping to StandardServletAsyncWebRequest
The wrapped response prevents use after AsyncListener onError or completion
to ensure compliance with Servlet Spec 2.3.3.4.

The wrapped response is applied in RequestMappingHandlerAdapter.

The wrapped response raises AsyncRequestNotUsableException that is now
handled in DefaultHandlerExceptionResolver.

See gh-32340
2024-03-03 20:44:36 +00:00
Sébastien Deleuze bdcd10e228 Merge branch '6.1.x' 2024-03-01 16:53:27 +01:00
Sébastien Deleuze 227e75dae4 Support nullable Kotlin value class arguments
This commit refines WebMVC and WebFlux argument resolution in order to
convert properly Kotlin value class arguments by using the type of the
value instead of the type of the value class.

Closes gh-32353
2024-03-01 16:38:26 +01:00
Sébastien Deleuze 4149d5cb2b Merge branch '6.1.x' 2024-03-01 11:55:08 +01:00
Sébastien Deleuze 85a781d517 Instantiate value class parameters with Kotlin reflection
In order to invoke the init block and to improve the maintainability.

Closes gh-32324
2024-03-01 11:50:19 +01:00
Arjen Poutsma d81619addd Merge branch '6.1.x' 2024-02-29 15:55:29 +01:00
Arjen Poutsma 33705516ff Polishing external contribution
See gh-32318
2024-02-29 15:51:29 +01:00
Patrick Strawderman beb415dfa3 Optimize HttpHeaders.getAcceptLanguageAsLocales
The HttpHeaders.getAcceptLanguageAsLocales was incurring overhead from
using a Stream, as well as calling the fairly expensive
Locale.getDisplayName method.

Switch to using an ArrayList, and skipping over wildcard ranges to avoid
needing to check the display name.

Closes gh-32318
2024-02-29 15:36:55 +01:00
Juergen Hoeller 4ff0f86ae2 Merge branch '6.1.x' 2024-02-28 21:46:15 +01:00
Juergen Hoeller 154ca54c9f Polishing 2024-02-28 21:40:08 +01:00
Juergen Hoeller f22a1eece4 Polishing 2024-02-28 19:14:37 +01:00
Juergen Hoeller cfb29db278 Initial support for Servlet 6.1
Closes gh-31159
2024-02-28 18:54:36 +01:00
Sébastien Deleuze 7c5bcbcba4 Merge branch '6.1.x' 2024-02-28 17:24:08 +01:00
Sébastien Deleuze 45c21042f6 Optimize Kotlin inline class checks
This commit fixes a performance regression caused by gh-31698,
and more specifically by KClass#isValue invocations which are slow since
they load the whole module to find the class to get the descriptor.

After discussing with the Kotlin team, it has been decided that only
checking for the presence of `@JvmInline` annotation is enough for
Spring use case.

As a consequence, this commit introduces a new
KotlinDetector#isInlineClass method that performs such check, and
BeanUtils, CoroutinesUtils and WebMVC/WebFlux InvocableHandlerMethod
have been refined to leverage it.

Closes gh-32334
2024-02-28 17:18:57 +01:00
Sébastien Deleuze 9e7c64270b Merge branch '6.1.x' 2024-02-27 15:52:13 +01:00
Sébastien Deleuze dc1ef23780 Refine *HttpMessageConverter#getContentLength null safety
Closes gh-32325
2024-02-27 15:51:52 +01:00
Sam Brannen 69dabe9df5 Merge branch '6.1.x' 2024-02-26 18:12:55 +01:00
Sam Brannen cca440eb8e Do not cache Content-Type in ContentCachingResponseWrapper
Based on feedback from several members of the community, we have
decided to revert the caching of the Content-Type header that was
introduced in ContentCachingResponseWrapper in 375e0e6827.

This commit therefore completely removes Content-Type caching in
ContentCachingResponseWrapper and updates the existing tests
accordingly.

To provide guards against future regressions in this area, this commit
also introduces explicit tests for the 6 ways to set the content length
in ContentCachingResponseWrapper and modifies a test in
ShallowEtagHeaderFilterTests to ensure that a Content-Type header set
directly on ContentCachingResponseWrapper is propagated to the
underlying response even if content caching is disabled for the
ShallowEtagHeaderFilter.

See gh-32039
Closes gh-32317
2024-02-26 17:52:56 +01:00
Sam Brannen 497aa3c069 Polish ShallowEtagHeaderFilterTests 2024-02-26 17:44:48 +01:00
Sam Brannen 430824038e Merge branch '6.1.x' 2024-02-25 16:28:13 +01:00
Sam Brannen be45481d70 Return unique set from ContentCachingResponseWrapper.getHeaderNames()
Prior to this commit, getHeaderNames() returned duplicates for the
Content-Type and Content-Length headers if they were set in the wrapped
response as well as in ContentCachingResponseWrapper.

This commit fixes that by returning a unique set from getHeaderNames().

In addition, this commit introduces a new test in
ContentCachingResponseWrapperTests to verify the expected behavior for
Content-Type and Content-Length headers that are set in the wrapped
response as well as in ContentCachingResponseWrapper.

See gh-32039
See gh-32317
2024-02-25 16:17:22 +01:00
Sam Brannen 98efa1df5a Merge branch '6.1.x' 2024-02-24 16:42:47 +01:00
Sam Brannen 5680d20637 Honor Content-[Type|Length] headers from wrapped response again
Commit 375e0e6827 introduced a regression in
ContentCachingResponseWrapper (CCRW). Specifically, CCRW no longer
honors Content-Type and Content-Length headers that have been set on
the wrapped response and returns null for those header values if they
have not been set directly on the CCRW.

This commit fixes this regression as follows.

- The Content-Type and Content-Length headers set in the wrapped
  response are honored in getContentType(), containsHeader(),
  getHeader(), and getHeaders() unless those headers have been set
  directly on the CCRW.

- In copyBodyToResponse(), the Content-Type in the wrapped response is
  only overridden if the Content-Type has been set directly on the CCRW.

See gh-32039
Closes gh-32317
2024-02-24 16:37:22 +01:00
Sam Brannen 8787381892 Polish ContentCachingResponseWrapper[Tests] 2024-02-24 16:37:14 +01:00
Juergen Hoeller 87ea3bd31a Merge branch '6.1.x' 2024-02-24 08:35:10 +01:00
Juergen Hoeller 3cc64968b9 Consistent nullability for internal field access 2024-02-24 08:21:37 +01:00
Sam Brannen 122372c580 Spring cleaning: update copyright headers 2024-02-23 12:21:22 +01:00
Sam Brannen 5ae6c0e8ca Spring cleaning: avoid unnecessary super() invocations 2024-02-23 12:21:22 +01:00
Sam Brannen c98bebd6d3 Spring cleaning: add missing @⁠Override annotations 2024-02-23 12:20:11 +01:00
Sam Brannen 4bd1485ce4 Spring cleaning: use method references 2024-02-23 12:20:11 +01:00
Sam Brannen 4339c8eac2 Spring cleaning: use diamond operator 2024-02-23 12:20:11 +01:00
Sam Brannen 233b59f144 Polish Javadoc 2024-02-23 12:20:11 +01:00
Sam Brannen 3c00637c88 Fix @⁠inheritDoc usage 2024-02-23 12:08:29 +01:00
Sam Brannen 644887e094 Polish (Linked)HashSet usage
See gh-32291
2024-02-21 16:22:31 +01:00
Sam Brannen b9c304b890 Polish contribution
See gh-32291
2024-02-21 16:19:53 +01:00
Patrick Strawderman e1a32d4ba9 Avoid resizing of fixed-size HashSet/LinkedHashSet variants
Add helpers to CollectionUtils for building HashSets and LinkedHashSets
that can hold an expected number of elements without needing to
resize/rehash.

Closes gh-32291
2024-02-21 16:19:53 +01:00
Patrick Strawderman f9fe8efb2e Use ConcurrentHashMap.newKeySet
In places where a ConcurrentHashMap was used as a set by wrapping it
with Collections.newSetFromMap, switch to just using the set returned
by ConcurrentHashMap.newKeySet directly.

Closes gh-32294
2024-02-21 14:08:38 +01:00
Arjen Poutsma bc2257aaff Invoke defaultRequest earlier in RestClient and WebClient
Closes gh-32053
2024-02-20 11:21:24 +01:00