|
|
|
@ -42,6 +42,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; |
|
|
|
@ -119,6 +120,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); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -274,6 +277,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); |
|
|
|
@ -287,8 +294,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); |
|
|
|
|