AspectJ matchesMethodExecution call needs to be synchronized (SPR-5687)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1026 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
6b1983e944
commit
07b161ad42
|
|
@ -348,7 +348,12 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
}
|
||||
|
||||
private ShadowMatch getShadowMatch(Method targetMethod, Method originalMethod) {
|
||||
// Avoid lock contention for known Methods through concurrent access...
|
||||
ShadowMatch shadowMatch = this.shadowMatchCache.get(targetMethod);
|
||||
if (shadowMatch == null) {
|
||||
synchronized (this.shadowMatchCache) {
|
||||
// Not found - now check again with full lock...
|
||||
shadowMatch = this.shadowMatchCache.get(targetMethod);
|
||||
if (shadowMatch == null) {
|
||||
try {
|
||||
shadowMatch = this.pointcutExpression.matchesMethodExecution(targetMethod);
|
||||
|
|
@ -372,6 +377,8 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
}
|
||||
this.shadowMatchCache.put(targetMethod, shadowMatch);
|
||||
}
|
||||
}
|
||||
}
|
||||
return shadowMatch;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue