Commit Graph

25657 Commits

Author SHA1 Message Date
Sam Brannen
bf1cf549b1 Delete unused XML config in AOP namespace tests
See gh-22246
2022-01-26 12:15:10 +01:00
Juergen Hoeller
c58885fc35 Upgrade to Hibernate ORM 5.6.5, Eclipse Yasson 2.0.4, JRuby 9.3.3 2022-01-26 00:24:01 +01:00
Juergen Hoeller
065ac8e081 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-orm/src/main/java/org/springframework/orm/hibernate5/SessionFactoryUtils.java
2022-01-26 00:06:12 +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
Stephane Nicoll
48ce714d15 Provide an API to record various runtime hints
This commit provides an API to record the need for reflection,
resources, serialization, and proxies so that the runtime can be
optimized accordingly.

`RuntimeHints` provides an entry point to register the following:

* Reflection hints: individual elements of a type can be defined, as
well as a predefined categories (identified by the `MemberCategory`
enum). A method or constructor hint can refine whether the executable
should only be introspected or also invoked.
* Resource hints: patterns using includes/excludes identify the
resources to include at runtime. Resource bundles are also supported.
* Java Serialization hints: types that use java serialization can be
registered.
* Proxy hints: both interfaces-based (JDK) proxy and class-based proxy
can be defined.

This commit also introduces a `TypeReference` abstraction that permits
to record hints for types that are not available on the classpath, or
not compiled yet (generated code).

Closes gh-27829
2022-01-25 15:45:40 +01:00
Sam Brannen
72fc706c22 Merge branch '5.3.x' 2022-01-25 10:03:51 +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
08daacfc1b Merge branch '5.3.x' 2022-01-24 20:33:51 +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
f9a19c749b Merge branch '5.3.x' 2022-01-22 10:42:18 +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
54c7f53eff Avoid use of var declarations
See gh-27945.
2022-01-21 19:25:44 +01:00
Sam Brannen
b943a7a07c Merge branch '5.3.x' 2022-01-21 16:09:40 +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
Sam Brannen
a323c39e97 Remove Groovy from "Eclipse/STS Project Import Guide"
Groovy support is no longer required in the IDE due to gh-27945.
2022-01-21 11:27:09 +01:00
Sam Brannen
9af2c9d55d Overhaul GroovyBeanDefinitionReaderTests
This commit switches from CGLIB-based proxies to JDK dynamic proxies
for AOP and scoped-bean tests, in order to be able to run tests in the
Eclipse IDE without special Run Configuration setup for the Java module
system.

This commit also simplifies the loading of beans defined with the Groovy
DSL.

See gh-27945
2022-01-21 11:16:35 +01:00
Sam Brannen
e94e67cd93 Polish GroovyApplicationContextTests
See gh-27945
2022-01-21 11:16:35 +01:00
Sam Brannen
1cf2960eb6 Use AssertJ instead of Groovy Assertions
See gh-27945
2022-01-21 11:16:35 +01:00
Sam Brannen
a6deac3ffe Polish contribution
See gh-27945
2022-01-21 10:33:32 +01:00
Dave Syer
f7c3706361 Port GroovyDynamicElementReader to Java
Prior to this commit, GroovyDynamicElementReader was implemented in
Groovy, which required that developers have Groovy language support
installed and configured in their IDEs.

This commit ports GroovyDynamicElementReader from Groovy to Java,
making the compilation much simpler and allowing developers to open the
project in Eclipse or VSCode (or other IDEs without Groovy support)
without compiler errors.

This commit also converts related tests from Groovy to Java.

Closes gh-27945
2022-01-20 17:42:17 +01:00
Sam Brannen
912bb16e44 Merge branch '5.3.x' 2022-01-20 15:54:50 +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
66732afc10 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-jms/src/main/java/org/springframework/jms/listener/AbstractPollingMessageListenerContainer.java
2022-01-19 13:56:37 +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
e565d2cabb Apply "instanceof pattern matching" in PropertySourcesPlaceholderConfigurer
See gh-27947
2022-01-18 16:23:41 +01:00
Sam Brannen
d72cf89ebf Make PropertySourcesPlaceholderConfigurerTests pass on JDK 17
This change is required in Eclipse IDE but not for the Gradle build.

See gh-27947
2022-01-18 16:21:26 +01:00
Sam Brannen
4a51e4bbc7 Merge branch '5.3.x' 2022-01-18 16:16:10 +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
4388a7c4d0 Merge branch '5.3.x' 2022-01-17 18:05:06 +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
19da4e309f Merge branch '5.3.x' 2022-01-17 16:55:08 +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
316e84f04f Polish contribution
See gh-27908
2022-01-14 15:53:41 +01:00
Frank Chen
f43fb41bce Simplify debugging of Undertow transferTo issue
This commit introduces a dedicated (disabled) transferToWithUndertow()
test method to simplify debugging of transferTo issues with Undertow.

See gh-25310
Closes gh-27908
2022-01-14 15:44:29 +01:00
Sam Brannen
a849f76586 Merge branch '5.3.x' 2022-01-13 17:57:14 +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
198576dbc5 Merge branch '5.3.x' 2022-01-13 16:21:16 +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
Sam Brannen
9e8b6feb54 Polishing 2022-01-13 14:56:14 +01:00
Stephane Nicoll
680ec30148 Merge branch '5.3.x' 2022-01-13 13:23:25 +01:00