|
|
|
@ -41,6 +41,7 @@ import org.aspectj.weaver.tools.PointcutParameter; |
|
|
|
import org.aspectj.weaver.tools.PointcutParser; |
|
|
|
import org.aspectj.weaver.tools.PointcutParser; |
|
|
|
import org.aspectj.weaver.tools.PointcutPrimitive; |
|
|
|
import org.aspectj.weaver.tools.PointcutPrimitive; |
|
|
|
import org.aspectj.weaver.tools.ShadowMatch; |
|
|
|
import org.aspectj.weaver.tools.ShadowMatch; |
|
|
|
|
|
|
|
import org.aspectj.weaver.tools.UnsupportedPointcutPrimitiveException; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.aop.ClassFilter; |
|
|
|
import org.springframework.aop.ClassFilter; |
|
|
|
import org.springframework.aop.IntroductionAwareMethodMatcher; |
|
|
|
import org.springframework.aop.IntroductionAwareMethodMatcher; |
|
|
|
@ -115,6 +116,8 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut |
|
|
|
@Nullable |
|
|
|
@Nullable |
|
|
|
private transient PointcutExpression pointcutExpression; |
|
|
|
private transient PointcutExpression pointcutExpression; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private transient boolean pointcutParsingFailed = false; |
|
|
|
|
|
|
|
|
|
|
|
private transient Map<Method, ShadowMatch> shadowMatchCache = new ConcurrentHashMap<>(32); |
|
|
|
private transient Map<Method, ShadowMatch> shadowMatchCache = new ConcurrentHashMap<>(32); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -270,6 +273,10 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean matches(Class<?> targetClass) { |
|
|
|
public boolean matches(Class<?> targetClass) { |
|
|
|
|
|
|
|
if (this.pointcutParsingFailed) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
try { |
|
|
|
try { |
|
|
|
return obtainPointcutExpression().couldMatchJoinPointsInType(targetClass); |
|
|
|
return obtainPointcutExpression().couldMatchJoinPointsInType(targetClass); |
|
|
|
@ -283,8 +290,11 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
catch (IllegalArgumentException | IllegalStateException ex) { |
|
|
|
catch (IllegalArgumentException | IllegalStateException | UnsupportedPointcutPrimitiveException ex) { |
|
|
|
throw ex; |
|
|
|
this.pointcutParsingFailed = true; |
|
|
|
|
|
|
|
if (logger.isDebugEnabled()) { |
|
|
|
|
|
|
|
logger.debug("Pointcut parser rejected expression [" + getExpression() + "]: " + ex); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Throwable ex) { |
|
|
|
catch (Throwable ex) { |
|
|
|
logger.debug("PointcutExpression matching rejected target class", ex); |
|
|
|
logger.debug("PointcutExpression matching rejected target class", ex); |
|
|
|
|