Commit Graph

643 Commits

Author SHA1 Message Date
Sam Brannen ee209de9cf Merge branch '5.3.x'
# Conflicts:
#	spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java
#	spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java
#	spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java
#	spring-web/src/test/java/org/springframework/remoting/jaxws/JaxWsSupportTests.java
#	spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/ViewResolutionIntegrationTests.java
2022-05-31 14:15:36 +02:00
Sam Brannen 1beb7068f6 Use new AssertJ exception assertions 2022-05-31 14:08:28 +02:00
Stephane Nicoll 6bd25f60dd Polish 2022-05-24 11:57:14 +02:00
Sam Brannen 70415b1781 Merge branch '5.3.x' 2022-05-17 15:41:08 +02:00
Sam Brannen 59c7bb1f86 Use Arrays.toString instead of Arrays.asList when generating Strings 2022-05-17 15:36:31 +02:00
Sam Brannen eb50a6f4a0 Further polishing regarding JDK baseline upgrade
See gh-28440
2022-05-10 17:01:40 +02:00
lihan a892ce80c1 Polishing regarding JDK baseline upgrade
Closes gh-28440
2022-05-10 17:01:40 +02:00
Phillip Webb 16e7f1f212 Complete refactor of AOT concepts
Remove the AOT code that now has an alternative API.

Closes gh-28414
2022-05-05 13:34:52 -07:00
Phillip Webb 588d4d8776 Update scoped proxy AOT support
Add `ScopedProxyBeanRegistrationCodeGeneratorFactory` to supply custom
scoped proxy bean registration code.

See gh-28414
2022-05-05 13:25:37 -07:00
Juergen Hoeller 17c778e3a0 Preserve javax nullability annotations for AOP Alliance fork
See gh-28410
2022-05-05 17:26:17 +02:00
Phillip Webb 63b129a3f7 Check that nullable annotations are from org.springframework.lang
Fix a few incorrect nullable annotation imports and add a checkstyle
rule to ensure they don't return.

Closes gh-28410
2022-05-03 11:14:53 -07:00
Stephane Nicoll 5378572b00 Clarify lambda code block methods 2022-04-26 15:13:43 +02:00
Stephane Nicoll f64fc4baff Generate appropriate bean registration code for scoped proxies
Closes gh-28383
2022-04-26 15:03:54 +02:00
Sam Brannen c9e7816762 Merge branch '5.3.x' 2022-04-09 10:43:02 +02:00
Sam Brannen 6fad00ed22 Ensure dynamic proxy with AOP introduction includes lambda interfaces
Closes gh-28209
2022-04-09 09:57:43 +02:00
Sam Brannen 5f6d8df34b Introduce isLambdaClass() as a public utility in ClassUtils
This commit extracts isLambda() from AopProxyUtils and makes it
publicly available as ClassUtils.isLambdaClass().

This is a prerequisite for gh-28209.
2022-04-09 09:57:43 +02:00
Juergen Hoeller 7e1782ea22 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-core/src/main/java/org/springframework/core/convert/Property.java
2022-04-08 13:10:34 +02:00
Juergen Hoeller 7aed6279a2 Consistent fallback in case of fast-class generation failure
Closes gh-28138
2022-04-08 13:02:36 +02:00
Sam Brannen b570f60560 Merge branch '5.3.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java
#	spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationClassFilter.java
#	spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMatchingPointcut.java
#	spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMethodMatcher.java
#	spring-beans/src/main/java/org/springframework/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.java
#	spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java
#	spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedNotification.java
#	spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameter.java
#	spring-core/src/main/java/org/springframework/javapoet/support/package-info.java
#	spring-core/src/main/java/org/springframework/util/TypeUtils.java
#	spring-web/src/main/java/org/springframework/http/HttpMethod.java
2022-03-18 16:47:12 +01:00
Sam Brannen 64b64d9ba0 Stop referring to features as "Java 5" features
With a Java 8 baseline in place for quite some time now, it no longer
makes sense to refer to features such as annotations as "Java 5
annotations".

