Fix javadoc warnings

Before this change there were numerous javadoc warnings being reported
while building Spring framework API.

This commit resolves most of the javadoc warnings, reducing the total
number from 265 to 103.

Issue: SPR-9113
This commit is contained in:
Stevo Slavic
2012-02-12 20:59:58 +01:00
committed by Chris Beams
parent e830511e8a
commit effb762558
92 changed files with 347 additions and 350 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 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.
@@ -23,10 +23,10 @@ import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
/**
* <code>ContextConfigurationAttributes</code> encapsulates the context
* <code>ContextConfigurationAttributes</code> encapsulates the context
* configuration attributes declared on a test class via
* {@link ContextConfiguration @ContextConfiguration}.
*
*
* @author Sam Brannen
* @since 3.1
* @see ContextConfiguration
@@ -52,7 +52,7 @@ public class ContextConfigurationAttributes {
* Resolve resource locations from the {@link ContextConfiguration#locations() locations}
* and {@link ContextConfiguration#value() value} attributes of the supplied
* {@link ContextConfiguration} annotation.
*
*
* @throws IllegalStateException if both the locations and value attributes have been declared
*/
private static String[] resolveLocations(Class<?> declaringClass, ContextConfiguration contextConfiguration) {
@@ -81,7 +81,7 @@ public class ContextConfigurationAttributes {
* supplied {@link ContextConfiguration @ContextConfiguration} annotation and
* the {@link Class test class} that declared it.
* @param declaringClass the test class that declared {@code @ContextConfiguration}
* @param contextConfiguration the annotation from which to retrieve the attributes
* @param contextConfiguration the annotation from which to retrieve the attributes
*/
public ContextConfigurationAttributes(Class<?> declaringClass, ContextConfiguration contextConfiguration) {
this(declaringClass, resolveLocations(declaringClass, contextConfiguration), contextConfiguration.classes(),
@@ -93,14 +93,14 @@ public class ContextConfigurationAttributes {
* {@link Class test class} that declared the
* {@link ContextConfiguration @ContextConfiguration} annotation and its
* corresponding attributes.
*
*
* @param declaringClass the test class that declared {@code @ContextConfiguration}
* @param locations the resource locations declared via {@code @ContextConfiguration}
* @param classes the configuration classes declared via {@code @ContextConfiguration}
* @param inheritLocations the <code>inheritLocations</code> flag declared via {@code @ContextConfiguration}
* @param contextLoaderClass the {@code ContextLoader} class declared via {@code @ContextConfiguration}
* @throws IllegalArgumentException if the {@code declaringClass} or {@code contextLoaderClass} is
* <code>null</code>, or if the {@code locations} and {@code classes} are both non-empty
* <code>null</code>, or if the {@code locations} and {@code classes} are both non-empty
*/
public ContextConfigurationAttributes(Class<?> declaringClass, String[] locations, Class<?>[] classes,
boolean inheritLocations, Class<? extends ContextLoader> contextLoaderClass) {
@@ -138,12 +138,12 @@ public class ContextConfigurationAttributes {
* Get the resource locations that were declared via
* {@link ContextConfiguration @ContextConfiguration}.
* <p>Note: this is a mutable property. The returned value may therefore
* represent a <em>processed</em> value that does not match the original value
* represent a <em>processed</em> value that does not match the original value
* declared via {@link ContextConfiguration @ContextConfiguration}.
* @return the resource locations; potentially <code>null</code> or <em>empty</em>
* @see ContextConfiguration#value
* @see ContextConfiguration#locations
* @see #setLocations()
* @see #setLocations(String[])
*/
public String[] getLocations() {
return locations;
@@ -162,11 +162,11 @@ public class ContextConfigurationAttributes {
* Get the configuration classes that were declared via
* {@link ContextConfiguration @ContextConfiguration}.
* <p>Note: this is a mutable property. The returned value may therefore
* represent a <em>processed</em> value that does not match the original value
* represent a <em>processed</em> value that does not match the original value
* declared via {@link ContextConfiguration @ContextConfiguration}.
* @return the configuration classes; potentially <code>null</code> or <em>empty</em>
* @see ContextConfiguration#classes
* @see #setClasses()
* @see #setClasses(Class[])
*/
public Class<?>[] getClasses() {
return classes;
@@ -182,7 +182,7 @@ public class ContextConfigurationAttributes {
}
/**
* Determine if this {@code ContextConfigurationAttributes} instance has
* Determine if this {@code ContextConfigurationAttributes} instance has
* path-based resource locations.
* @return <code>true</code> if the {@link #getLocations() locations} array is not empty
* @see #hasResources()
@@ -193,7 +193,7 @@ public class ContextConfigurationAttributes {
}
/**
* Determine if this {@code ContextConfigurationAttributes} instance has
* Determine if this {@code ContextConfigurationAttributes} instance has
* class-based resources.
* @return <code>true</code> if the {@link #getClasses() classes} array is not empty
* @see #hasResources()
@@ -204,7 +204,7 @@ public class ContextConfigurationAttributes {
}
/**
* Determine if this {@code ContextConfigurationAttributes} instance has
* Determine if this {@code ContextConfigurationAttributes} instance has
* either path-based resource locations or class-based resources.
* @return <code>true</code> if either the {@link #getLocations() locations}
* or the {@link #getClasses() classes} array is not empty

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 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.
@@ -21,7 +21,7 @@ import org.springframework.context.ApplicationContext;
/**
* Strategy interface for loading an {@link ApplicationContext application context}
* for an integration test managed by the Spring TestContext Framework.
*
*
* <p>The {@code SmartContextLoader} SPI supersedes the {@link ContextLoader} SPI
* introduced in Spring 2.5: a {@code SmartContextLoader} can choose to process
* either resource locations or configuration classes. Furthermore, a
@@ -34,13 +34,13 @@ import org.springframework.context.ApplicationContext;
* processContextConfiguration()} prior to calling
* {@link #loadContext(MergedContextConfiguration) loadContext()}. This gives a
* {@code SmartContextLoader} the opportunity to provide custom support for
* modifying resource locations or detecting default resource locations or
* modifying resource locations or detecting default resource locations or
* default configuration classes. The results of
* {@link #processContextConfiguration(ContextConfigurationAttributes)
* processContextConfiguration()} should be merged for all classes in the
* hierarchy of the root test class and then supplied to
* {@link #loadContext(MergedContextConfiguration) loadContext()}.
*
*
* <p>Even though {@code SmartContextLoader} extends {@code ContextLoader},
* clients should favor {@code SmartContextLoader}-specific methods over those
* defined in {@code ContextLoader}, particularly because a
@@ -97,7 +97,7 @@ public interface SmartContextLoader extends ContextLoader {
* {@link org.springframework.beans.factory.annotation.Autowired @Autowired},
* {@link javax.annotation.Resource @Resource}, and
* {@link javax.inject.Inject @Inject}. In addition, concrete implementations
* should set the active bean definition profiles in the context's
* should set the active bean definition profiles in the context's
* {@link org.springframework.core.env.Environment Environment}.
* <p>Any <code>ApplicationContext</code> loaded by a
* {@code SmartContextLoader} <strong>must</strong> register a JVM
@@ -110,7 +110,8 @@ public interface SmartContextLoader extends ContextLoader {
* @return a new application context
* @throws Exception if context loading failed
* @see #processContextConfiguration(ContextConfigurationAttributes)
* @see org.springframework.context.annotation.AnnotationConfigUtils#registerAnnotationConfigProcessors()
* @see org.springframework.context.annotation.AnnotationConfigUtils
* #registerAnnotationConfigProcessors(org.springframework.beans.factory.support.BeanDefinitionRegistry)
* @see org.springframework.test.context.MergedContextConfiguration#getActiveProfiles()
* @see org.springframework.context.ConfigurableApplicationContext#getEnvironment()
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 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.
@@ -28,9 +28,9 @@ import org.springframework.test.context.TestContextManager;
* <code>RunAfterTestMethodCallbacks</code> is a custom JUnit 4.5+
* {@link Statement} which allows the <em>Spring TestContext Framework</em> to
* be plugged into the JUnit execution chain by calling
* {@link TestContextManager#afterTestMethod(Object, Method) afterTestMethod()}
* {@link TestContextManager#afterTestMethod(Object, Method, Throwable) afterTestMethod()}
* on the supplied {@link TestContextManager}.
*
*
* @see #evaluate()
* @see RunBeforeTestMethodCallbacks
* @author Sam Brannen
@@ -50,7 +50,7 @@ public class RunAfterTestMethodCallbacks extends Statement {
/**
* Constructs a new <code>RunAfterTestMethodCallbacks</code> statement.
*
*
* @param next the next <code>Statement</code> in the execution chain
* @param testInstance the current test instance (never <code>null</code>)
* @param testMethod the test method which has just been executed on the
@@ -70,7 +70,7 @@ public class RunAfterTestMethodCallbacks extends Statement {
* Invokes the next {@link Statement} in the execution chain (typically an
* instance of {@link org.junit.internal.runners.statements.RunAfters
* RunAfters}), catching any exceptions thrown, and then calls
* {@link TestContextManager#afterTestMethod(Object, Method)} with the first
* {@link TestContextManager#afterTestMethod(Object, Method, Throwable)} with the first
* caught exception (if any). If the call to <code>afterTestMethod()</code>
* throws an exception, it will also be tracked. Multiple exceptions will be
* combined into a {@link MultipleFailureException}.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 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.
@@ -35,11 +35,12 @@ import org.springframework.util.StringUtils;
* implementations of the {@link ContextLoader} SPI. Provides a
* <em>Template Method</em> based approach for {@link #processLocations processing}
* resource locations.
*
*
* <p>As of Spring 3.1, <code>AbstractContextLoader</code> also provides a basis
* for all concrete implementations of the {@link SmartContextLoader} SPI. For
* backwards compatibility with the {@code ContextLoader} SPI,
* {@link #processContextConfiguration()} delegates to {@link #processLocations()}.
* backwards compatibility with the {@code ContextLoader} SPI,
* {@link #processContextConfiguration(ContextConfigurationAttributes)} delegates
* to {@link #processLocations(Class, String...)}.
*
* @author Sam Brannen
* @author Juergen Hoeller
@@ -59,7 +60,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
/**
* For backwards compatibility with the {@link ContextLoader} SPI, the
* default implementation simply delegates to {@link #processLocations()},
* default implementation simply delegates to {@link #processLocations(Class, String...)},
* passing it the {@link ContextConfigurationAttributes#getDeclaringClass()
* declaring class} and {@link ContextConfigurationAttributes#getLocations()
* resource locations} retrieved from the supplied
@@ -70,7 +71,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
* <p>Can be overridden in subclasses &mdash; for example, to process
* configuration classes instead of resource locations.
* @since 3.1
* @see #processLocations()
* @see #processLocations(Class, String...)
*/
public void processContextConfiguration(ContextConfigurationAttributes configAttributes) {
String[] processedLocations = processLocations(configAttributes.getDeclaringClass(),
@@ -96,10 +97,10 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
* @return a processed array of application context resource locations
* @since 2.5
* @see #isGenerateDefaultLocations()
* @see #generateDefaultLocations()
* @see #modifyLocations()
* @see org.springframework.test.context.ContextLoader#processLocations()
* @see #processContextConfiguration()
* @see #generateDefaultLocations(Class)
* @see #modifyLocations(Class, String...)
* @see org.springframework.test.context.ContextLoader#processLocations(Class, String...)
* @see #processContextConfiguration(ContextConfigurationAttributes)
*/
public final String[] processLocations(Class<?> clazz, String... locations) {
return (ObjectUtils.isEmpty(locations) && isGenerateDefaultLocations()) ? generateDefaultLocations(clazz)
@@ -115,7 +116,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
* where <code>&lt;suffix&gt;</code> is the value of the
* {@link #getResourceSuffix() resource suffix} string.
* <p>As of Spring 3.1, the implementation of this method adheres to the
* contract defined in the {@link SmartContextLoader} SPI. Specifically,
* contract defined in the {@link SmartContextLoader} SPI. Specifically,
* this method will <em>preemptively</em> verify that the generated default
* location actually exists. If it does not exist, this method will log a
* warning and return an empty array.
@@ -189,14 +190,15 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
/**
* Determine whether or not <em>default</em> resource locations should be
* generated if the <code>locations</code> provided to
* {@link #processLocations()} are <code>null</code> or empty.
* {@link #processLocations(Class, String...)} are <code>null</code> or empty.
* <p>As of Spring 3.1, the semantics of this method have been overloaded
* to include detection of either default resource locations or default
* configuration classes. Consequently, this method can also be used to
* configuration classes. Consequently, this method can also be used to
* determine whether or not <em>default</em> configuration classes should be
* detected if the <code>classes</code> present in the
* {@link ContextConfigurationAttributes configuration attributes} supplied
* to {@link #processContextConfiguration()} are <code>null</code> or empty.
* to {@link #processContextConfiguration(ContextConfigurationAttributes)}
* are <code>null</code> or empty.
* <p>Can be overridden by subclasses to change the default behavior.
* @return always <code>true</code> by default
* @since 2.5
@@ -211,7 +213,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
* <p>Must be implemented by subclasses.
* @return the resource suffix; should not be <code>null</code> or empty
* @since 2.5
* @see #generateDefaultLocations()
* @see #generateDefaultLocations(Class)
*/
protected abstract String getResourceSuffix();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 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.
@@ -29,7 +29,7 @@ import org.springframework.util.StringUtils;
/**
* Abstract, generic extension of {@link AbstractContextLoader} that loads a
* {@link GenericApplicationContext}.
*
*
* <ul>
* <li>If instances of concrete subclasses are invoked via the
* {@link org.springframework.test.context.ContextLoader ContextLoader} SPI, the
@@ -38,7 +38,7 @@ import org.springframework.util.StringUtils;
* <li>If instances of concrete subclasses are invoked via the
* {@link org.springframework.test.context.SmartContextLoader SmartContextLoader}
* SPI, the context will be loaded from the {@link MergedContextConfiguration}
* provided to {@link #loadContext(MergedContextConfiguration)}. In such cases, a
* provided to {@link #loadContext(MergedContextConfiguration)}. In such cases, a
* <code>SmartContextLoader</code> will decide whether to load the context from
* <em>locations</em> or
* {@link org.springframework.context.annotation.Configuration configuration classes}.</li>
@@ -68,17 +68,17 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader
* <li>Sets the <em>active bean definition profiles</em> from the supplied
* <code>MergedContextConfiguration</code> in the
* {@link org.springframework.core.env.Environment Environment} of the context.</li>
* <li>Calls {@link #prepareContext()} to allow for customizing the context
* <li>Calls {@link #prepareContext(GenericApplicationContext)} to allow for customizing the context
* before bean definitions are loaded.</li>
* <li>Calls {@link #customizeBeanFactory()} to allow for customizing the
* <li>Calls {@link #customizeBeanFactory(DefaultListableBeanFactory)} to allow for customizing the
* context's <code>DefaultListableBeanFactory</code>.</li>
* <li>Delegates to {@link #loadBeanDefinitions()} to populate the context
* from the configuration locations or classes in the supplied
* <li>Delegates to {@link #loadBeanDefinitions(GenericApplicationContext, MergedContextConfiguration)}
* to populate the context from the configuration locations or classes in the supplied
* <code>MergedContextConfiguration</code>.</li>
* <li>Delegates to {@link AnnotationConfigUtils} for
* {@link AnnotationConfigUtils#registerAnnotationConfigProcessors registering}
* annotation configuration processors.</li>
* <li>Calls {@link #customizeContext()} to allow for customizing the context
* <li>Calls {@link #customizeContext(GenericApplicationContext)} to allow for customizing the context
* before it is refreshed.</li>
* <li>{@link ConfigurableApplicationContext#refresh Refreshes} the
* context and registers a JVM shutdown hook for it.</li>
@@ -110,17 +110,17 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader
* <p>Implementation details:
* <ul>
* <li>Creates a {@link GenericApplicationContext} instance.</li>
* <li>Calls {@link #prepareContext()} to allow for customizing the context
* <li>Calls {@link #prepareContext(GenericApplicationContext)} to allow for customizing the context
* before bean definitions are loaded.</li>
* <li>Calls {@link #customizeBeanFactory()} to allow for customizing the
* <li>Calls {@link #customizeBeanFactory(DefaultListableBeanFactory)} to allow for customizing the
* context's <code>DefaultListableBeanFactory</code>.</li>
* <li>Delegates to {@link #createBeanDefinitionReader()} to create a
* <li>Delegates to {@link #createBeanDefinitionReader(GenericApplicationContext)} to create a
* {@link BeanDefinitionReader} which is then used to populate the context
* from the specified config locations.</li>
* <li>Delegates to {@link AnnotationConfigUtils} for
* {@link AnnotationConfigUtils#registerAnnotationConfigProcessors registering}
* annotation configuration processors.</li>
* <li>Calls {@link #customizeContext()} to allow for customizing the context
* <li>Calls {@link #customizeContext(GenericApplicationContext)} to allow for customizing the context
* before it is refreshed.</li>
* <li>{@link ConfigurableApplicationContext#refresh Refreshes} the
* context and registers a JVM shutdown hook for it.</li>
@@ -188,16 +188,16 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader
* from the configuration locations or classes in the supplied
* <code>MergedContextConfiguration</code>.</li>
* <p>The default implementation delegates to the {@link BeanDefinitionReader}
* returned by {@link #createBeanDefinitionReader()} to
* returned by {@link #createBeanDefinitionReader(GenericApplicationContext)} to
* {@link BeanDefinitionReader#loadBeanDefinitions(String) load} the
* bean definitions.
* <p>Subclasses must provide an appropriate implementation of
* {@link #createBeanDefinitionReader()}. Alternatively subclasses may
* {@link #createBeanDefinitionReader(GenericApplicationContext)}. Alternatively subclasses may
* provide a <em>no-op</em> implementation of {@code createBeanDefinitionReader()}
* and override this method to provide a custom strategy for loading or
* registering bean definitions.
* @param context the context into which the bean definitions should be loaded
* @param mergedConfig the merged context configuration
* @param mergedConfig the merged context configuration
* @see #loadContext(MergedContextConfiguration)
* @since 3.1
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 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.
@@ -35,7 +35,7 @@ import org.springframework.util.ObjectUtils;
* Concrete implementation of {@link AbstractGenericContextLoader} that loads
* bean definitions from
* {@link org.springframework.context.annotation.Configuration configuration classes}.
*
*
* <p>Note: <code>AnnotationConfigContextLoader</code> supports
* {@link org.springframework.context.annotation.Configuration configuration classes}
* rather than the String-based resource locations defined by the legacy
@@ -46,13 +46,13 @@ import org.springframework.util.ObjectUtils;
* <code>AbstractContextLoader</code> or <code>AbstractGenericContextLoader</code>.
* Consequently, <code>AnnotationConfigContextLoader</code> should chiefly be
* considered a {@link org.springframework.test.context.SmartContextLoader SmartContextLoader}
* rather than a {@link org.springframework.test.context.ContextLoader ContextLoader}.
*
* rather than a {@link org.springframework.test.context.ContextLoader ContextLoader}.
*
* @author Sam Brannen
* @since 3.1
* @see #processContextConfiguration()
* @see #detectDefaultConfigurationClasses()
* @see #loadBeanDefinitions()
* @see #processContextConfiguration(ContextConfigurationAttributes)
* @see #detectDefaultConfigurationClasses(Class)
* @see #loadBeanDefinitions(GenericApplicationContext, MergedContextConfiguration)
*/
public class AnnotationConfigContextLoader extends AbstractGenericContextLoader {
@@ -72,9 +72,9 @@ public class AnnotationConfigContextLoader extends AbstractGenericContextLoader
* supplied configuration attributes. Otherwise, properties in the supplied
* configuration attributes will not be modified.
* @param configAttributes the context configuration attributes to process
* @see org.springframework.test.context.SmartContextLoader#processContextConfiguration()
* @see org.springframework.test.context.SmartContextLoader#processContextConfiguration(ContextConfigurationAttributes)
* @see #isGenerateDefaultLocations()
* @see #detectDefaultConfigurationClasses()
* @see #detectDefaultConfigurationClasses(Class)
*/
public void processContextConfiguration(ContextConfigurationAttributes configAttributes) {
if (ObjectUtils.isEmpty(configAttributes.getClasses()) && isGenerateDefaultLocations()) {
@@ -117,7 +117,7 @@ public class AnnotationConfigContextLoader extends AbstractGenericContextLoader
* {@link Configuration @Configuration}.
* <p>The implementation of this method adheres to the contract defined in the
* {@link org.springframework.test.context.SmartContextLoader SmartContextLoader}
* SPI. Specifically, this method uses introspection to detect default
* SPI. Specifically, this method uses introspection to detect default
* configuration classes that comply with the constraints required of
* {@code @Configuration} class implementations. If a potential candidate
* configuration class does meet these requirements, this method will log a
@@ -187,7 +187,7 @@ public class AnnotationConfigContextLoader extends AbstractGenericContextLoader
}
/**
* <code>AnnotationConfigContextLoader</code> should be used as a
* <code>AnnotationConfigContextLoader</code> should be used as a
* {@link org.springframework.test.context.SmartContextLoader SmartContextLoader},
* not as a legacy {@link org.springframework.test.context.ContextLoader ContextLoader}.
* Consequently, this method is not supported.
@@ -226,7 +226,7 @@ public class AnnotationConfigContextLoader extends AbstractGenericContextLoader
}
/**
* <code>AnnotationConfigContextLoader</code> should be used as a
* <code>AnnotationConfigContextLoader</code> should be used as a
* {@link org.springframework.test.context.SmartContextLoader SmartContextLoader},
* not as a legacy {@link org.springframework.test.context.ContextLoader ContextLoader}.
* Consequently, this method is not supported.