Commit Graph

357 Commits

Author SHA1 Message Date
Juergen Hoeller
5051d7302d Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpRequest.java
#	spring-web/src/main/java/org/springframework/http/HttpHeaders.java
#	spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/MockServerHttpRequest.java
2020-06-06 15:27:15 +02:00
Juergen Hoeller
d14140da69 Polishing 2020-06-06 13:21:46 +02:00
Sam Brannen
aaa7c6c422 Merge branch '5.2.x' 2020-06-05 15:35:05 +02:00
Sam Brannen
04c8de4e50 Polishing 2020-06-05 15:22:41 +02:00
Juergen Hoeller
7207f7645c Deprecate InstantiationAwareBeanPostProcessorAdapter
Consistently relying on default methods in the corresponding interfaces.

Closes gh-25165
2020-05-29 23:07:10 +02:00
Juergen Hoeller
3c1ee64b7f Explicit nullability declarations for all AOP Alliance methods
Includes consistent declarations in AOP Alliance related Spring AOP code.

Closes gh-24117
2020-05-13 23:33:47 +02:00
Sam Brannen
e8335c94d5 Update Javadoc for LazyInitTargetSourceCreator
See gh-24915
2020-05-12 13:48:48 +02:00
Sam Brannen
3c3e8e6a8b Only proxy supported beans in BeanNameAutoProxyCreator
Prior to this commit, if a BeanNameAutoProxyCreator was configured with
a custom TargetSourceCreator, the TargetSourceCreator was applied to
all beans in the ApplicationContext. Thus, the list of supported
beanNames was effectively ignored when applying any
TargetSourceCreator. Consequently, if a TargetSourceCreator returned a
non-null TargetSource for a given bean, the BeanNameAutoProxyCreator
proxied the bean even if the bean name had not been configured in the
beanNames list.

This commit addresses this issue by ensuring that a custom
TargetSourceCreator is only applied to beans whose names match the
configured beanNames list in a BeanNameAutoProxyCreator.

Closes gh-24915
2020-05-12 11:59:51 +02:00
Sam Brannen
e26764d249 Remove duplicate words in documentation and polish Javadoc 2020-03-31 12:17:58 +02:00
Juergen Hoeller
fdc60311ed Avoid unnecessary trace logging in ProxyFactoryBean
Closes gh-24669
2020-03-24 00:07:40 +01:00
Juergen Hoeller
d91fc8c672 No log level check unless String concatenation is following 2020-03-14 00:01:13 +01:00
Juergen Hoeller
33642345a4 Lazily check log level within validation conditions
See gh-24672
2020-03-13 23:14:38 +01:00
Qimiao Chen
988aae4f2e Remove unnecessary variable declaration in ProxyCallbackFilter
Closes gh-24675
2020-03-11 13:51:13 +01:00
Сергей Цыпанов
1fd447f395 Reduce String garbage in CglibAopProxy.doValidateClass()
Closes gh-24672
2020-03-10 17:16:08 +01:00
Qimiao Chen
b92515bdee Add logger.isInfoEnabled check before logger.info
Closes gh-24667
2020-03-10 14:41:20 +01:00
Christoph Dreis
2093e35f27 Avoid unnecessary sorting 2020-03-04 19:10:14 +00:00
Rossen Stoyanchev
f5df422de9 Polishing contribution
See gh-24470
2020-02-03 20:32:36 +00:00
Hyunjin Choi
273812f9c5 Remove unnecessary escapes in regular expressions
See gh-24470
2020-02-03 20:22:40 +00:00
Sam Brannen
e8ef93c508 Polish contribution
See gh-24321
2020-01-09 15:56:25 +01:00
lixiaolong11000
047eefd2e2 Improve exception message in AopContext.currentProxy()
Closes gh-24321
2020-01-09 15:56:09 +01:00
stsypanov
8e5cad2af3 Add fast path for ClassUtils.hasMethod() 2020-01-08 18:52:15 +01:00
Sam Brannen
141dae6437 Polish contribution
See gh-24293
2020-01-07 11:07:03 +01:00
lixiaolong11000
132805133d Improve ExposeInvocationInterceptor exception message
Closes gh-24293
2020-01-07 11:03:11 +01:00
Pascal Schumacher
e7d489667c Add missing space in AopConfigException message
See gh-24266
2019-12-26 09:52:54 +01:00
Sam Brannen
6fdf5ef6ee Polish contribution
See gh-24205
2019-12-13 17:14:26 +01:00
Сергей Цыпанов
d9cae339d6 Simplify AdvisedSupport.removeAdvisor()
Closes gh-24205
2019-12-13 17:12:18 +01:00
stsypanov
484006ce90 Hoist Class.getName() from String concatenation to dodge an issue related to profile pollution 2019-12-06 17:36:07 +01:00
Sam Brannen
769a15cb82 Polishing 2019-11-18 13:01:26 +01:00
stsypanov
f2b3953d76 Use array.clone() instead of manual array creation 2019-11-13 13:53:42 +01:00
stsypanov
f5ae3c77c6 Use Method::getParameterCount where possible 2019-11-07 18:00:15 +01:00
stsypanov
9da15ee23a Improve usage of String.substring()
Closes gh-23923
2019-11-06 12:57:01 +01:00
Juergen Hoeller
d00690f43f Merge branch '5.1.x'
# Conflicts:
#	build.gradle
#	spring-context/spring-context.gradle
#	spring-test/spring-test.gradle
#	spring-web/spring-web.gradle
#	spring-webflux/spring-webflux.gradle
#	spring-webmvc/spring-webmvc.gradle
2019-09-25 23:13:49 +02:00
Juergen Hoeller
357beb24bc Polishing 2019-09-25 22:15:07 +02:00
Juergen Hoeller
bd70f10d2b Merge branch '5.1.x'
# Conflicts:
#	build.gradle
#	spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java
#	spring-aspects/spring-aspects.gradle
#	spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java
#	spring-beans/src/main/java/org/springframework/beans/factory/support/GenericBeanDefinition.java
#	spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
#	spring-orm/spring-orm.gradle
#	spring-test/spring-test.gradle
2019-09-25 12:43:24 +02:00
Juergen Hoeller
bb6f9bb6d4 Polishing 2019-09-25 12:14:48 +02:00
Sam Brannen
9811e21432 Merge branch '5.1.x' 2019-09-19 15:57:33 +02:00
Sam Brannen
8f6846827d Ensure ClassFilter and MethodMatcher implementations are cacheable
While resolving the regression raised in gh-23571, it came to our
attention that not all of our ClassFilter and MethodMatcher
implementations were properly cacheable with CGLIB generated proxies
due to missing (or improper) equals() and hashCode() implementations.