This commit also removes old `Tiger*Tests` classes, thereby avoiding
duplicate execution of various tests.
2022-03-18 16:32:30 +01:00
Sam Brannen be8224a590 Polish contribution
See gh-27818
2022-02-19 16:04:55 +01:00
Guirong Hu 01214b3473 Allow @Async qualifier to be declared with a placeholder or SpEL expression
Closes gh-27818
2022-02-19 15:09:40 +01:00
Sam Brannen 6a73d2655f Polishing 2022-02-19 14:59:54 +01:00
Sam Brannen 8c6d59aaaf Polish contribution
See gh-28014
2022-02-19 14:43:26 +01:00
a.yazychyan c5c926726d Use enhanced switch expressions where feasible
Closes gh-28014
2022-02-19 14:34:05 +01:00
Juergen Hoeller 69db0f7b45 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
2022-02-16 20:07:55 +01:00
Juergen Hoeller f8a59c267f Polishing 2022-02-16 20:04:51 +01:00
Stephane Nicoll 9a0f691e86 Merge branch '5.3.x' 2022-02-05 13:59:45 +01:00
izeye 4ab03fede8 Fix Javadoc since for AopProxyUtils.isLambda()
See gh-28010
2022-02-05 13:59:01 +01:00
Sam Brannen 4358b48b08 Merge branch '5.3.x' 2022-02-04 20:01:48 +01:00
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
Sam Brannen 54565e95b5 Merge branch '5.3.x' 2022-02-03 14:58:36 +01:00
Sam Brannen f8a5a8d7be Use modern language features in tests 2022-02-03 14:50:10 +01:00
Sam Brannen 24ff2d2b6f Merge branch '5.3.x' 2022-01-30 15:45:55 +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 e7b9d61225 Merge branch '5.3.x' 2022-01-26 12:32:25 +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
Sam Brannen 4ebc53a424 Merge branch '5.3.x' 2022-01-10 13:28:31 +01:00
kuanghc1 e24043ab90 Simplify HashMap declaration in test fixture 2022-01-10 13:27:15 +01:00
springmonster aaa10e9060
Simplify HashMap declaration in test fixture
Co-authored-by: kuanghc1 <kuanghc1@lenovo.com>

Closes gh-27900
2022-01-07 10:15:39 +01:00
Sam Brannen 61c3d7a989 Merge branch '5.3.x' 2022-01-04 14:09:02 +01:00
Sam Brannen 03668f9c10 Replace remaining use of StringBuffer with StringBuilder
Although this commit only applies to test classes, it serves to reduce
the noise when searching for undesirable usage of StringBuffer in
production code.
2022-01-04 14:06:13 +01:00
liuzhifei ee292ec116 Replace use of StringBuffer with StringBuilder
With JDK 9, java.util.regex.Matcher received overloaded variants of
appendReplacement() and appendTail() that accept a StringBuilder,
allowing us to replace the use of StringBuffer with StringBuilder.

Closes gh-27884
2022-01-04 13:14:17 +01:00
Juergen Hoeller bfdb93b406 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	src/docs/asciidoc/integration.adoc
2021-12-14 16:51:00 +01:00
Juergen Hoeller 1af21bb451 Declare serialVersionUID on DefaultAopProxyFactory
Closes gh-27784
2021-12-14 16:46:59 +01:00
Juergen Hoeller c44447f622 Avoid early initialization of empty interceptor names
Closes gh-12238
2021-12-14 16:46:01 +01:00
Juergen Hoeller ba468a731f Remove JamonPerformanceMonitorInterceptor support
Includes upgrade to Tomcat 10.0.14, Undertow 2.2.14, Apache HttpClient 5.1.2, Hibernate ORM 5.6.2, Mockito 4.1.

Closes gh-27786
2021-12-14 09:46:08 +01:00
Juergen Hoeller 9a513cfdea Enforce Future/void return declaration for async methods
Closes gh-27734
2021-12-14 09:44:12 +01:00
Stephane Nicoll aa302515a4 Merge branch '5.3.x' 2021-12-12 16:33:54 +01:00
Stephane Nicoll 9e09d6cde4 Polish "Fix javadoc reference to ThrowsAdvice"
See gh-27804
2021-12-12 16:32:35 +01:00
Stephane Nicoll 31b8587ce6 Update copyright year of changed file
See gh-27804
2021-12-12 16:30:06 +01:00
xay 00375df4e8 Fix javadoc reference to ThrowsAdvice
See gh-27804
2021-12-12 16:27:28 +01:00
Arjen Poutsma 81af7330f6 Deprecate StringUtils::trimWhitespace and variants
This commits deprecates
- StringUtils::trimWhitespace in favor of String::strip
- StringUtils::trimLeadingWhitespace in favor of String::stripLeading
- StringUtils::trimTrailingWhitespace in favor of String::stripTrailing

Closes gh-27769
2021-12-06 13:37:16 +01:00
Stephane Nicoll f88344db03 Merge branch '5.3.x' 2021-11-28 10:54:18 +01:00
Stephane Nicoll 27257fb82e Polish "Fix reference to CountingBeforeAdvice"
See gh-22246
2021-11-28 10:52:16 +01:00
diguage e209a460ca Fix reference to CountingBeforeAdvice
See gh-22246
2021-11-28 10:44:48 +01:00
Sam Brannen 63c6a7e15e Update copyright date 2021-10-14 16:26:21 +02:00
Sam Brannen 07cd6ab761 Apply "instanceof pattern matching" Eclipse clean-up in spring-aop
This commit also applies additional clean-up tasks such as the following.

