Commit Graph

29473 Commits

Author SHA1 Message Date
Stéphane Nicoll
9eb2f29d4a Move sample to unit test
See gh-28904
2023-11-27 07:58:19 +01:00
Sam Brannen
97264c77dd Consistently log exceptions from TestExecutionListeners at WARN level
Prior to this commit, the TestContextManager logged an exception from a
TestExecutionListener at WARN level except in prepareTestInstance()
where such an exception was logged at ERROR level (except for a skipped
exception which is logged at INFO level).

For consistency, this commit modifies TestContextManager so that it
always logs non-skipped exceptions from TestExecutionListeners at WARN
level.

Closes gh-31688
2023-11-26 12:44:13 +01:00
Sam Brannen
b17f3bc07b Polishing 2023-11-26 12:31:15 +01:00
Sam Brannen
a15f472898 Include scroll() in SharedEntityManagerCreator's queryTerminatingMethods
This commit supports the scroll() and scroll(ScrollMode) methods from
Hibernate's Query API in SharedEntityManagerCreator's query-terminating
methods set.

Closes gh-31682
2023-11-26 12:12:54 +01:00
Stéphane Nicoll
0785256b2f Match HandlerMapping lookup to bean signature
This commit makes sure to initialize any HandlerMapping defined in the
context when searching for resource handlers. Previously, the detection
algorithm was looking up for `SimpleUrlHandlerMapping` while the
declared target type in WebMvcConfigurationSupport is HandlerMapping.
If the application uses lazy initialization, the lookup algorithm would
not force that bean to be initialized.

Closes gh-25488
2023-11-26 09:59:12 +01:00
Sam Brannen
95e250d4bd Log test aborted exceptions at INFO level in the TestContext framework
Prior to this commit, any time an aborted/skipped exception was thrown
by a TestExecutionListener, the TestContextManager unconditionally
logged the exception at WARN level -- or ERROR level for
prepareTestInstance() callbacks.

Regarding the latter, an aborted/skipped exception is certainly not an
ERROR, and in general the associated log output is very verbose
(including a stack trace) and not something the user should be warned
about it.

To improve the user experience, this commit revises TestContextManager
so that it logs such exceptions at INFO level.

Specifically, the following types of exceptions are considered
aborted/skipped exceptions.

- JUnit Jupiter: org.opentest4j.TestAbortedException
- JUnit 4 org.junit.AssumptionViolatedException
- TestNG: org.testng.SkipException

Closes gh-31479
2023-11-25 18:12:43 +01:00
Sam Brannen
dbad9fd208 Update copyright headers 2023-11-25 14:59:40 +01:00
Sam Brannen
657b1c6455 Document need for -parameters flag in exception messages
Closes gh-31675
2023-11-25 14:53:56 +01:00
Sam Brannen
23dc5696d9 Polish contribution
See gh-31679
2023-11-25 14:26:45 +01:00
RedStainedInk
a56bf87476 Clarify that DI is a type of IoC
The documentation currently states that Inversion of Control (IoC) and
Dependency Injection (DI) are the same thing. Although the two terms
are related, they are not synonymous: DI is a type of IoC.

I believe this change is important because using the terms
interchangeably really muddies the water about the meaning of these two
fundamental concepts of software frameworks.

Closes gh-31679
2023-11-25 14:15:52 +01:00
Stéphane Nicoll
c2745de60c Polish 2023-11-25 09:57:13 +01:00
Juergen Hoeller
710373d286 Consider generics in equals method (for ConversionService caching)
Closes gh-31672
2023-11-24 23:25:59 +01:00
Juergen Hoeller
0599320bd8 Filter candidate methods by name first (for more efficient sorting)
Closes gh-28377
2023-11-24 23:25:28 +01:00
Juergen Hoeller
8921be18de Properly return loaded type even if identified as reloadable
Closes gh-31668
2023-11-24 23:25:01 +01:00
Juergen Hoeller
6ff75f157b Detect current schema as indicated by JDBC Connection
Closes gh-28723
2023-11-24 23:24:20 +01:00
Brian Clozel
15d9d9d06a Add current observation context in ClientRequest
Prior to this commit, `ExchangeFilterFunction` could only get the
current observation from the reactor context. This is particularly
useful when such filters want to add KeyValues to the observation
context.

