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

Issue: SPR-15019
(cherry picked from commit 3370f41)
This commit is contained in:
Juergen Hoeller
2016-12-14 22:06:13 +01:00
parent f0fdff1f07
commit f0c3d50408

View File

@@ -261,6 +261,10 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
catch (BCException ex) { catch (BCException ex) {
logger.debug("PointcutExpression matching rejected target class", 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; return false;
} }
@@ -412,6 +416,7 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
Method methodToMatch = targetMethod; Method methodToMatch = targetMethod;
shadowMatch = this.shadowMatchCache.get(targetMethod); shadowMatch = this.shadowMatchCache.get(targetMethod);
if (shadowMatch == null) { if (shadowMatch == null) {
try {
try { try {
shadowMatch = this.pointcutExpression.matchesMethodExecution(methodToMatch); shadowMatch = this.pointcutExpression.matchesMethodExecution(methodToMatch);
} }
@@ -447,6 +452,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) { if (shadowMatch == null) {
shadowMatch = new ShadowMatchImpl(org.aspectj.util.FuzzyBoolean.NO, null, null, null); shadowMatch = new ShadowMatchImpl(org.aspectj.util.FuzzyBoolean.NO, null, null, null);
} }