Commit Graph

23315 Commits

Author SHA1 Message Date
Sam Brannen 5d7a632965 Ensure Spring AOP generates JDK dynamic proxies for lambdas
Prior to this commit, if AOP proxy generation was configured with
proxyTargetClass=true (which is the default behavior in recent versions
of Spring Boot), beans implemented as lambda expressions or method
references could not be proxied with CGLIB on Java 16 or higher without
specifying `--add-opens java.base/java.lang=ALL-UNNAMED`.

This commit addresses this shortcoming by ensuring that beans
implemented as lambda expressions or method references are always
proxied using a JDK dynamic proxy even if proxyTargetClass=true.

Closes gh-27971
2022-02-04 19:59:35 +01:00
Stephane Nicoll 6bc7d41734 Merge pull request #28004 from An1s9n
* pr/28004:
  Polish reference to ManagedBean annotation

Closes gh-28004
2022-02-04 09:24:30 +01:00
Pavel Anisimov 05d3e820f9 Polish reference to ManagedBean annotation
See gh-28004
2022-02-04 09:23:32 +01:00
Sam Brannen f8a5a8d7be Use modern language features in tests 2022-02-03 14:50:10 +01:00
Stephane Nicoll 82a2544918 Upgrade to spring javaformat 0.0.31 2022-02-03 08:49:16 +01:00
Stephane Nicoll e702c22da4 Upgrade Ubuntu version in CI image 2022-02-03 08:48:52 +01:00
rstoyanchev c4e362500b Polishing tests 2022-02-02 17:09:04 +00:00
rstoyanchev 8d5a6520ce Ensure all converters don't close InputStream
Closes gh-27969
2022-02-02 15:55:13 +00:00
rstoyanchev 4effca35b5 Ignore Content-Type that is invalid (not concrete)
Closes gh-27957
2022-02-02 15:55:07 +00:00
Arjen Poutsma 8f9a1cdc0c Consider current date in "1W" cron expressions
Prior to this commit, the QuartzCronField::weekdayNearestTo would elapse
until the next month before checking if the current day matched.

After this commit, the current day is checked before we elapse until
the next month.

Closes gh-27966
2022-02-01 13:51:40 +01:00
Stephane Nicoll 136bd2002e Upgrade to spring javaformat 0.0.30 2022-01-31 09:34:12 +01:00
Sam Brannen a749a6bf54 Stop applying Groovy plugin for the root Gradle project
The root project does not rely on the Groovy plugin.

See gh-27945
2022-01-30 15:49:59 +01:00
Sam Brannen 7072aab53b Improve log message when searching for default executor for async processing
Closes gh-27983
2022-01-30 15:44:40 +01:00
Sam Brannen dbeae27d3c Reduce build time by reducing shutdown wait period for Jetty tests 2022-01-29 12:41:39 +01:00
Sam Brannen fb312d0ed5 Improve Javadoc for DatabasePopulator
See gh-27008
2022-01-28 16:40:35 +01:00
Sam Brannen 0e670b1c15 Polish contribution
See gh-27984
2022-01-28 16:15:21 +01:00
wkwkhautbois fadfcf4e43 Fix ServletUriComponentsBuilder examples in ref docs
Closes gh-27984
2022-01-28 16:10:54 +01:00
Arjen Poutsma caa13690e8 Support multiple boundary buffers in MultipartParser
In a small minority of cases, the multipart boundary can spread across
three incoming buffers.

Prior to this commit, MultipartParser.BodyState only supported two
buffers. If the boundary is spread across three buffers, the first
buffer of the three is sent as a whole, even though it contains the
first bytes of the boundary.

This commit fixes this bug, by enqueuing all prior buffers in a queue,
and emitting the ones that cannot contain boundary bytes.

Closes gh-27939
2022-01-28 13:42:24 +01:00
Sam Brannen 6647023151 Document how to register annotated classes in a GenericWebApplicationContext
Closes gh-27778
2022-01-27 16:08:16 +01:00
Sam Brannen e32f94bf8c Polish GenericWebApplicationContext and AnnotationConfigWebApplicationContext 2022-01-27 16:08:07 +01:00
Stephane Nicoll bd6d697395 Upgrade Java versions in CI image 2022-01-27 09:52:25 +01:00
Sam Brannen 7f65e17ff2 Improve documentation for implementing AspectJ around advice
Closes gh-27980
2022-01-26 17:32:48 +01:00
Sam Brannen 9095f1d584 Polish AspectJ documentation 2022-01-26 17:32:48 +01:00
Stephane Nicoll 4f16d5b5b2 Merge pull request #27826 from Drezir
* pr/27826:
  Polish "Add CacheErrorHandler implementation that logs exceptions"
  Add CacheErrorHandler implementation that logs exceptions