- final fields

This has only been applied to `src/main/java`.
2021-10-14 16:13:50 +02:00
Juergen Hoeller dc5807ea51 Merge branch '5.3.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/cglib/core/ReflectUtils.java
2021-09-30 17:37:28 +02:00
Juergen Hoeller a295a28e4b Defensively handle fast class generation failure for individual methods
Includes rethrowing of last actual defineClass exception encountered.

Closes gh-27490
2021-09-30 17:33:58 +02:00
Sam Brannen 030ba52805 Merge branch '5.3.x' 2021-09-29 16:56:33 +02:00
Sam Brannen 96e4d3a530 Fail Gradle build for Javadoc warnings
In order to catch Javadoc errors in the build, we now enable the
`Xwerror` flag for the `javadoc` tool. In addition, we now use
`Xdoclint:syntax` instead of `Xdoclint:none` in order to validate
syntax within our Javadoc.

This commit fixes all resulting Javadoc errors and warnings.

This commit also upgrades to Undertow 2.2.12.Final and fixes the
artifact names for exclusions for the Servlet and annotations APIs.

The incorrect exclusion of the Servlet API resulted in the Servlet API
being on the classpath twice for the javadoc task, which resulted in the
following warnings in previous builds.

javadoc: warning - Multiple sources of package comments found for package "javax.servlet"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.http"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.descriptor"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.annotation"

Closes gh-27480
2021-09-29 14:02:37 +02:00
Sam Brannen 3dc84c2d92 Merge branch '5.3.x' 2021-09-28 11:48:50 +02:00
Sam Brannen bfdc99ab79 Fix Javadoc errors
See gh-27480
2021-09-28 11:44:12 +02:00
Sam Brannen 16bf39ea1b Merge branch '5.3.x' 2021-09-28 10:35:18 +02:00
Sam Brannen 2567b20949 Upgrade to spring-javaformat 0.0.28 and downgrade to Checkstyle 8.41
In order to be able to use text blocks and other new Java language
features, we are upgrading to a recent version of Checkstyle.

The latest version of spring-javaformat-checkstyle (0.0.28) is built
against Checkstyle 8.32 which does not include support for language
features such as text blocks. Support for text blocks was added in
Checkstyle 8.36.

In addition, there is a binary compatibility issue between
spring-javaformat-checkstyle 0.0.28 and Checkstyle 8.42. Thus we cannot
use Checkstyle 8.42 or higher.

In this commit, we therefore upgrade to spring-javaformat-checkstyle
0.0.28 and downgrade to Checkstyle 8.41.

This change is being applied to `5.3.x` as well as `main` in order to
benefit from the enhanced checking provided in more recent versions of
Checkstyle.

Closes gh-27481
2021-09-28 10:29:31 +02:00
Juergen Hoeller 8f96ca4a2d Merge branch '5.3.x'
# Conflicts:
#	spring-context/spring-context.gradle
#	spring-core/src/main/java/org/springframework/core/ReactiveAdapterRegistry.java
2021-09-21 17:47:27 +02:00
Juergen Hoeller 49d003857d Skip CGLIB class validation in case of optimize flag
Closes gh-27439
2021-09-21 17:42:19 +02:00
Juergen Hoeller d84ca2ba90 Jakarta EE 9 migration
Upgrades many dependency declarations; removes old EJB 2.x support and outdated Servlet-based integrations (Commons FileUpload, FreeMarker JSP support, Tiles).

Closes gh-22093
Closes gh-25354
Closes gh-26185
Closes gh-27423
See gh-27424
2021-09-17 09:14:07 +02:00
Juergen Hoeller b74e93807e Remove JDK 9 workarounds etc
See gh-17778
2021-09-17 08:58:19 +02:00
yokotaso 0a776a76d1 Fix memory leak on AOP Proxy class definition cache 2021-09-13 18:08:01 +02:00
Brian Clozel cecc0849a8 Upgrade to Gradle 7.2
This commit upgrades Gradle to 7.2.
Gradle configuration names are updated accordingly.
This also upgrades Gradle build plugins.

See gh-26870
2021-09-13 09:37:35 +02:00
Sam Brannen 88af24c1cb Update copyright date 2021-08-31 09:46:10 +02:00
Inmord 871e378ed0 Polish AbstractAspectJAdvisorFactory
Closes gh-27340
2021-08-31 09:43:54 +02:00
Sam Brannen 9f7a94058a Update copyright date
See gh-27298
2021-08-19 16:23:38 +02:00
LEE Juchan caf6760ddd
Fix grammatical errors in Javadoc
Closes gh-27298
2021-08-19 16:21:15 +02:00
Sam Brannen ce94f69e52 Polish contribution
See gh-27234
2021-07-31 16:30:39 +02:00
Anton Lyxell 01c8de0111
Simplify getInternalBeanFactoryForBean
This commit simplifies getInternalBeanFactoryForBean() in
AbstractBeanFactoryBasedTargetSourceCreator via
Map::computeIfAbsent.

Closes gh-27234
2021-07-31 16:27:43 +02:00
Juergen Hoeller 475396b516 Exclude sealed interfaces from auto-proxying (for JDK 17 compatibility)
Closes gh-27027
2021-07-12 17:42:15 +02:00
Juergen Hoeller 8680fdb8bc Polishing 2021-07-09 13:26:46 +02:00
Juergen Hoeller c45c46dad7 Make proxyTargetClass=true with introduction advice work for JDK proxy targets
Closes gh-27044
2021-07-09 13:23:04 +02:00
Sam Brannen a2ef6badc4 Use StringBuilder.append(char) where possible
To slightly improve performance, this commit switches to
StringBuilder.append(char) instead of StringBuilder.append(String)
whenever we append a single character to a StringBuilder.

Closes gh-27098
2021-06-25 10:44:28 +02:00
Johnny Lim 98770b15e7
Polishing
Closes gh-26878
2021-04-29 16:53:53 +02:00
Juergen Hoeller 2b017fe540 Apply original ClassLoader in AbstractAdvisingBeanPostProcessor as well
See gh-26601
2021-03-10 16:37:31 +01:00
Qimiao Chen 9877a9e6b7 Reduce memory consumption 2021-03-08 18:56:46 +01:00
Juergen Hoeller e53cce0778 Allow AOP proxies to be created using the original ClassLoader
Closes gh-26601
2021-02-25 17:48:01 +01:00
Sam Brannen 8535193df3 Update copyright date for DynamicIntroductionAdvice
See gh-26568
2021-02-18 13:02:10 +01:00
heqiang a78701cc4b
Fix Javadoc link in DynamicIntroductionAdvice
Closes gh-26568
2021-02-18 12:54:15 +01:00
Sébastien Deleuze 3524401bf1 Introduce a NativeDetector utility class
With the introduction of the -H:+InlineBeforeAnalysis native image
compiler flag in GraalVM 21.0.0, it is now possible to use an utility method and get code
removal at build time.

This flag will be enabled as of Spring Native 0.9.0.

closes gh-25795
2021-02-15 16:36:23 +01:00
Sam Brannen 3c959d3515 Fix grammar in Javadoc 2021-01-18 11:26:29 +01:00
Juergen Hoeller 947255e377 Always propagate checked exceptions from Kotlin code behind CGLIB proxies
Closes gh-23844
2020-12-18 11:55:20 +01:00
Juergen Hoeller 1195b3a0b0 Polishing 2020-12-08 10:39:56 +01:00
Sam Brannen 45a9227047 Remove TODO from AbstractAspectJAdvice
Despite the code duplication, we will not delegate to
AopUtils.invokeJoinpointUsingReflection() from
AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs().

The rationale is that the exception message in
invokeAdviceMethodWithGivenArgs() provides additional context via the
pointcut expression, and we would lose that additional context if we
simply delegate to AopUtils.invokeJoinpointUsingReflection(). We could
introduce an overloaded variant of invokeJoinpointUsingReflection() that
accepts an additional argument to provide the additional context for the
exception message, but we don't think that would be the best solution
for this particular use case.

In light of that, we are simply removing the TODO.

Closes gh-26126
2020-11-20 12:39:28 +01:00
Marten Deinum 41835ba5a4 Re-use the isVariableName method
Prior to this change the checks for isVariableName were duplicated
in 2 different locations. The logic has been moved to AspectJProxyUtils
to allow for re-use in those places and so that it benefits from any
optimizations that are done.
2020-11-17 15:58:53 +01:00
Marten Deinum c9b27af64f Reduce overhead of char[] creation
There are more locations which could benefit from not using a
toCharArray on a String, but rather use the charAt method from
the String itself. This to prevent an additional copy of the
char[] being created.
2020-11-17 11:57:09 +01:00
izeye 1b1ba47912 Avoid char array creation in AbstractAspectJAdvice.isVariableName()
See gh-26100
2020-11-17 07:54:06 +01:00
Sam Brannen c419ea7ba7 Use MethodFilter.and() in ReflectiveAspectJAdvisorFactory 2020-11-12 14:35:28 +01:00
Сергей Цыпанов daf9a82e8c Simplify AbstractAspectJAdvice.isVariableName() 2020-11-10 17:30:00 +01:00
Juergen Hoeller 99ed01e3f7 Optimize locking in AspectJProxyFactory for concurrent aspect instantiation
Closes gh-26034
2020-11-05 13:11:16 +01:00