This commit makes this use case easier by adding the context of the
current observation as a request attribute. This also aligns the
behavior with other instrumentations.

Fixes gh-31609
2023-11-24 17:36:15 +01:00
Krane
894dce7cd8 Optimize loops on BeanDefinitionPropertiesCodeGenerator
Closes gh-31650
2023-11-24 16:30:24 +01:00
Stéphane Nicoll
34031ebea9 Escape schema and function name patterns if necessary
The JDBC API that retrieves a proedure or a function allows to specify
patterns for the schema and the procedure name. So far, we've called
this API with the value as is, which does not work if either contains
a wildcard characters that need to be escaped.

This commit updates GenericCallMetadataProvider to escape, if necessary,
the schema or procedure name using the search string escape from the
database metadata.

Closes gh-22725
2023-11-24 15:49:41 +01:00
Brian Clozel
b2757d9a21 Add Javadoc to MockHttpServletResponse#getErrorMessage
Closes gh-31386
2023-11-24 14:41:36 +01:00
Sébastien Deleuze
655b4aacb7 Upgrade to Kotlin 1.9.21
Closes gh-31667
2023-11-24 10:43:40 +01:00
Stéphane Nicoll
fb4455b396 Polish 2023-11-24 08:38:47 +01:00
Stéphane Nicoll
677b03c36d Merge pull request #31663 from quaff
* pr/31663:
  Polish "Polish GenericTypeResolver Javadoc"
  Polish GenericTypeResolver Javadoc

Closes gh-31663
2023-11-24 08:32:37 +01:00
Stéphane Nicoll
85aa4b65dc Polish "Polish GenericTypeResolver Javadoc"
See gh-31663
2023-11-24 08:30:40 +01:00
Yanming Zhou
0b61755ea3 Polish GenericTypeResolver Javadoc
See gh-31663
2023-11-24 08:28:27 +01:00
Brian Clozel
3bcd30e811 Remove API diff Gradle plugin configuration
We have not published API diffs for a while now so we should remove the
configuration entirely from our build.
2023-11-23 16:19:20 +01:00
Juergen Hoeller
121e3540cc Clear cached executors in setBeanFactory (for reused AspectJ aspect)
Closes gh-28201
2023-11-23 16:15:01 +01:00
Juergen Hoeller
0d8dee2878 Apply fallback for proxy with negative match or annotation pointcut
See gh-30534
2023-11-23 16:14:33 +01:00
Yanming Zhou
3a6d0c1d5b Always fall back to original method if annotation pointcut used
Prior to this commit, AspectJExpressionPointcut doesn't fall back to original method if `!@annotation()` is used, it can cause false positive result.

Fix GH-27119
2023-11-23 16:01:18 +01:00
Stéphane Nicoll
16c6376b3f Merge pull request #31659 from Johannes-Rost
* pr/31659:
  Polish "Polish RestClient Javadoc"
  Polish RestClient Javadoc

Closes gh-31659
2023-11-23 13:01:37 +01:00
Stéphane Nicoll
487dbf8140 Polish "Polish RestClient Javadoc"
See gh-31659
2023-11-23 12:59:03 +01:00
johannesrost
e95f8d2922 Polish RestClient Javadoc
See gh-31659
2023-11-23 12:38:16 +01:00
Spring Builds
52b40ffb03 Next development version (v6.1.2-SNAPSHOT) 2023-11-23 08:58:29 +00:00
Brian Clozel
d50b51e312 Fix ordering of releasing resources in JSON Encoder
Prior to this commit, the Jackson 2.x encoders, in case of encoding a
stream of data, would first release the `ByteArrayBuilder` and then the
`JsonGenerator`. This order is inconsistent with the single value
variant (see `o.s.h.codec.json.AbstractJackson2Encoder#encodeValue`) and
invalid since the `JsonGenerator` uses internally the
`ByteArrayBuilder`.

In case of a CSV Encoder, the codec can buffer data to write the column
names of the CSV file. Writing an empty Flux with this Encoder would not
fail but still log a NullPointerException ignored by the reactive
pipeline.

This commit fixes the order and avoid such issues at runtime.

