Fix and improve Javadoc in spring-aop

Closes gh-28803
This commit is contained in:
Marc Wrobel 2022-07-12 17:58:30 +02:00 committed by Sam Brannen
parent c112bb0ae1
commit c6be3b33c9
19 changed files with 31 additions and 31 deletions

View File

@ -63,7 +63,7 @@ public interface Joinpoint {
/** /**
* Return the static part of this joinpoint. * Return the static part of this joinpoint.
* <p>The static part is an accessible object on which a chain of * <p>The static part is an accessible object on which a chain of
* interceptors are installed. * interceptors is installed.
*/ */
@Nonnull @Nonnull
AccessibleObject getStaticPart(); AccessibleObject getStaticPart();

View File

@ -36,7 +36,7 @@ public interface IntroductionAwareMethodMatcher extends MethodMatcher {
* @param targetClass the target class * @param targetClass the target class
* @param hasIntroductions {@code true} if the object on whose behalf we are * @param hasIntroductions {@code true} if the object on whose behalf we are
* asking is the subject on one or more introductions; {@code false} otherwise * asking is the subject on one or more introductions; {@code false} otherwise
* @return whether or not this method matches statically * @return whether this method matches statically
*/ */
boolean matches(Method method, Class<?> targetClass, boolean hasIntroductions); boolean matches(Method method, Class<?> targetClass, boolean hasIntroductions);

View File

@ -60,7 +60,7 @@ public interface MethodMatcher {
* will be made. * will be made.
* @param method the candidate method * @param method the candidate method
* @param targetClass the target class * @param targetClass the target class
* @return whether or not this method matches statically * @return whether this method matches statically
*/ */
boolean matches(Method method, Class<?> targetClass); boolean matches(Method method, Class<?> targetClass);
@ -70,7 +70,7 @@ public interface MethodMatcher {
* runtime even if the 2-arg matches method returns {@code true}? * runtime even if the 2-arg matches method returns {@code true}?
* <p>Can be invoked when an AOP proxy is created, and need not be invoked * <p>Can be invoked when an AOP proxy is created, and need not be invoked
* again before each method invocation, * again before each method invocation,
* @return whether or not a runtime match via the 3-arg * @return whether a runtime match via the 3-arg
* {@link #matches(java.lang.reflect.Method, Class, Object[])} method * {@link #matches(java.lang.reflect.Method, Class, Object[])} method
* is required if static matching passed * is required if static matching passed
*/ */

View File

@ -18,7 +18,7 @@ package org.springframework.aop;
/** /**
* Marker interface implemented by all AOP proxies. Used to detect * Marker interface implemented by all AOP proxies. Used to detect
* whether or not objects are Spring-generated proxies. * whether objects are Spring-generated proxies.
* *
* @author Rob Harrop * @author Rob Harrop
* @since 2.0.1 * @since 2.0.1

View File

@ -39,7 +39,7 @@ import org.springframework.lang.Nullable;
public interface AspectJAdvisorFactory { public interface AspectJAdvisorFactory {
/** /**
* Determine whether or not the given class is an aspect, as reported * Determine whether the given class is an aspect, as reported
* by AspectJ's {@link org.aspectj.lang.reflect.AjTypeSystem}. * by AspectJ's {@link org.aspectj.lang.reflect.AjTypeSystem}.
* <p>Will simply return {@code false} if the supposed aspect is * <p>Will simply return {@code false} if the supposed aspect is
* invalid (such as an extension of a concrete aspect class). * invalid (such as an extension of a concrete aspect class).
@ -47,7 +47,7 @@ public interface AspectJAdvisorFactory {
* such as those with unsupported instantiation models. * such as those with unsupported instantiation models.
* Use the {@link #validate} method to handle these cases if necessary. * Use the {@link #validate} method to handle these cases if necessary.
* @param clazz the supposed annotation-style AspectJ class * @param clazz the supposed annotation-style AspectJ class
* @return whether or not this class is recognized by AspectJ as an aspect class * @return whether this class is recognized by AspectJ as an aspect class
*/ */
boolean isAspect(Class<?> clazz); boolean isAspect(Class<?> clazz);

View File

@ -67,7 +67,7 @@ public class AspectMetadata implements Serializable {
/** /**
* Spring AOP pointcut corresponding to the per clause of the * Spring AOP pointcut corresponding to the per clause of the
* aspect. Will be the Pointcut.TRUE canonical instance in the * aspect. Will be the {@code Pointcut.TRUE} canonical instance in the
* case of a singleton, otherwise an AspectJExpressionPointcut. * case of a singleton, otherwise an AspectJExpressionPointcut.
*/ */
private final Pointcut perClausePointcut; private final Pointcut perClausePointcut;

View File

@ -60,8 +60,8 @@ public class AspectJAwareAdvisorAutoProxyCreator extends AbstractAdvisorAutoProx
* <li>Otherwise the advice declared first gets highest precedence (i.e., runs * <li>Otherwise the advice declared first gets highest precedence (i.e., runs
* first).</li> * first).</li>
* </ul> * </ul>
* <p><b>Important:</b> Advisors are sorted in precedence order, from highest * <p><b>Important:</b> Advisors are sorted in precedence order, from the highest
* precedence to lowest. "On the way in" to a join point, the highest precedence * precedence to the lowest. "On the way in" to a join point, the highest precedence
* advisor should run first. "On the way out" of a join point, the highest * advisor should run first. "On the way out" of a join point, the highest
* precedence advisor should run last. * precedence advisor should run last.
*/ */

View File

@ -314,7 +314,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
} }
/** /**
* Add all of the given advisors to this proxy configuration. * Add all the given advisors to this proxy configuration.
* @param advisors the advisors to register * @param advisors the advisors to register
*/ */
public void addAdvisors(Advisor... advisors) { public void addAdvisors(Advisor... advisors) {
@ -322,7 +322,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
} }
/** /**
* Add all of the given advisors to this proxy configuration. * Add all the given advisors to this proxy configuration.
* @param advisors the advisors to register * @param advisors the advisors to register
*/ */
public void addAdvisors(Collection<Advisor> advisors) { public void addAdvisors(Collection<Advisor> advisors) {

View File

@ -72,8 +72,8 @@ final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializa
* NOTE: We could avoid the code duplication between this class and the CGLIB * NOTE: We could avoid the code duplication between this class and the CGLIB
* proxies by refactoring "invoke" into a template method. However, this approach * proxies by refactoring "invoke" into a template method. However, this approach
* adds at least 10% performance overhead versus a copy-paste solution, so we sacrifice * adds at least 10% performance overhead versus a copy-paste solution, so we sacrifice
* elegance for performance. (We have a good test suite to ensure that the different * elegance for performance (we have a good test suite to ensure that the different
* proxies behave the same :-) * proxies behave the same :-)).
* This way, we can also more easily take advantage of minor optimizations in each class. * This way, we can also more easily take advantage of minor optimizations in each class.
*/ */
@ -198,7 +198,7 @@ final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializa
// Get the interception chain for this method. // Get the interception chain for this method.
List<Object> chain = this.advised.getInterceptorsAndDynamicInterceptionAdvice(method, targetClass); List<Object> chain = this.advised.getInterceptorsAndDynamicInterceptionAdvice(method, targetClass);
// Check whether we have any advice. If we don't, we can fallback on direct // Check whether we have any advice. If we don't, we can fall back on direct
// reflective invocation of the target, and avoid creating a MethodInvocation. // reflective invocation of the target, and avoid creating a MethodInvocation.
if (chain.isEmpty()) { if (chain.isEmpty()) {
// We can skip creating a MethodInvocation: just invoke the target directly // We can skip creating a MethodInvocation: just invoke the target directly

View File

@ -60,7 +60,7 @@ import org.springframework.util.ObjectUtils;
* to use the "targetName"/"target"/"targetSource" properties instead. * to use the "targetName"/"target"/"targetSource" properties instead.
* *
* <p>Global interceptors and advisors can be added at the factory level. The specified * <p>Global interceptors and advisors can be added at the factory level. The specified
* ones are expanded in an interceptor list where an "xxx*" entry is included in the * ones are expanded in an interceptor list where a "xxx*" entry is included in the
* list, matching the given prefix with the bean names (e.g. "global*" would match * list, matching the given prefix with the bean names (e.g. "global*" would match
* both "globalBean1" and "globalBean2", "*" all defined interceptors). The matching * both "globalBean1" and "globalBean2", "*" all defined interceptors). The matching
* interceptors get applied according to their returned order value, if they implement * interceptors get applied according to their returned order value, if they implement
@ -406,7 +406,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
if (namedBeanClass != null) { if (namedBeanClass != null) {
return (Advisor.class.isAssignableFrom(namedBeanClass) || Advice.class.isAssignableFrom(namedBeanClass)); return (Advisor.class.isAssignableFrom(namedBeanClass) || Advice.class.isAssignableFrom(namedBeanClass));
} }
// Treat it as an target bean if we can't tell. // Treat it as a target bean if we can't tell.
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("Could not determine type of bean with name '" + beanName + logger.debug("Could not determine type of bean with name '" + beanName +
"' - assuming it is neither an Advisor nor an Advice"); "' - assuming it is neither an Advisor nor an Advice");

View File

@ -119,7 +119,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
private AdvisorAdapterRegistry advisorAdapterRegistry = GlobalAdvisorAdapterRegistry.getInstance(); private AdvisorAdapterRegistry advisorAdapterRegistry = GlobalAdvisorAdapterRegistry.getInstance();
/** /**
* Indicates whether or not the proxy should be frozen. Overridden from super * Indicates whether the proxy should be frozen. Overridden from super
* to prevent the configuration from becoming frozen too early. * to prevent the configuration from becoming frozen too early.
*/ */
private boolean freezeProxy = false; private boolean freezeProxy = false;
@ -145,7 +145,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
/** /**
* Set whether or not the proxy should be frozen, preventing advice * Set whether the proxy should be frozen, preventing advice
* from being added to it once it is created. * from being added to it once it is created.
* <p>Overridden from the super class to prevent the proxy configuration * <p>Overridden from the super class to prevent the proxy configuration
* from being frozen before the proxy is created. * from being frozen before the proxy is created.

View File

@ -56,7 +56,7 @@ public abstract class AbstractTraceInterceptor implements MethodInterceptor, Ser
protected transient Log defaultLogger = LogFactory.getLog(getClass()); protected transient Log defaultLogger = LogFactory.getLog(getClass());
/** /**
* Indicates whether or not proxy class names should be hidden when using dynamic loggers. * Indicates whether proxy class names should be hidden when using dynamic loggers.
* @see #setUseDynamicLogger * @see #setUseDynamicLogger
*/ */
private boolean hideProxyClassNames = false; private boolean hideProxyClassNames = false;
@ -119,7 +119,7 @@ public abstract class AbstractTraceInterceptor implements MethodInterceptor, Ser
/** /**
* Determines whether or not logging is enabled for the particular {@code MethodInvocation}. * Determines whether logging is enabled for the particular {@code MethodInvocation}.
* If not, the method invocation proceeds as normal, otherwise the method invocation is passed * If not, the method invocation proceeds as normal, otherwise the method invocation is passed
* to the {@code invokeUnderTrace} method for handling. * to the {@code invokeUnderTrace} method for handling.
* @see #invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log) * @see #invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log)

View File

@ -36,7 +36,7 @@ public interface AsyncUncaughtExceptionHandler {
* Handle the given uncaught exception thrown from an asynchronous method. * Handle the given uncaught exception thrown from an asynchronous method.
* @param ex the exception thrown from the asynchronous method * @param ex the exception thrown from the asynchronous method
* @param method the asynchronous method * @param method the asynchronous method
* @param params the parameters used to invoked the method * @param params the parameters used to invoke the method
*/ */
void handleUncaughtException(Throwable ex, Method method, Object... params); void handleUncaughtException(Throwable ex, Method method, Object... params);

View File

@ -217,7 +217,7 @@ public abstract class AopUtils {
* out a pointcut for a class. * out a pointcut for a class.
* @param pc the static or dynamic pointcut to check * @param pc the static or dynamic pointcut to check
* @param targetClass the class to test * @param targetClass the class to test
* @param hasIntroductions whether or not the advisor chain * @param hasIntroductions whether the advisor chain
* for this bean includes any introductions * for this bean includes any introductions
* @return whether the pointcut can apply on any method * @return whether the pointcut can apply on any method
*/ */
@ -261,7 +261,7 @@ public abstract class AopUtils {
/** /**
* Can the given advisor apply at all on the given class? * Can the given advisor apply at all on the given class?
* This is an important test as it can be used to optimize * This is an important test as it can be used to optimize
* out a advisor for a class. * out an advisor for a class.
* @param advisor the advisor to check * @param advisor the advisor to check
* @param targetClass class we're testing * @param targetClass class we're testing
* @return whether the pointcut can apply on any method * @return whether the pointcut can apply on any method
@ -272,11 +272,11 @@ public abstract class AopUtils {
/** /**
* Can the given advisor apply at all on the given class? * Can the given advisor apply at all on the given class?
* <p>This is an important test as it can be used to optimize out a advisor for a class. * <p>This is an important test as it can be used to optimize out an advisor for a class.
* This version also takes into account introductions (for IntroductionAwareMethodMatchers). * This version also takes into account introductions (for IntroductionAwareMethodMatchers).
* @param advisor the advisor to check * @param advisor the advisor to check
* @param targetClass class we're testing * @param targetClass class we're testing
* @param hasIntroductions whether or not the advisor chain for this bean includes * @param hasIntroductions whether the advisor chain for this bean includes
* any introductions * any introductions
* @return whether the pointcut can apply on any method * @return whether the pointcut can apply on any method
*/ */

View File

@ -43,7 +43,7 @@ public class DefaultPointcutAdvisor extends AbstractGenericPointcutAdvisor imple
/** /**
* Create an empty DefaultPointcutAdvisor. * Create an empty DefaultPointcutAdvisor.
* <p>Advice must be set before use using setter methods. * <p>Advice must be set before using setter methods.
* Pointcut will normally be set also, but defaults to {@code Pointcut.TRUE}. * Pointcut will normally be set also, but defaults to {@code Pointcut.TRUE}.
*/ */
public DefaultPointcutAdvisor() { public DefaultPointcutAdvisor() {

View File

@ -90,7 +90,7 @@ public abstract class MethodMatchers {
* @param targetClass the target class * @param targetClass the target class
* @param hasIntroductions {@code true} if the object on whose behalf we are * @param hasIntroductions {@code true} if the object on whose behalf we are
* asking is the subject on one or more introductions; {@code false} otherwise * asking is the subject on one or more introductions; {@code false} otherwise
* @return whether or not this method matches statically * @return whether this method matches statically
*/ */
public static boolean matches(MethodMatcher mm, Method method, Class<?> targetClass, boolean hasIntroductions) { public static boolean matches(MethodMatcher mm, Method method, Class<?> targetClass, boolean hasIntroductions) {
Assert.notNull(mm, "MethodMatcher must not be null"); Assert.notNull(mm, "MethodMatcher must not be null");

View File

@ -37,7 +37,7 @@ import org.springframework.lang.Nullable;
* {@link AbstractPrototypeBasedTargetSource} can be used to create objects * {@link AbstractPrototypeBasedTargetSource} can be used to create objects
* in order to put them into the pool. * in order to put them into the pool.
* *
* <p>Subclasses must also implement some of the monitoring methods from the * <p>Subclasses must also implement some monitoring methods from the
* {@link PoolingConfig} interface. The {@link #getPoolingConfigMixin()} method * {@link PoolingConfig} interface. The {@link #getPoolingConfigMixin()} method
* makes these stats available on proxied objects through an IntroductionAdvisor. * makes these stats available on proxied objects through an IntroductionAdvisor.
* *

View File

@ -931,7 +931,7 @@ abstract class AbstractMakeModifiable {
return setter.getDeclaringClass().getMethod(getterName); return setter.getDeclaringClass().getMethod(getterName);
} }
catch (NoSuchMethodException ex) { catch (NoSuchMethodException ex) {
// must be write only // must be write-only
return null; return null;
} }
} }

View File

@ -26,7 +26,7 @@ import org.springframework.context.annotation.Import;
/** /**
* Signals the current application context to apply dependency injection to * Signals the current application context to apply dependency injection to
* non-managed classes that are instantiated outside of the Spring bean factory * non-managed classes that are instantiated outside the Spring bean factory
* (typically classes annotated with the * (typically classes annotated with the
* {@link org.springframework.beans.factory.annotation.Configurable @Configurable} * {@link org.springframework.beans.factory.annotation.Configurable @Configurable}
* annotation). * annotation).