Skip to content

Commit 65e4232

Browse files
committed
Polishing
1 parent 22fc325 commit 65e4232

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed

spring-aop/src/main/java/org/springframework/aop/MethodMatcher.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -48,10 +48,11 @@
4848
public interface MethodMatcher {
4949

5050
/**
51-
* Perform static checking whether the given method matches. If this
52-
* returns {@code false} or if the {@link #isRuntime()} method
53-
* returns {@code false}, no runtime check (i.e. no.
54-
* {@link #matches(java.lang.reflect.Method, Class, Object[])} call) will be made.
51+
* Perform static checking whether the given method matches.
52+
* <p>If this returns {@code false} or if the {@link #isRuntime()}
53+
* method returns {@code false}, no runtime check (i.e. no
54+
* {@link #matches(java.lang.reflect.Method, Class, Object[])} call)
55+
* will be made.
5556
* @param method the candidate method
5657
* @param targetClass the target class (may be {@code null}, in which case
5758
* the candidate class must be taken to be the method's declaring class)

spring-aop/src/main/java/org/springframework/aop/support/AbstractRegexpMethodPointcut.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -130,8 +130,9 @@ public String[] getExcludedPatterns() {
130130
*/
131131
@Override
132132
public boolean matches(Method method, Class<?> targetClass) {
133-
return ((targetClass != null && matchesPattern(ClassUtils.getQualifiedMethodName(method, targetClass))) ||
134-
matchesPattern(ClassUtils.getQualifiedMethodName(method)));
133+
return ((targetClass != null && targetClass != method.getDeclaringClass() &&
134+
matchesPattern(ClassUtils.getQualifiedMethodName(method, targetClass))) ||
135+
matchesPattern(ClassUtils.getQualifiedMethodName(method, method.getDeclaringClass())));
135136
}
136137

137138
/**

spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcher.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,6 +23,8 @@
2323
/**
2424
* Convenient abstract superclass for dynamic method matchers,
2525
* which do care about arguments at runtime.
26+
*
27+
* @author Rod Johnson
2628
*/
2729
public abstract class DynamicMethodMatcher implements MethodMatcher {
2830

spring-aop/src/main/java/org/springframework/aop/support/RootClassFilter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,7 +21,8 @@
2121
import org.springframework.aop.ClassFilter;
2222

2323
/**
24-
* Simple ClassFilter implementation that passes classes (and optionally subclasses)
24+
* Simple ClassFilter implementation that passes classes (and optionally subclasses).
25+
*
2526
* @author Rod Johnson
2627
*/
2728
@SuppressWarnings("serial")
@@ -37,7 +38,7 @@ public RootClassFilter(Class<?> clazz) {
3738

3839
@Override
3940
public boolean matches(Class<?> candidate) {
40-
return clazz.isAssignableFrom(candidate);
41+
return this.clazz.isAssignableFrom(candidate);
4142
}
4243

4344
}

spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcher.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,6 +23,8 @@
2323
/**
2424
* Convenient abstract superclass for static method matchers, which don't care
2525
* about arguments at runtime.
26+
*
27+
* @author Rod Johnson
2628
*/
2729
public abstract class StaticMethodMatcher implements MethodMatcher {
2830

0 commit comments

Comments
 (0)