Closes gh-27826
2022-01-26 14:12:13 +01:00
Stephane Nicoll 6a6c7df824 Polish "Add CacheErrorHandler implementation that logs exceptions"
See gh-27826
2022-01-26 14:10:49 +01:00
Adam Ostrožlík 5c9fbcc23c Add CacheErrorHandler implementation that logs exceptions
See gh-27826
2022-01-26 14:10:49 +01:00
Sam Brannen f4f5cee76c Polish AOP namespace tests 2022-01-26 12:29:30 +01:00
Sam Brannen bf1cf549b1 Delete unused XML config in AOP namespace tests
See gh-22246
2022-01-26 12:15:10 +01:00
Juergen Hoeller 1272cd557d Upgrade to SmallRye Mutiny 1.3.1, Aalto 1.3.1, Woodstox 6.2.8 2022-01-26 00:02:12 +01:00
Juergen Hoeller 993b6d1351 Upgrade to Tomcat 9.0.58, Protobuf 3.19.3, Rome 1.18, H2 2.1.210, SLF4J 1.7.35, Mockito 4.3.1, HtmlUnit 2.57, XMLUnit 2.9, Checkstyle 9.2.1 2022-01-25 23:51:22 +01:00
Juergen Hoeller 0a92d84778 Check open status before close call (aligned with EntityManagerFactoryUtils)
Closes gh-27972
2022-01-25 23:50:45 +01:00
Sam Brannen 652c13a6ea Enable ReflectionUtilsTests.findMethodWithVarArgs()
See gh-13286
2022-01-25 09:58:57 +01:00
Sam Brannen cb3fa89946 Polish ReflectionUtilsTests 2022-01-25 09:57:36 +01:00
Sam Brannen d01dca14e9 Filter methods in Object in ReflectionUtils.USER_DECLARED_METHODS
Prior to this commit, the USER_DECLARED_METHODS MethodFilter in
ReflectionUtils did not actually filter methods declared in
java.lang.Object as stated in its Javadoc.

Consequently, if ReflectionUtils.doWithMethods was invoked with
USER_DECLARED_METHODS and Object.class as the class to introspect, all
non-bridge non-synthetic methods declared in java.lang.Object were
passed to the supplied MethodCallback, which breaks the contract of
USER_DECLARED_METHODS.

In addition, if USER_DECLARED_METHODS was composed with a custom
MethodFilter using `USER_DECLARED_METHODS.and(<custom MethodFilter>)`,
that composed method filter allowed all non-bridge non-synthetic
methods declared in java.lang.Object to be passed to the supplied
MethodCallback, which also breaks the contract of
USER_DECLARED_METHODS. This behavior resulted in regressions in code
that had previously used USER_DECLARED_METHODS by itself and then began
using USER_DECLARED_METHODS in a composed filter. For example, since
commit c419ea7ba7 ReflectiveAspectJAdvisorFactory has incorrectly
processed methods in java.lang.Object as candidates for advice methods.

This commit fixes this bug and associated regressions by ensuring that
USER_DECLARED_METHODS actually filters methods declared in
java.lang.Object. In addition, ReflectionUtils.doWithMethods now aborts
its search algorithm early if invoked with the USER_DECLARED_METHODS
filter and Object.class as the class to introspect.

Closes gh-27970
2022-01-24 20:09:22 +01:00
Sam Brannen d698446f7c Polish ReflectionUtils[Tests] 2022-01-24 19:46:40 +01:00
Stephane Nicoll 5ef023afd2 Merge pull request #27967 from arey
* pr/27967:
  Fix CaffeineCacheManager configuration example in reference doc

Closes gh-27967
2022-01-22 10:42:08 +01:00
Antoine Rey 316764cad0 Fix CaffeineCacheManager configuration example in reference doc
See gh-27967
2022-01-22 10:40:47 +01:00
Sam Brannen a681d6af22 Fix Javadoc links to JSR 305 annotations where feasible
Prior to this commit, we only (indirectly) configured external Javadoc
links for types in the javax.annotation package for JSR 250, since
those types are part of Java 8 SE. However, an external Javadoc link
for types from JSR 305 was not configured.

To address this issue, this commit now configures an external Javadoc
link for JSR 305 types. However, the external Javadoc link for JSR 305
must be configured last to ensure that types from JSR 250 (such as
@PostConstruct) are still supported. This is due to the fact that JSR
250 and JSR 305 both define types in javax.annotation, which results in
a split package, and the javadoc tool does not support split packages
across multiple external Javadoc sites. Instead, the Javadoc tool
iterates over all external links, and the first external site that
claims to support a given package (via the package-list file) wins.

