Commit Graph

30689 Commits

Author SHA1 Message Date
Stephane Nicoll 0ea7af7465 Polish
See gh-31331
2024-06-24 18:07:59 +02:00
Sébastien Deleuze 8ef74dfdad Prevent compilation warnings with `@Nullable`
This commit replaces `@Nonnull(when = When.MAYBE)` meta-annotation in
org.springframework.lang.Nullable by `@CheckForNull` in order to
prevent "unknown enum constant When.MAYBE" compilation warnings.

IntelliJ IDEA 2024.1.2+ is required to interpret correctly the related
annotations.

Closes gh-27183
2024-06-24 14:56:07 +02:00
Juergen Hoeller 0a0f4c7460 Accept file separator difference in exception message (for Windows compatibility) 2024-06-24 12:28:43 +02:00
Juergen Hoeller d9a2e0b731 Merge branch '6.1.x' 2024-06-24 12:27:23 +02:00
rstoyanchev 6e82bf05b6 Document list/map/array constructor data binding
Closes gh-32426
2024-06-24 11:25:22 +01:00
Juergen Hoeller 4e2fb308f6 Document contentLength() behavior for InputStreamResource and custom subclasses
Closes gh-33089
2024-06-24 12:10:35 +02:00
rstoyanchev e48cbc5ba8 Support list/map/array constructor data binding
See gh-32426
2024-06-24 10:44:32 +01:00
Brian Clozel f9af5d400d Use custom path separator for pattern comparisons
As pointed out in gh-33085, the `AntPatternComparator` hardcodes the "/"
separator when checking for "catch all" patterns like "/**".
This commit ensures that the custom path separator is used for those
checks, in order to guarantee consistent comparator results.

See gh-33085
2024-06-24 11:37:24 +02:00
Brian Clozel 6d1f117103 Polishing contribution
Closes gh-33085
2024-06-24 11:37:16 +02:00
tafjwr 83fcdfba64 Fix AntPathMatcher URI template variable extractor
See gh-33085
2024-06-24 11:37:09 +02:00
Sam Brannen 9b58e1ff71 Merge branch '6.1.x' 2024-06-23 17:44:47 +02:00
Sam Brannen 5f765fc8ce Polishing 2024-06-23 13:22:08 +02:00
Stephane Nicoll 2650da2b53 Provide more control over registration of GeneratedFiles
This commit provides an advanced handling of generated files that
provides more control over files registration. The callback provides
a FileHandler that can determine if the file already exists and its
content. The caller can then chose to override the content or leave it
as it is.

Closes gh-31331
2024-06-22 18:52:33 +02:00
Sam Brannen 6b456b6157 Upgrade to FreeMarker 2.3.33 2024-06-22 16:55:56 +02:00
Sam Brannen e6b77d301d Merge branch '6.1.x' 2024-06-22 16:52:42 +02:00
Sam Brannen 000b563e83 Use consistent formatting for view name in AbstractView 2024-06-22 16:51:37 +02:00
Sam Brannen c571ee1f95 Fix typo in comment 2024-06-22 16:51:28 +02:00
Stéphane Nicoll b134f253b5 Move the testing section after data and web
Closes gh-33083
2024-06-21 14:35:33 +02:00
Stéphane Nicoll 043b93d255 Upgrade to HtmlUnit 4.2.0
Closes gh-33081
2024-06-21 14:30:02 +02:00
Stéphane Nicoll 6e87aba100 Merge branch '6.1.x' 2024-06-21 14:14:26 +02:00
Stéphane Nicoll 899f6308d9 Fix name of GitHub actions bot
See gh-gh-33076
2024-06-21 14:14:05 +02:00
Stéphane Nicoll d43dba63a1 Document AssertJ support for MockMvc
This commit restructures the section on MockMvc so that the anchors
are easier to read. The standard integration has moved to a
Hamcrest Integration section  at the same level as HtmlUnit Integration,
and a new AssertJ Integration section has been created.

Closes gh-32454
2024-06-21 12:51:35 +02:00
Juergen Hoeller 7d236e29bb Merge branch '6.1.x'
# Conflicts:
#	spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java
2024-06-21 11:23:37 +02:00
Juergen Hoeller a580d6d6fc Leniently ignore type mismatch for LoadTimeWeaverAware beans
Closes gh-33082
2024-06-21 11:22:48 +02:00
Juergen Hoeller 7fc2814a34 Merge branch '6.1.x' 2024-06-20 18:57:49 +02:00
Juergen Hoeller 66eddf99af Include original exception if cause is null
Closes gh-33080
See gh-32952
2024-06-20 18:56:43 +02:00
Sam Brannen eeb9959cb9 Polishing 2024-06-20 17:13:48 +02:00
Stéphane Nicoll e5993d92c4 Merge branch '6.1.x' 2024-06-20 14:16:13 +02:00
Stéphane Nicoll e94ec80df4 Exclude GitHub Actions bot from changelog
Closes gh-33076
2024-06-20 14:15:54 +02:00
Juergen Hoeller 52e1f30bfe Merge branch '6.1.x' 2024-06-20 13:48:55 +02:00
Juergen Hoeller 2861e570fd Catch and log LinkageError in getTypeForFactoryMethod
Closes gh-33075
2024-06-20 13:47:43 +02:00
Brian Clozel e3048bce11 Merge branch '6.1.x' 2024-06-19 18:15:55 +02:00
Stéphane Nicoll 5cf8978d22 Restore proper code generation for types with nested generics
This commit aligns code generation to recent improvement in the core
container regarding type detection. Now that nested types are properly
resolved, our code generation that uses hasResolvableGenerics() is
taking the wrong decision if only a nested type has an unresolved
generics. Previously, this was hidden by the fact that the core
container would not resolve them recursively.

