Polishing
This commit is contained in:
@@ -291,20 +291,20 @@ class CglibAopProxy implements AopProxy, Serializable {
|
||||
// unadvised but can return this). May be required to expose the proxy.
|
||||
Callback targetInterceptor;
|
||||
if (exposeProxy) {
|
||||
targetInterceptor = isStatic ?
|
||||
targetInterceptor = (isStatic ?
|
||||
new StaticUnadvisedExposedInterceptor(this.advised.getTargetSource().getTarget()) :
|
||||
new DynamicUnadvisedExposedInterceptor(this.advised.getTargetSource());
|
||||
new DynamicUnadvisedExposedInterceptor(this.advised.getTargetSource()));
|
||||
}
|
||||
else {
|
||||
targetInterceptor = isStatic ?
|
||||
targetInterceptor = (isStatic ?
|
||||
new StaticUnadvisedInterceptor(this.advised.getTargetSource().getTarget()) :
|
||||
new DynamicUnadvisedInterceptor(this.advised.getTargetSource());
|
||||
new DynamicUnadvisedInterceptor(this.advised.getTargetSource()));
|
||||
}
|
||||
|
||||
// Choose a "direct to target" dispatcher (used for
|
||||
// unadvised calls to static targets that cannot return this).
|
||||
Callback targetDispatcher = isStatic ?
|
||||
new StaticDispatcher(this.advised.getTargetSource().getTarget()) : new SerializableNoOp();
|
||||
Callback targetDispatcher = (isStatic ?
|
||||
new StaticDispatcher(this.advised.getTargetSource().getTarget()) : new SerializableNoOp());
|
||||
|
||||
Callback[] mainCallbacks = new Callback[] {
|
||||
aopInterceptor, // for normal advice
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -131,7 +131,7 @@ public class ControlFlowPointcut implements Pointcut, ClassFilter, MethodMatcher
|
||||
return false;
|
||||
}
|
||||
ControlFlowPointcut that = (ControlFlowPointcut) other;
|
||||
return (this.clazz.equals(that.clazz)) && ObjectUtils.nullSafeEquals(that.methodName, this.methodName);
|
||||
return (this.clazz.equals(that.clazz)) && ObjectUtils.nullSafeEquals(this.methodName, that.methodName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -144,14 +144,14 @@ public abstract class MethodMatchers {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof UnionMethodMatcher)) {
|
||||
if (!(other instanceof UnionMethodMatcher)) {
|
||||
return false;
|
||||
}
|
||||
UnionMethodMatcher that = (UnionMethodMatcher) obj;
|
||||
UnionMethodMatcher that = (UnionMethodMatcher) other;
|
||||
return (this.mm1.equals(that.mm1) && this.mm2.equals(that.mm2));
|
||||
}
|
||||
|
||||
@@ -239,18 +239,18 @@ public abstract class MethodMatchers {
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, @Nullable Class<?> targetClass, boolean hasIntroductions) {
|
||||
return MethodMatchers.matches(this.mm1, method, targetClass, hasIntroductions) &&
|
||||
MethodMatchers.matches(this.mm2, method, targetClass, hasIntroductions);
|
||||
return (MethodMatchers.matches(this.mm1, method, targetClass, hasIntroductions) &&
|
||||
MethodMatchers.matches(this.mm2, method, targetClass, hasIntroductions));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, @Nullable Class<?> targetClass) {
|
||||
return this.mm1.matches(method, targetClass) && this.mm2.matches(method, targetClass);
|
||||
return (this.mm1.matches(method, targetClass) && this.mm2.matches(method, targetClass));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRuntime() {
|
||||
return this.mm1.isRuntime() || this.mm2.isRuntime();
|
||||
return (this.mm1.isRuntime() || this.mm2.isRuntime());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -258,10 +258,10 @@ public abstract class MethodMatchers {
|
||||
// Because a dynamic intersection may be composed of a static and dynamic part,
|
||||
// we must avoid calling the 3-arg matches method on a dynamic matcher, as
|
||||
// it will probably be an unsupported operation.
|
||||
boolean aMatches = this.mm1.isRuntime() ?
|
||||
this.mm1.matches(method, targetClass, args) : this.mm1.matches(method, targetClass);
|
||||
boolean bMatches = this.mm2.isRuntime() ?
|
||||
this.mm2.matches(method, targetClass, args) : this.mm2.matches(method, targetClass);
|
||||
boolean aMatches = (this.mm1.isRuntime() ?
|
||||
this.mm1.matches(method, targetClass, args) : this.mm1.matches(method, targetClass));
|
||||
boolean bMatches = (this.mm2.isRuntime() ?
|
||||
this.mm2.matches(method, targetClass, args) : this.mm2.matches(method, targetClass));
|
||||
return aMatches && bMatches;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user