This means:

- Javadoc for JSR 250 annotations is fully supported.
- Javadoc for JSR 305 annotations in the javax.annotation package will
  continue to result in a 404 (page not found) error.
- Javadoc for JSR 305 annotations in the javax.annotation.meta package
  is fully supported.

For Spring Framework 6.0, the Javadoc for JSR 250 types in
jakarta.annotation package is served from the JBoss Application Server
Javadoc site instead of from Oracle's Java SE documentation site, since
JSR 250 annotations are no longer included in Java SE.

Closes gh-27904
2022-01-21 16:07:55 +01:00
shirohoo 7211912057 Polish tests in spring-web
This PR polishes trivial things in tests in spring-web.

Closes gh-27958
2022-01-20 15:44:24 +01:00
Juergen Hoeller 148eac0200 Upgrade to SLF4J 1.7.33, Netty 4.1.73, R2DBC Arabba-SR12 2022-01-19 13:54:22 +01:00
Juergen Hoeller 86be03945b Polishing 2022-01-19 13:54:03 +01:00
Juergen Hoeller 537aced28b Avoid message listener recovery in case of persistence exceptions on commit
Closes gh-1807
2022-01-19 13:53:38 +01:00
Sam Brannen 5c76ff5ef6 Ensure unresolvable placeholders can be ignored with @Value
Prior to this commit, if a PropertySourcesPlaceholderConfigurer bean
was configured with its ignoreUnresolvablePlaceholders flag set to
true, unresolvable placeholders in an @Value annotation were not
ignored, resulting in a BeanCreationException for the bean using @Value.

For example, given a property declared as `my.app.var = ${var}` without
a corresponding `var` property declared, an attempt to resolve
`@Value("${my.app.var}")` resulted in the following exception.

java.lang.IllegalArgumentException: Could not resolve placeholder 'var' in value "${var}"

This commit fixes this by modifying
PropertySourcesPlaceholderConfigurer's postProcessBeanFactory(...)
method so that a local PropertyResolver is created if the
ignoreUnresolvablePlaceholders flag is set to true. The local
PropertyResolver then enforces that flag, since the Environment in the
ApplicationContext is most likely not configured with
ignoreUnresolvablePlaceholders set to true.

Closes gh-27947
2022-01-18 16:00:55 +01:00
Sam Brannen d02d5adb54 Download gradle-enterprise-conventions plugin from "release" repo
See gh-27942
2022-01-17 18:03:27 +01:00
Jerome Prinet 71f7469578 Upgrade to Gradle Enterprise 3.8.1
Closes gh-27942
2022-01-17 17:59:38 +01:00
Sam Brannen 420c4f3df3 Explicitly test BeanPropertyRowMapper.underscoreName(String)
See gh-27929
2022-01-17 16:54:03 +01:00
Sam Brannen 420ff46b2a Polishing 2022-01-17 16:54:03 +01:00
Marten Deinum 261bc2ad6a Fix regression in BeanPropertyRowMapper.underscoreName(String)
Commit 6316a35 introduced a regression for property names starting with
multiple uppercase letters (such as setEMail(...)).

This commit fixes that regression and includes an additional test to
cover this case.

See gh-27929
Closes gh-27941
2022-01-17 16:53:36 +01:00
Sam Brannen c92b9bc7fe Properly abort transferTo test for Undertow
Instead of simply returning prematurely and allowing the tests to be
marked as SUCCESS, this commit uses a failed assumption to abort the
the trasferTo tests for Undertow, resulting in the parameterized test
invocation properly being marked as ABORTED.

See gh-25310
2022-01-13 17:55:37 +01:00
Sam Brannen 4b1b25496b Improve comment parsing in DTD/XSD detection algorithm
Prior to this commit, XmlValidationModeDetector did not properly parse
all categories of comments (described below). When such categories of
comments were encountered XmlValidationModeDetector may have
incorrectly detected that an XML file used a DTD when it used an XSD,
or vice versa.

This commit revises the parsing algorithm in XmlValidationModeDetector
so that multi-line comments and multiple comments on a single line are
properly recognized.

Specifically, with this commit the following categories of comments are
now handled properly.

- Multiple comments on a single line
- Multi-line comment: beginning on one line and then ending on another
  line with an additional comment following on that same line.
- Multi-line comment: beginning at the end of XML content on one line
  and then spanning multiple lines.

Closes gh-27915
2022-01-13 16:11:15 +01:00