mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 08:24:13 +00:00
Revise contribution
See gh-35660
This commit is contained in:
@@ -70,14 +70,15 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||
/** use serialVersionUID from Spring 2.0 for interoperability. */
|
||||
private static final long serialVersionUID = 2651364800145442165L;
|
||||
|
||||
private static final Advisor[] EMPTY_ADVISOR_ARRAY = new Advisor[0];
|
||||
|
||||
|
||||
/**
|
||||
* Canonical TargetSource when there's no target, and behavior is
|
||||
* supplied by the advisors.
|
||||
*/
|
||||
public static final TargetSource EMPTY_TARGET_SOURCE = EmptyTargetSource.INSTANCE;
|
||||
/** Empty advisor array constant. */
|
||||
public static final Advisor[] EMPTY_ADVISORS = new Advisor[0];
|
||||
|
||||
|
||||
/** Package-protected to allow direct access for efficiency. */
|
||||
@SuppressWarnings("serial")
|
||||
@@ -289,7 +290,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||
|
||||
@Override
|
||||
public final Advisor[] getAdvisors() {
|
||||
return this.advisors.toArray(EMPTY_ADVISORS);
|
||||
return this.advisors.toArray(EMPTY_ADVISOR_ARRAY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-2
@@ -39,7 +39,9 @@ import org.springframework.aop.support.DefaultPointcutAdvisor;
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class DefaultAdvisorAdapterRegistry implements AdvisorAdapterRegistry, Serializable {
|
||||
private static final MethodInterceptor [] EMPTY_INTERCEPTOR_ARRAY = new MethodInterceptor[0];
|
||||
|
||||
private static final MethodInterceptor[] EMPTY_METHOD_INTERCEPTOR_ARRAY = new MethodInterceptor[0];
|
||||
|
||||
|
||||
private final List<AdvisorAdapter> adapters = new ArrayList<>(3);
|
||||
|
||||
@@ -90,7 +92,7 @@ public class DefaultAdvisorAdapterRegistry implements AdvisorAdapterRegistry, Se
|
||||
if (interceptors.isEmpty()) {
|
||||
throw new UnknownAdviceTypeException(advisor.getAdvice());
|
||||
}
|
||||
return interceptors.toArray(EMPTY_INTERCEPTOR_ARRAY);
|
||||
return interceptors.toArray(EMPTY_METHOD_INTERCEPTOR_ARRAY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user