Fixes gh-30493
2023-11-22 18:21:06 +01:00
rstoyanchev
03b9edc36e Update STOMP WebSocket transport reference docs
Closes gh-31616
2023-11-22 15:20:56 +00:00
Juergen Hoeller
824bc09d11 Actual caching of null values in retrieve(key, valueLoader)
See gh-31637
2023-11-22 15:56:26 +01:00
Sébastien Deleuze
441e210533 Treat kotlin.Unit as void in web controllers
This commit fixes a regression introduced by gh-21139
via the usage of Kotlin reflection to invoke HTTP
handler methods. It ensures that kotlin.Unit is treated
as void by returning null.

It also polishes CoroutinesUtils to have a consistent
handling compared to the regular case, and adds related
tests to prevent future regressions.

Closes gh-31648
2023-11-22 13:45:03 +01:00
Sébastien Deleuze
c329ed83ef Polish InvocableHandlerMethodKotlinTests 2023-11-22 12:40:47 +01:00
Juergen Hoeller
48f3c08395 Test for mixed order across bean factory hierarchy
See gh-28374
2023-11-22 12:38:04 +01:00
Juergen Hoeller
c60926476a Polishing 2023-11-22 12:23:24 +01:00
Juergen Hoeller
e64b81eec4 Revised handling of allowNullValues for asynchronous retrieval
Includes revised cacheNames javadoc and equals/hashCode for SimpleValueWrapper.

See gh-31637
2023-11-22 12:22:13 +01:00
Juergen Hoeller
5a3ad6b7c9 Late key generation for consistent evaluation of unless expressions
Includes removal of evict step on pipeline exception, retaining a previous cache value and avoiding an incomplete key (for consistency with non-reactive caching).

Closes gh-31626
2023-11-22 00:27:32 +01:00
Juergen Hoeller
1410c466b7 Support for late-determined cache misses from retrieve(key)
Closes gh-31637
2023-11-21 23:11:34 +01:00
rstoyanchev
8ffbecc7c3 WebSocketMessageBrokerStats implements SmartInitializingSingleton
Closes gh-26536
2023-11-21 17:58:00 +00:00
Arjen Poutsma
e6ab8a6d61 Remove attributes from RestClient
This commit removes any references to attributes from RestClient, which
were left by mistake.

Closes gh-31625
2023-11-21 16:12:06 +01:00
Simon Baslé
8567402969 Extract recurring asciidoc links to attributes, cleanup old doc files
This commit extract spring-related links and recurring external links
into asciidoctor attributes to be used by the Antora toolchain.

It notably homogenizes links to:
 - IETF RFCs
 - Java Community Process JSRs
 - the Java API Documentation (on the Java 17 version)
 - Kotlin documentations (on the Kotlinlang.org version)
 - the Spring Boot reference guide (on the `html` version)

This commit also reworks most link attributes to follow a
Project-Category-Misc syntax. For example, `spring-boot-docs` rather
than `docs-spring-boot`.

Finally, it makes an effort to clean up remainders from the previous
documentation toolchain, namely the `docs/asciidoc` folder and 
`modules/ROOT/pages/attributes.adoc` file.

Closes gh-26864
Closes gh-31619
2023-11-21 15:59:24 +01:00
Sébastien Deleuze
4cc43b4ddc Refine AppCDS documentation
See gh-31497
2023-11-21 15:29:03 +01:00
Sébastien Deleuze
bec385d310 Use JarURLConnection caching defaults
In order to prevent leaks of large amounts of non-heap
memory (and potential other efficiency and performance side
effects), this commit updates ResourceUtils#useCachesIfNecessary
to leave the caching flag to its JVM default value for instances
of JarURLConnection.

The previous behavior was originally introduced via gh-9316 and
gh-13755 to avoid I/O failure during webapp hot reloading in
Servlet containers. This is not a popular deployment mode anymore
and we have not been able to reproduce the original issue with
a Java 17 JVM and Tomcat 10.

Closes gh-30955
2023-11-21 12:00:45 +01:00
Sam Brannen
878b33c56f Further polish LruContextCacheTests
See gh-31640
2023-11-21 11:29:09 +01:00
Yanming Zhou
f46902869f Polish LruContextCacheTests
Use AssertJ's extracting() feature instead of ReflectionTestUtils.getField().

Closes gh-31640
2023-11-21 11:22:16 +01:00
Sam Brannen
617ba84577 Remove notes about WebTestClient type inference issue in Kotlin
Since gh-28144 was resolved in Spring Framework 6.0, these notes are no
longer relevant.
2023-11-21 10:23:10 +01:00