A new hasResolvableGenerics() method allows to verify that at least
one direct generic type is resolved. This restore our intent of checking
at the first level only and let recursive invocations figure out if they
have to write the raw type or the type with generics.

Closes gh-33069
2024-06-19 17:48:39 +02:00
Spring Builds ee7a1e8b7e Next development version (v6.1.11-SNAPSHOT) 2024-06-19 15:37:10 +00:00
Juergen Hoeller 1047e1f722 Declare complete set of default methods on ObjectProvider
Closes gh-33070
2024-06-19 16:53:10 +02:00
Brian Clozel 4cbaaa3b1d Move Servlet HTTP Message Conversion to its own section
Closes gh-33063
2024-06-19 15:45:16 +02:00
Arjen Poutsma e62255512a Encode based on response character encoding
Before this commit, characters were always encoded with the default
encoding (i.e. ISO-8859-1). Now, the character encoding of the response
is used.

Closes gh-files
2024-06-19 14:26:38 +02:00
Brian Clozel c72e31bcf5 Merge branch '6.1.x' 2024-06-19 12:51:23 +02:00
Brian Clozel f7307c9e07 Avoid recording RestClient observations twice
Prior to this commit, the fix for gh-32575 introduced cases where the
client observation would be stopped twice.

This commit ensures that `RestClient` observations are stopped only once
when the response is closed, or before throwing an unhanlded exception.

Fixes gh-33068
2024-06-19 12:46:21 +02:00
Sam Brannen ce49354400 Sync MockHttpServletResponse implementations
See gh-33019
2024-06-19 12:31:17 +02:00
Sébastien Deleuze 1d363e5a41 Use UTF-8 with JSON in MockHttpServletResponse
This commit makes MockHttpServletResponse consistent with the other
parts of the framework where the body of a response is read as an UTF-8
String when the content type is application/json or similar, overriding
the ISO-8859-1 default Servlet encoding.

Closes gh-33019
2024-06-19 09:33:43 +02:00
Brian Clozel 2116d71d81 Merge branch '6.1.x' 2024-06-18 19:28:05 +02:00
Brian Clozel 098c4b1dd7 Use Sonatype S01 token in release pipeline 2024-06-18 19:25:20 +02:00
Juergen Hoeller 82af8e62c1 Merge branch '6.1.x' 2024-06-18 18:32:29 +02:00
Juergen Hoeller 65dbfd09b4 Defensive PersistenceExceptionTranslator bean retrieval on shutdown
Closes gh-33067
2024-06-18 18:31:15 +02:00
Sam Brannen d7668eec00 Merge branch '6.1.x' 2024-06-18 16:45:28 +02:00
Sam Brannen 203fa75196 Support all "connection reset" phrases in DisconnectedClientHelper
Prior to this commit, the isClientDisconnectedException() method in
DisconnectedClientHelper checked whether the message of the ultimate
exception in an exception chain contained one of the phrases "broken
pipe" or "connection reset by peer". However, that failed to match if
the exception message contained "Connection reset", which is the case
for the SocketException thrown by throwConnectionReset() in
sun.nio.ch.SocketChannelImpl.

This commit therefore replaces the "connection reset by peer" phrase
with "connection reset" in order to support all exception messages
containing "connection reset".

Closes gh-33064
2024-06-18 16:43:06 +02:00
Stéphane Nicoll 1eaa9cd2f4 Polish 2024-06-18 16:04:19 +02:00
Brian Clozel 17abb4d25d Add codecs for JSON support with Protobuf
Prior to this commit, WebFlux had Protobuf codecs for managing the
`Message`/`"application/x-protobuf"` encoding and decoding.
The `com.google.protobuf:protobuf-java-util` library has additional
support for JSON (de)serialization, but this is not supported by
existing codecs.

This commit adds the new `ProtobufJsonEncode` and `ProtobufJsonDecoder`
classes that support this use case. Note, the `ProtobufJsonDecoder` has
a significant limitation: it cannot decode JSON arrays as
`Flux<Message>` because there is no available non-blocking parser able
to tokenize JSON arrays into streams of `Databuffer`. Instead,
applications should decode to `Mono<List<Message>>` which causes
additional buffering but is properly supported.

Closes gh-25457
2024-06-18 15:48:46 +02:00
Stéphane Nicoll 24bbc6d80d Improve support of async request in MockMvcTester
This commit improves the handling of asynchronous requests by offering
a way to opt-in for the raw async result. This provides first class
support for asserting a request that might still be in process as well
as the asyncResult, if necessary.

See gh-33040
2024-06-18 15:19:47 +02:00