From c112bb0ae191623cfcf64e5d0ed52d38920ca1fd Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Tue, 12 Jul 2022 17:54:01 +0200 Subject: [PATCH 1/3] Fix and improve Javadoc in spring-beans See gh-28803 --- .../main/java/org/springframework/beans/BeanWrapper.java | 2 +- .../org/springframework/beans/MutablePropertyValues.java | 2 +- .../org/springframework/beans/PropertyEditorRegistrar.java | 2 +- .../java/org/springframework/beans/factory/FactoryBean.java | 4 ++-- .../springframework/beans/factory/ListableBeanFactory.java | 4 ++-- .../org/springframework/beans/factory/ObjectFactory.java | 2 +- .../QualifierAnnotationAutowireCandidateResolver.java | 4 ++-- .../beans/factory/config/BeanFactoryPostProcessor.java | 2 +- .../beans/factory/config/ConstructorArgumentValues.java | 2 +- .../springframework/beans/factory/config/YamlProcessor.java | 2 +- .../beans/factory/parsing/BeanComponentDefinition.java | 2 +- .../beans/factory/parsing/ComponentDefinition.java | 4 ++-- .../factory/support/AbstractAutowireCapableBeanFactory.java | 2 +- .../beans/factory/support/AbstractBeanDefinition.java | 4 ++-- .../beans/factory/support/AbstractBeanFactory.java | 2 +- .../beans/factory/support/BeanDefinitionBuilder.java | 2 +- .../beans/factory/support/DefaultListableBeanFactory.java | 2 +- .../support/GenericTypeAwareAutowireCandidateResolver.java | 2 +- .../beans/factory/xml/AbstractBeanDefinitionParser.java | 2 +- .../beans/factory/xml/BeanDefinitionParserDelegate.java | 4 ++-- .../beans/factory/xml/DefaultNamespaceHandlerResolver.java | 2 +- .../beans/factory/xml/DelegatingEntityResolver.java | 2 +- .../beans/factory/xml/PluggableSchemaResolver.java | 4 ++-- .../factory/xml/SimpleConstructorNamespaceHandler.java | 2 +- .../beans/factory/xml/XmlBeanDefinitionReader.java | 4 ++-- .../beans/propertyeditors/StringArrayPropertyEditor.java | 6 +++--- .../springframework/beans/propertyeditors/URIEditor.java | 2 +- .../factory/config/MethodInvokingFactoryBeanTests.java | 2 +- .../springframework/beans/testfixture/beans/ITestBean.java | 2 +- 29 files changed, 39 insertions(+), 39 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/BeanWrapper.java b/spring-beans/src/main/java/org/springframework/beans/BeanWrapper.java index 90ee4f129c..798191cc55 100644 --- a/spring-beans/src/main/java/org/springframework/beans/BeanWrapper.java +++ b/spring-beans/src/main/java/org/springframework/beans/BeanWrapper.java @@ -82,7 +82,7 @@ public interface BeanWrapper extends ConfigurablePropertyAccessor { * Obtain the property descriptor for a specific property * of the wrapped object. * @param propertyName the property to obtain the descriptor for - * (may be a nested path, but no indexed/mapped property) + * (may be a nested path, but not an indexed/mapped property) * @return the property descriptor for the specified property * @throws InvalidPropertyException if there is no such property */ diff --git a/spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java b/spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java index 97c0a0ab05..2cd188ca25 100644 --- a/spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java +++ b/spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java @@ -327,7 +327,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable { /** * Register the specified property as "processed" in the sense * of some processor calling the corresponding setter method - * outside of the PropertyValue(s) mechanism. + * outside the PropertyValue(s) mechanism. *

This will lead to {@code true} being returned from * a {@link #contains} call for the specified property. * @param propertyName the name of the property. diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrar.java b/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrar.java index 1d5974cfd1..69e2a68b3e 100644 --- a/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrar.java +++ b/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrar.java @@ -22,7 +22,7 @@ package org.springframework.beans; * {@link org.springframework.beans.PropertyEditorRegistry property editor registry}. * *

This is particularly useful when you need to use the same set of - * property editors in several different situations: write a corresponding + * property editors in several situations: write a corresponding * registrar and reuse that in each case. * * @author Juergen Hoeller diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/FactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/FactoryBean.java index 224563cc77..97362ce1f7 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/FactoryBean.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/FactoryBean.java @@ -45,7 +45,7 @@ import org.springframework.lang.Nullable; * *

The container is only responsible for managing the lifecycle of the FactoryBean * instance, not the lifecycle of the objects created by the FactoryBean. Therefore, - * a destroy method on an exposed bean object (such as {@link java.io.Closeable#close()} + * a destroy method on an exposed bean object (such as {@link java.io.Closeable#close()}) * will not be called automatically. Instead, a FactoryBean should implement * {@link DisposableBean} and delegate any such close call to the underlying object. * @@ -108,7 +108,7 @@ public interface FactoryBean { * been fully initialized. It must not rely on state created during * initialization; of course, it can still use such state if available. *

NOTE: Autowiring will simply ignore FactoryBeans that return - * {@code null} here. Therefore it is highly recommended to implement + * {@code null} here. Therefore, it is highly recommended to implement * this method properly, using the current state of the FactoryBean. * @return the type of object that this FactoryBean creates, * or {@code null} if not known at the time of the call diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/ListableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/ListableBeanFactory.java index 2642e72d7a..bf88c509cd 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/ListableBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/ListableBeanFactory.java @@ -343,7 +343,7 @@ public interface ListableBeanFactory extends BeanFactory { /** * Find an {@link Annotation} of {@code annotationType} on the specified bean, - * traversing its interfaces and super classes if no annotation can be found on + * traversing its interfaces and superclasses if no annotation can be found on * the given class itself, as well as checking the bean's factory method (if any). * @param beanName the name of the bean to look for annotations on * @param annotationType the type of annotation to look for @@ -361,7 +361,7 @@ public interface ListableBeanFactory extends BeanFactory { /** * Find an {@link Annotation} of {@code annotationType} on the specified bean, - * traversing its interfaces and super classes if no annotation can be found on + * traversing its interfaces and superclasses if no annotation can be found on * the given class itself, as well as checking the bean's factory method (if any). * @param beanName the name of the bean to look for annotations on * @param annotationType the type of annotation to look for diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/ObjectFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/ObjectFactory.java index 9ac3ed4ab7..1ed6f2dbdb 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/ObjectFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/ObjectFactory.java @@ -23,7 +23,7 @@ import org.springframework.beans.BeansException; * (possibly shared or independent) when invoked. * *

This interface is typically used to encapsulate a generic factory which - * returns a new instance (prototype) of some target object on each invocation. + * returns a new instance (prototype) of some target objects on each invocation. * *

This interface is similar to {@link FactoryBean}, but implementations * of the latter are normally meant to be defined as SPI instances in a diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/QualifierAnnotationAutowireCandidateResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/QualifierAnnotationAutowireCandidateResolver.java index e4e104b4c8..d7e7e45574 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/QualifierAnnotationAutowireCandidateResolver.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/QualifierAnnotationAutowireCandidateResolver.java @@ -137,7 +137,7 @@ public class QualifierAnnotationAutowireCandidateResolver extends GenericTypeAwa * as a qualifier, the bean must 'match' against the annotation as * well as any attributes it may contain. The bean definition must contain * the same qualifier or match by meta attributes. A "value" attribute will - * fallback to match against the bean name or an alias if a qualifier or + * fall back to match against the bean name or an alias if a qualifier or * attribute does not match. * @see Qualifier */ @@ -186,7 +186,7 @@ public class QualifierAnnotationAutowireCandidateResolver extends GenericTypeAwa if (isQualifier(metaType)) { foundMeta = true; // Only accept fallback match if @Qualifier annotation has a value... - // Otherwise it is just a marker for a custom qualifier annotation. + // Otherwise, it is just a marker for a custom qualifier annotation. if ((fallbackToMeta && ObjectUtils.isEmpty(AnnotationUtils.getValue(metaAnn))) || !checkQualifier(bdHolder, metaAnn, typeConverter)) { return false; diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanFactoryPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanFactoryPostProcessor.java index 5db855fe79..68c286cffb 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanFactoryPostProcessor.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanFactoryPostProcessor.java @@ -30,7 +30,7 @@ import org.springframework.beans.BeansException; * *

A {@code BeanFactoryPostProcessor} may interact with and modify bean * definitions, but never bean instances. Doing so may cause premature bean - * instantiation, violating the container and causing unintended side-effects. + * instantiation, violating the container and causing unintended side effects. * If bean instance interaction is required, consider implementing * {@link BeanPostProcessor} instead. * diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java index c4d779e697..a5913f4314 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java @@ -65,7 +65,7 @@ public class ConstructorArgumentValues { /** * Copy all given argument values into this object, using separate holder - * instances to keep the values independent from the original object. + * instances to keep the values independent of the original object. *

Note: Identical ValueHolder instances will only be registered once, * to allow for merging and re-merging of argument value definitions. Distinct * ValueHolder instances carrying the same content are of course allowed. diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java index 7949003c68..cd53b6082c 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java @@ -155,7 +155,7 @@ public abstract class YamlProcessor { * resources. Each resource is parsed in turn and the documents inside checked against * the {@link #setDocumentMatchers(DocumentMatcher...) matchers}. If a document * matches it is passed into the callback, along with its representation as Properties. - * Depending on the {@link #setResolutionMethod(ResolutionMethod)} not all of the + * Depending on the {@link #setResolutionMethod(ResolutionMethod)} not all the * documents will be parsed. * @param callback a callback to delegate to once matching documents are found * @see #createYaml() diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.java index 32305abbac..fd5d06080c 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.java @@ -124,7 +124,7 @@ public class BeanComponentDefinition extends BeanDefinitionHolder implements Com } /** - * This implementations expects the other object to be of type BeanComponentDefinition + * This implementation expects the other object to be of type BeanComponentDefinition * as well, in addition to the superclass's equality requirements. */ @Override diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ComponentDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ComponentDefinition.java index a89902539c..33ec279f9c 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ComponentDefinition.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ComponentDefinition.java @@ -50,13 +50,13 @@ import org.springframework.beans.factory.config.BeanReference; * {@link #getBeanReferences}, tools may wish to inspect all {@link BeanDefinition BeanDefinitions} to gather * the full set of {@link BeanReference BeanReferences}. Implementations are required to provide * all {@link BeanReference BeanReferences} that are required to validate the configuration of the - * overall logical entity as well as those required to provide full user visualisation of the configuration. + * overall logical entity as well as those required to provide full user visualization of the configuration. * It is expected that certain {@link BeanReference BeanReferences} will not be important to * validation or to the user view of the configuration and as such these may be omitted. A tool may wish to * display any additional {@link BeanReference BeanReferences} sourced through the supplied * {@link BeanDefinition BeanDefinitions} but this is not considered to be a typical case. * - *

Tools can determine the important of contained {@link BeanDefinition BeanDefinitions} by checking the + *

Tools can determine the importance of contained {@link BeanDefinition BeanDefinitions} by checking the * {@link BeanDefinition#getRole role identifier}. The role is essentially a hint to the tool as to how * important the configuration provider believes a {@link BeanDefinition} is to the end user. It is expected * that tools will not display all {@link BeanDefinition BeanDefinitions} for a given diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java index c1e764b22a..fcb2ef67e3 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java @@ -1510,7 +1510,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac try { PropertyDescriptor pd = bw.getPropertyDescriptor(propertyName); // Don't try autowiring by type for type Object: never makes sense, - // even if it technically is a unsatisfied, non-simple property. + // even if it technically is an unsatisfied, non-simple property. if (Object.class != pd.getPropertyType()) { MethodParameter methodParam = BeanUtils.getWriteMethodParameter(pd); // Do not allow eager init for type matching in case of a prioritized post-processor. diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java index 2ceff658db..d100adad44 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java @@ -945,7 +945,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess } /** - * Specify whether or not the configured initializer method is the default. + * Specify whether the configured initializer method is the default. *

The default value is {@code true} for a locally specified init method * but switched to {@code false} for a shared setting in a defaults section * (e.g. {@code bean init-method} versus {@code beans default-init-method} @@ -984,7 +984,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess } /** - * Specify whether or not the configured destroy method is the default. + * Specify whether the configured destroy method is the default. *

The default value is {@code true} for a locally specified destroy method * but switched to {@code false} for a shared setting in a defaults section * (e.g. {@code bean destroy-method} versus {@code beans default-destroy-method} diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java index e36cef4157..5d7b60055b 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java @@ -593,7 +593,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp RootBeanDefinition mbd = getMergedLocalBeanDefinition(beanName); BeanDefinitionHolder dbd = mbd.getDecoratedDefinition(); - // Setup the types that we want to match against + // Set up the types that we want to match against Class classToMatch = typeToMatch.resolve(); if (classToMatch == null) { classToMatch = FactoryBean.class; diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java index bd19259339..bb958ed499 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java @@ -293,7 +293,7 @@ public final class BeanDefinitionBuilder { } /** - * Set whether or not this definition is abstract. + * Set whether this definition is abstract. */ public BeanDefinitionBuilder setAbstract(boolean flag) { this.beanDefinition.setAbstract(flag); diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java index 5f3d5f62ac..53084373a6 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java @@ -280,7 +280,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto } /** - * Return the dependency comparator for this BeanFactory (may be {@code null}. + * Return the dependency comparator for this BeanFactory (may be {@code null}). * @since 4.0 */ @Nullable diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/GenericTypeAwareAutowireCandidateResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/GenericTypeAwareAutowireCandidateResolver.java index 01b8145090..fbcd955a6b 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/GenericTypeAwareAutowireCandidateResolver.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/GenericTypeAwareAutowireCandidateResolver.java @@ -33,7 +33,7 @@ import org.springframework.util.ClassUtils; /** * Basic {@link AutowireCandidateResolver} that performs a full generic type * match with the candidate's type if the dependency is declared as a generic type - * (e.g. Repository<Customer>). + * (e.g. {@code Repository}). * *

This is the base class for * {@link org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver}, diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractBeanDefinitionParser.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractBeanDefinitionParser.java index 288ad403f4..018c85123f 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractBeanDefinitionParser.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractBeanDefinitionParser.java @@ -124,7 +124,7 @@ public abstract class AbstractBeanDefinitionParser implements BeanDefinitionPars /** * Register the supplied {@link BeanDefinitionHolder bean} with the supplied * {@link BeanDefinitionRegistry registry}. - *

Subclasses can override this method to control whether or not the supplied + *

Subclasses can override this method to control whether the supplied * {@link BeanDefinitionHolder bean} is actually even registered, or to * register even more beans. *

The default implementation registers the supplied {@link BeanDefinitionHolder bean} diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java index 6be311eb1e..b25951082f 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java @@ -1362,7 +1362,7 @@ public class BeanDefinitionParserDelegate { } /** - * Parse a custom element (outside of the default namespace). + * Parse a custom element (outside the default namespace). * @param ele the element to parse * @return the resulting bean definition */ @@ -1372,7 +1372,7 @@ public class BeanDefinitionParserDelegate { } /** - * Parse a custom element (outside of the default namespace). + * Parse a custom element (outside the default namespace). * @param ele the element to parse * @param containingBd the containing bean definition (if any) * @return the resulting bean definition diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultNamespaceHandlerResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultNamespaceHandlerResolver.java index 6dfda38e6b..815e0f59b5 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultNamespaceHandlerResolver.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultNamespaceHandlerResolver.java @@ -96,7 +96,7 @@ public class DefaultNamespaceHandlerResolver implements NamespaceHandlerResolver * Create a new {@code DefaultNamespaceHandlerResolver} using the * supplied mapping file location. * @param classLoader the {@link ClassLoader} instance used to load mapping resources - * may be {@code null}, in which case the thread context ClassLoader will be used) + * may be {@code null}, in which case the thread context ClassLoader will be used * @param handlerMappingsLocation the mapping file location */ public DefaultNamespaceHandlerResolver(@Nullable ClassLoader classLoader, String handlerMappingsLocation) { diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DelegatingEntityResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DelegatingEntityResolver.java index 1335d04017..fe8f6f61a3 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DelegatingEntityResolver.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DelegatingEntityResolver.java @@ -56,7 +56,7 @@ public class DelegatingEntityResolver implements EntityResolver { *

Configures the {@link PluggableSchemaResolver} with the supplied * {@link ClassLoader}. * @param classLoader the ClassLoader to use for loading - * (can be {@code null}) to use the default ClassLoader) + * (can be {@code null} to use the default ClassLoader) */ public DelegatingEntityResolver(@Nullable ClassLoader classLoader) { this.dtdResolver = new BeansDtdResolver(); diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/PluggableSchemaResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/PluggableSchemaResolver.java index 82d632302d..659b21b40b 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/PluggableSchemaResolver.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/PluggableSchemaResolver.java @@ -80,7 +80,7 @@ public class PluggableSchemaResolver implements EntityResolver { * Loads the schema URL → schema file location mappings using the default * mapping file pattern "META-INF/spring.schemas". * @param classLoader the ClassLoader to use for loading - * (can be {@code null}) to use the default ClassLoader) + * (can be {@code null} to use the default ClassLoader) * @see PropertiesLoaderUtils#loadAllProperties(String, ClassLoader) */ public PluggableSchemaResolver(@Nullable ClassLoader classLoader) { @@ -92,7 +92,7 @@ public class PluggableSchemaResolver implements EntityResolver { * Loads the schema URL → schema file location mappings using the given * mapping file pattern. * @param classLoader the ClassLoader to use for loading - * (can be {@code null}) to use the default ClassLoader) + * (can be {@code null} to use the default ClassLoader) * @param schemaMappingsLocation the location of the file that defines schema mappings * (must not be empty) * @see PropertiesLoaderUtils#loadAllProperties(String, ClassLoader) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandler.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandler.java index ddffb17d51..1bc26a924c 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandler.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandler.java @@ -50,7 +50,7 @@ import org.springframework.util.StringUtils; * the bean that will be considered as a parameter. * * Note: This implementation supports only named parameters - there is no - * support for indexes or types. Further more, the names are used as hints by + * support for indexes or types. Furthermore, the names are used as hints by * the container which, by default, does type introspection. * * @author Costin Leau diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java index 589208a4d3..4c930c3820 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java @@ -184,7 +184,7 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader { } /** - * Set whether or not the XML parser should be XML namespace aware. + * Set whether the XML parser should be XML namespace aware. * Default is "false". *

This is typically not needed when schema validation is active. * However, without validation, this has to be switched to "true" @@ -195,7 +195,7 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader { } /** - * Return whether or not the XML parser should be XML namespace aware. + * Return whether the XML parser should be XML namespace aware. */ public boolean isNamespaceAware() { return this.namespaceAware; diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java index 1a7a8ccc24..e278c8721b 100644 --- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java +++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java @@ -26,7 +26,7 @@ import org.springframework.util.StringUtils; * Custom {@link java.beans.PropertyEditor} for String arrays. * *

Strings must be in CSV format, with a customizable separator. - * By default values in the result are trimmed of whitespace. + * By default, values in the result are trimmed of whitespace. * * @author Rod Johnson * @author Juergen Hoeller @@ -86,7 +86,7 @@ public class StringArrayPropertyEditor extends PropertyEditorSupport { * @param emptyArrayAsNull {@code true} if an empty String array * is to be transformed into {@code null} * @param trimValues {@code true} if the values in the parsed arrays - * are to be trimmed of whitespace (default is true) + * are to be trimmed of whitespace (default is {@code true}) */ public StringArrayPropertyEditor(String separator, boolean emptyArrayAsNull, boolean trimValues) { this(separator, null, emptyArrayAsNull, trimValues); @@ -114,7 +114,7 @@ public class StringArrayPropertyEditor extends PropertyEditorSupport { * @param emptyArrayAsNull {@code true} if an empty String array * is to be transformed into {@code null} * @param trimValues {@code true} if the values in the parsed arrays - * are to be trimmed of whitespace (default is true) + * are to be trimmed of whitespace (default is {@code true}) */ public StringArrayPropertyEditor( String separator, @Nullable String charsToDelete, boolean emptyArrayAsNull, boolean trimValues) { diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URIEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URIEditor.java index 344fb5d439..e94e65f5a9 100644 --- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URIEditor.java +++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URIEditor.java @@ -130,7 +130,7 @@ public class URIEditor extends PropertyEditorSupport { /** * Create a URI instance for the given user-specified String value. - *

The default implementation encodes the value into a RFC-2396 compliant URI. + *

The default implementation encodes the value into an RFC-2396 compliant URI. * @param value the value to convert into a URI instance * @return the URI instance * @throws java.net.URISyntaxException if URI conversion failed diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/MethodInvokingFactoryBeanTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/MethodInvokingFactoryBeanTests.java index 810b247783..afc921fa4f 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/config/MethodInvokingFactoryBeanTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/MethodInvokingFactoryBeanTests.java @@ -43,7 +43,7 @@ public class MethodInvokingFactoryBeanTests { @Test public void testParameterValidation() throws Exception { - // assert that only static OR non static are set, but not both or none + // assert that only static OR non-static are set, but not both or none MethodInvokingFactoryBean mcfb = new MethodInvokingFactoryBean(); assertThatIllegalArgumentException().isThrownBy(mcfb::afterPropertiesSet); diff --git a/spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/ITestBean.java b/spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/ITestBean.java index 742b39c4ea..43ce2dd40e 100644 --- a/spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/ITestBean.java +++ b/spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/ITestBean.java @@ -22,7 +22,7 @@ import java.io.IOException; * Interface used for {@link org.springframework.beans.testfixture.beans.TestBean}. * *

Two methods are the same as on Person, but if this - * extends person it breaks quite a few tests.. + * extends person it breaks quite a few tests. * * @author Rod Johnson * @author Juergen Hoeller From c6be3b33c9748578a22eda37424deceb55e1c695 Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Tue, 12 Jul 2022 17:58:30 +0200 Subject: [PATCH 2/3] Fix and improve Javadoc in spring-aop Closes gh-28803 --- .../main/java/org/aopalliance/intercept/Joinpoint.java | 2 +- .../aop/IntroductionAwareMethodMatcher.java | 2 +- .../main/java/org/springframework/aop/MethodMatcher.java | 4 ++-- .../main/java/org/springframework/aop/SpringProxy.java | 2 +- .../aop/aspectj/annotation/AspectJAdvisorFactory.java | 4 ++-- .../aop/aspectj/annotation/AspectMetadata.java | 2 +- .../autoproxy/AspectJAwareAdvisorAutoProxyCreator.java | 4 ++-- .../org/springframework/aop/framework/AdvisedSupport.java | 4 ++-- .../springframework/aop/framework/JdkDynamicAopProxy.java | 6 +++--- .../springframework/aop/framework/ProxyFactoryBean.java | 4 ++-- .../aop/framework/autoproxy/AbstractAutoProxyCreator.java | 4 ++-- .../aop/interceptor/AbstractTraceInterceptor.java | 4 ++-- .../aop/interceptor/AsyncUncaughtExceptionHandler.java | 2 +- .../java/org/springframework/aop/support/AopUtils.java | 8 ++++---- .../aop/support/DefaultPointcutAdvisor.java | 2 +- .../org/springframework/aop/support/MethodMatchers.java | 2 +- .../aop/target/AbstractPoolingTargetSource.java | 2 +- .../annotation/AbstractAspectJAdvisorFactoryTests.java | 2 +- .../annotation/aspectj/EnableSpringConfigured.java | 2 +- 19 files changed, 31 insertions(+), 31 deletions(-) diff --git a/spring-aop/src/main/java/org/aopalliance/intercept/Joinpoint.java b/spring-aop/src/main/java/org/aopalliance/intercept/Joinpoint.java index 480d9f087c..b975538940 100644 --- a/spring-aop/src/main/java/org/aopalliance/intercept/Joinpoint.java +++ b/spring-aop/src/main/java/org/aopalliance/intercept/Joinpoint.java @@ -63,7 +63,7 @@ public interface Joinpoint { /** * Return the static part of this joinpoint. *

The static part is an accessible object on which a chain of - * interceptors are installed. + * interceptors is installed. */ @Nonnull AccessibleObject getStaticPart(); diff --git a/spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java b/spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java index 4185c92fa2..181237b2a8 100644 --- a/spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java +++ b/spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java @@ -36,7 +36,7 @@ public interface IntroductionAwareMethodMatcher extends MethodMatcher { * @param targetClass the target class * @param hasIntroductions {@code true} if the object on whose behalf we are * 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); diff --git a/spring-aop/src/main/java/org/springframework/aop/MethodMatcher.java b/spring-aop/src/main/java/org/springframework/aop/MethodMatcher.java index 29127c73d4..d5f8c2a89a 100644 --- a/spring-aop/src/main/java/org/springframework/aop/MethodMatcher.java +++ b/spring-aop/src/main/java/org/springframework/aop/MethodMatcher.java @@ -60,7 +60,7 @@ public interface MethodMatcher { * will be made. * @param method the candidate method * @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); @@ -70,7 +70,7 @@ public interface MethodMatcher { * runtime even if the 2-arg matches method returns {@code true}? *

Can be invoked when an AOP proxy is created, and need not be invoked * 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 * is required if static matching passed */ diff --git a/spring-aop/src/main/java/org/springframework/aop/SpringProxy.java b/spring-aop/src/main/java/org/springframework/aop/SpringProxy.java index 42e44ceb02..95057e0d7d 100644 --- a/spring-aop/src/main/java/org/springframework/aop/SpringProxy.java +++ b/spring-aop/src/main/java/org/springframework/aop/SpringProxy.java @@ -18,7 +18,7 @@ package org.springframework.aop; /** * 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 * @since 2.0.1 diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJAdvisorFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJAdvisorFactory.java index ddba1f0c1f..c3bf168529 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJAdvisorFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJAdvisorFactory.java @@ -39,7 +39,7 @@ import org.springframework.lang.Nullable; 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}. *

Will simply return {@code false} if the supposed aspect is * invalid (such as an extension of a concrete aspect class). @@ -47,7 +47,7 @@ public interface AspectJAdvisorFactory { * such as those with unsupported instantiation models. * Use the {@link #validate} method to handle these cases if necessary. * @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); diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java index 27fb520d40..1617e2267e 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java @@ -67,7 +67,7 @@ public class AspectMetadata implements Serializable { /** * 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. */ private final Pointcut perClausePointcut; diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java index 2d2aabd07f..8579e5e4c9 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java @@ -60,8 +60,8 @@ public class AspectJAwareAdvisorAutoProxyCreator extends AbstractAdvisorAutoProx *

  • Otherwise the advice declared first gets highest precedence (i.e., runs * first).
  • * - *

    Important: Advisors are sorted in precedence order, from highest - * precedence to lowest. "On the way in" to a join point, the highest precedence + *

    Important: Advisors are sorted in precedence order, from the highest + * 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 * precedence advisor should run last. */ diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java b/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java index b2b8060b8a..3de330c108 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java @@ -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 */ 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 */ public void addAdvisors(Collection advisors) { diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/JdkDynamicAopProxy.java b/spring-aop/src/main/java/org/springframework/aop/framework/JdkDynamicAopProxy.java index fcfaf93dd8..3aeb80cd18 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/JdkDynamicAopProxy.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/JdkDynamicAopProxy.java @@ -72,8 +72,8 @@ final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializa * NOTE: We could avoid the code duplication between this class and the CGLIB * 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 - * elegance for performance. (We have a good test suite to ensure that the different - * proxies behave the same :-) + * elegance for performance (we have a good test suite to ensure that the different + * proxies behave the same :-)). * 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. List 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. if (chain.isEmpty()) { // We can skip creating a MethodInvocation: just invoke the target directly diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java index 3133dbaaa1..c0a8286eae 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java @@ -60,7 +60,7 @@ import org.springframework.util.ObjectUtils; * to use the "targetName"/"target"/"targetSource" properties instead. * *

    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 * both "globalBean1" and "globalBean2", "*" all defined interceptors). The matching * interceptors get applied according to their returned order value, if they implement @@ -406,7 +406,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport if (namedBeanClass != null) { 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()) { logger.debug("Could not determine type of bean with name '" + beanName + "' - assuming it is neither an Advisor nor an Advice"); diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java index c550168800..e81b6e43e0 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java @@ -119,7 +119,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport 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. */ 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. *

    Overridden from the super class to prevent the proxy configuration * from being frozen before the proxy is created. diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractTraceInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractTraceInterceptor.java index 892cf5cacc..2d67708c35 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractTraceInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractTraceInterceptor.java @@ -56,7 +56,7 @@ public abstract class AbstractTraceInterceptor implements MethodInterceptor, Ser 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 */ 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 * to the {@code invokeUnderTrace} method for handling. * @see #invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log) diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncUncaughtExceptionHandler.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncUncaughtExceptionHandler.java index a3d7d850eb..868e4898f5 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncUncaughtExceptionHandler.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncUncaughtExceptionHandler.java @@ -36,7 +36,7 @@ public interface AsyncUncaughtExceptionHandler { * Handle the given uncaught exception thrown from an asynchronous method. * @param ex the exception thrown from 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); diff --git a/spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java b/spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java index 860f0d6339..e3001ec497 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java @@ -217,7 +217,7 @@ public abstract class AopUtils { * out a pointcut for a class. * @param pc the static or dynamic pointcut to check * @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 * @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? * 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 targetClass class we're testing * @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? - *

    This is an important test as it can be used to optimize out a advisor for a class. + *

    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). * @param advisor the advisor to check * @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 * @return whether the pointcut can apply on any method */ diff --git a/spring-aop/src/main/java/org/springframework/aop/support/DefaultPointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/support/DefaultPointcutAdvisor.java index 0f3ded0e6b..45c2e17254 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/DefaultPointcutAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/DefaultPointcutAdvisor.java @@ -43,7 +43,7 @@ public class DefaultPointcutAdvisor extends AbstractGenericPointcutAdvisor imple /** * Create an empty DefaultPointcutAdvisor. - *

    Advice must be set before use using setter methods. + *

    Advice must be set before using setter methods. * Pointcut will normally be set also, but defaults to {@code Pointcut.TRUE}. */ public DefaultPointcutAdvisor() { diff --git a/spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java b/spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java index 23b4d9b78d..f36b47cb8a 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java @@ -90,7 +90,7 @@ public abstract class MethodMatchers { * @param targetClass the target class * @param hasIntroductions {@code true} if the object on whose behalf we are * 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) { Assert.notNull(mm, "MethodMatcher must not be null"); diff --git a/spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java b/spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java index a5cfedbcbe..30e9c1e2ef 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java @@ -37,7 +37,7 @@ import org.springframework.lang.Nullable; * {@link AbstractPrototypeBasedTargetSource} can be used to create objects * in order to put them into the pool. * - *

    Subclasses must also implement some of the monitoring methods from the + *

    Subclasses must also implement some monitoring methods from the * {@link PoolingConfig} interface. The {@link #getPoolingConfigMixin()} method * makes these stats available on proxied objects through an IntroductionAdvisor. * diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java index 3f5a7b562c..847ef4f380 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java @@ -931,7 +931,7 @@ abstract class AbstractMakeModifiable { return setter.getDeclaringClass().getMethod(getterName); } catch (NoSuchMethodException ex) { - // must be write only + // must be write-only return null; } } diff --git a/spring-aspects/src/main/java/org/springframework/context/annotation/aspectj/EnableSpringConfigured.java b/spring-aspects/src/main/java/org/springframework/context/annotation/aspectj/EnableSpringConfigured.java index e26a94f71b..0f362d91e8 100644 --- a/spring-aspects/src/main/java/org/springframework/context/annotation/aspectj/EnableSpringConfigured.java +++ b/spring-aspects/src/main/java/org/springframework/context/annotation/aspectj/EnableSpringConfigured.java @@ -26,7 +26,7 @@ import org.springframework.context.annotation.Import; /** * 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 * {@link org.springframework.beans.factory.annotation.Configurable @Configurable} * annotation). From 2e4d7e4ef986d79448c7b2790cd584e2c1f7adbf Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 13 Jul 2022 16:12:26 +0200 Subject: [PATCH 3/3] Polishing --- .../aop/framework/ProxyFactoryBean.java | 15 ++++++++------- .../beans/factory/ObjectFactory.java | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java index c0a8286eae..7c049c98ab 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java @@ -50,7 +50,7 @@ import org.springframework.util.ObjectUtils; /** * {@link org.springframework.beans.factory.FactoryBean} implementation that builds an - * AOP proxy based on beans in Spring {@link org.springframework.beans.factory.BeanFactory}. + * AOP proxy based on beans in a Spring {@link org.springframework.beans.factory.BeanFactory}. * *

    {@link org.aopalliance.intercept.MethodInterceptor MethodInterceptors} and * {@link org.springframework.aop.Advisor Advisors} are identified by a list of bean @@ -60,11 +60,12 @@ import org.springframework.util.ObjectUtils; * to use the "targetName"/"target"/"targetSource" properties instead. * *

    Global interceptors and advisors can be added at the factory level. The specified - * 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 - * both "globalBean1" and "globalBean2", "*" all defined interceptors). The matching - * interceptors get applied according to their returned order value, if they implement - * the {@link org.springframework.core.Ordered} interface. + * ones are expanded in an interceptor list where an "xxx*" entry is included in the + * list, matching the given prefix with the bean names — for example, "global*" + * would match both "globalBean1" and "globalBean2"; whereas, "*" would match all + * defined interceptors. The matching interceptors get applied according to their + * returned order value, if they implement the {@link org.springframework.core.Ordered} + * interface. * *

    Creates a JDK proxy when proxy interfaces are given, and a CGLIB proxy for the * actual target class if not. Note that the latter will only work if the target class @@ -75,7 +76,7 @@ import org.springframework.util.ObjectUtils; * This won't work for existing prototype references, which are independent. However, * it will work for prototypes subsequently obtained from the factory. Changes to * interception will work immediately on singletons (including existing references). - * However, to change interfaces or target it's necessary to obtain a new instance + * However, to change interfaces or a target it's necessary to obtain a new instance * from the factory. This means that singleton instances obtained from the factory * do not have the same object identity. However, they do have the same interceptors * and target, and changing any reference will change all objects. diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/ObjectFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/ObjectFactory.java index 1ed6f2dbdb..9ac3ed4ab7 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/ObjectFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/ObjectFactory.java @@ -23,7 +23,7 @@ import org.springframework.beans.BeansException; * (possibly shared or independent) when invoked. * *

    This interface is typically used to encapsulate a generic factory which - * returns a new instance (prototype) of some target objects on each invocation. + * returns a new instance (prototype) of some target object on each invocation. * *

    This interface is similar to {@link FactoryBean}, but implementations * of the latter are normally meant to be defined as SPI instances in a