Defensively catch IllegalStateException from match attempts (for compatibility with AspectJ 1.8.10)

Issue: SPR-15019
This commit is contained in:
Juergen Hoeller 2016-12-14 22:06:13 +01:00
parent 29543856ec
commit 3370f41c61
1 changed files with 32 additions and 21 deletions

View File

@ -262,6 +262,10 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
catch (BCException ex) {
logger.debug("PointcutExpression matching rejected target class", ex);
}
catch (IllegalStateException ex) {
// AspectJ 1.8.10: encountered invalid signature
logger.debug("PointcutExpression matching rejected target class", ex);
}
return false;
}
@ -413,6 +417,7 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
Method methodToMatch = targetMethod;
shadowMatch = this.shadowMatchCache.get(targetMethod);
if (shadowMatch == null) {
try {
try {
shadowMatch = this.pointcutExpression.matchesMethodExecution(methodToMatch);
}
@ -448,6 +453,12 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
}
}
}
}
catch (IllegalStateException ex) {
// AspectJ 1.8.10: encountered invalid signature
logger.debug("PointcutExpression matching rejected target method", ex);
fallbackExpression = null;
}
if (shadowMatch == null) {
shadowMatch = new ShadowMatchImpl(org.aspectj.util.FuzzyBoolean.NO, null, null, null);
}