Although such deficiencies may not manifest themselves as bugs in Core
Spring's default arrangements, these might cause issues in custom
arrangements in user applications.

This commit addresses this by ensuring that ClassFilter and
MethodMatcher implementations properly implement equals() and
hashCode(). In addition, missing toString() implementations have been
added to improve diagnostics for logging and debugging.

Closes gh-23659
2019-09-19 15:35:17 +02:00
Sam Brannen
e1e072b75c Fix memory leak regression involving @Async methods
Spring Framework 5.2 M1 introduced a memory leak for applications using
@Async methods. Specifically, in a large test suite with multiple
ApplicationContexts that were closed (e.g., via @DirtiesContext,
@MockBean, or context cache eviction), the JVM process could run out of
memory.

Underlying cause: Due to a missing equals() implementation in Spring's
new AnnotationCandidateClassFilter, CGLIB's static cache of generated
classes indirectly retained references to BeanFactory instances for the
closed ApplicationContexts for the duration of the test suite.

This commit fixes this regression by introducing a proper equals()
implementation in AnnotationCandidateClassFilter. This commit also
introduces corresponding hashCode() and toString() implementations.

Closes gh-23571
2019-09-18 14:28:54 +02:00
Sam Brannen
46a37b447c Fix copyright dates
See gh-23393
2019-08-27 19:30:05 +02:00
stsypanov
78d56dc61b Use Arrays.copyOf and Arrays.copyOfRange where possible
Closes gh-23393
2019-08-27 19:18:39 +02:00
Sam Brannen
1ec9721617 Fix @since tags in ScopedProxyUtils[Tests]
See gh-23514
2019-08-27 16:01:50 +02:00
Sam Brannen
9d2a874e3f Introduce getOriginalBeanName(String) in ScopedProxyUtils
This commit introduces a utility method for retrieving the original
bean name for the target of a scoped proxy.

Closes gh-23514
2019-08-27 15:46:34 +02:00
Sam Brannen
5105b74f6e Add missing @Nullable declaration
See gh-23514
2019-08-25 15:15:48 +02:00
Sam Brannen
9be6aa64ef Introduce getOriginalBeanName(String) in ScopedProxyUtils
This commit introduces a utility method for retrieving the original
bean name for the target of a scoped proxy.

Closes gh-23514
2019-08-25 15:13:53 +02:00
Juergen Hoeller
9bd3a535cd Avoid UndeclaredThrowableStrategy with 1.8 bytecode level (CGLIB 3.3)
ClassLoaderAwareUndeclaredThrowableStrategy fails with a VerifyError on recent JDKs after the CGLIB 3.3 upgrade. The alternative is to replace it with a plain ClassLoaderAwareGeneratorStrategy (extracted from CglibSubclassingInstantiationStrategy) and custom UndeclaredThrowableException handling in CglibMethodInvocation.

See gh-23453
2019-08-14 00:14:14 +02:00
Сергей Цыпанов
1728bf17fc Avoid unnecessary boxing where primitives can be used
Closes gh-23267
2019-07-10 16:51:18 +02:00
Issam El-atif
57fa09b80d Fix typo
See gh-23142
2019-06-17 11:40:45 +02:00
stsypanov
49873a30c5 Simplify String concatenation 2019-06-12 17:32:35 +02:00
Sebastien Deleuze
098ac0bbb8 Annotate Object#equals parameter with @Nullable
Closes gh-23093
2019-06-06 14:18:30 +02:00
Juergen Hoeller
171e8f56a3 Merge branch '5.1.x' 2019-05-20 22:27:37 +02:00