New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure ClassFilter and MethodMatcher implementations are cacheable #23659
Labels
Milestone
Comments
sbrannen
added
type: bug
A general bug
in: core
Issues in core modules (aop, beans, core, context, expression)
labels
Sep 18, 2019
sbrannen
added a commit
to sbrannen/spring-framework
that referenced
this issue
Sep 18, 2019
sbrannen
added a commit
to sbrannen/spring-framework
that referenced
this issue
Sep 18, 2019
sbrannen
added a commit
to sbrannen/spring-framework
that referenced
this issue
Sep 18, 2019
sbrannen
added a commit
to sbrannen/spring-framework
that referenced
this issue
Sep 18, 2019
sbrannen
added a commit
to sbrannen/spring-framework
that referenced
this issue
Sep 18, 2019
sbrannen
added a commit
to sbrannen/spring-framework
that referenced
this issue
Sep 19, 2019
sbrannen
added a commit
to sbrannen/spring-framework
that referenced
this issue
Sep 19, 2019
sbrannen
added a commit
to sbrannen/spring-framework
that referenced
this issue
Sep 19, 2019
sbrannen
added a commit
to sbrannen/spring-framework
that referenced
this issue
Sep 19, 2019
While resolving the regression raised in spring-projectsgh-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 spring-projectsgh-23659
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview
While resolving the regression raised in #23571, it came to our attention that not all of our
ClassFilter
andMethodMatcher
implementations are properly cacheable with CGLIB generated proxies due to missing (or improper)equals()
andhashCode()
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.
Already Implemented
AnnotationClassFilter
AspectJExpressionPointcut
DefaultIntroductionAdvisor
andLockMixinAdvisor
DeclareParentsAdvisor
- lambda expression in constructor: unnecessaryTrueClassFilter
: unnecessary due to Singleton patternTrueMethodMatcher
: unnecessary due to Singleton patternAbstractRegexpMethodPointcut
andJdkRegexpMethodPointcut
CacheOperationSourcePointcut
JCacheOperationSourcePointcut
PerTargetInstantiationModelPointcut
: unnecessaryTransactionAttributeSourcePointcut
Deliverables
Ensure that
ClassFilter
andMethodMatcher
implementations properly implementequals()
,hashCode()
, andtoString()
.Potential Bugs
RootClassFilter
:equals()
,hashCode()
, andtoString()
TypePatternClassFilter
:equals()
,hashCode()
, andtoString()
AnnotationMethodMatcher
:equals()
does not include thecheckInherited
flagImprovements
ControlFlowPointcut
:toString()
UnionClassFilter
:toString()
IntersectionClassFilter
:toString()
IntersectionMethodMatcher
andIntersectionIntroductionAwareMethodMatcher
:toString()
UnionMethodMatcher
andUnionIntroductionAwareMethodMatcher
:toString()
AdviceExcludingMethodMatcher
:toString()
SetterPointcut
andGetterPointcut
:toString()
NameMatchMethodPointcut
:toString()
ClassFilterAwareUnionMethodMatcher
andClassFilterAwareUnionIntroductionAwareMethodMatcher
:toString()
The text was updated successfully, but these errors were encountered: