Skip to content

Commit 4ccf33e

Browse files
committed
Javadoc format and related polishing
(cherry picked from commit 9d0e62e)
1 parent 5eebe94 commit 4ccf33e

File tree

22 files changed

+190
-211
lines changed

22 files changed

+190
-211
lines changed

spring-context/src/main/java/org/springframework/cache/annotation/CachingConfigurer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@
3333
* for detailed instructions.
3434
*
3535
* @author Chris Beams
36+
* @author Stephane Nicoll
3637
* @since 3.1
3738
* @see EnableCaching
3839
* @see CachingConfigurerSupport
@@ -67,8 +68,8 @@ public interface CachingConfigurer {
6768
* Return the {@link CacheResolver} bean to use to resolve regular caches for
6869
* annotation-driven cache management. This is an alternative and more powerful
6970
* option of specifying the {@link CacheManager} to use.
70-
* <p>If both a {@link #cacheManager()} and {@link #cacheResolver()} are set, the
71-
* cache manager is ignored.
71+
* <p>If both a {@link #cacheManager()} and {@code #cacheResolver()} are set,
72+
* the cache manager is ignored.
7273
* <p>Implementations must explicitly declare
7374
* {@link org.springframework.context.annotation.Bean @Bean}, e.g.
7475
* <pre class="code">

spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -183,7 +183,7 @@ public String resolveStringValue(String strVal) {
183183
/**
184184
* Implemented for compatibility with {@link org.springframework.beans.factory.config.PlaceholderConfigurerSupport}.
185185
* @deprecated in favor of {@link #processProperties(ConfigurableListableBeanFactory, ConfigurablePropertyResolver)}
186-
* @throws UnsupportedOperationException
186+
* @throws UnsupportedOperationException in this implementation
187187
*/
188188
@Override
189189
@Deprecated

spring-jdbc/src/main/java/org/springframework/jdbc/core/ArgumentPreparedStatementSetter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -55,7 +55,7 @@ public void setValues(PreparedStatement ps) throws SQLException {
5555
* @param ps the PreparedStatement
5656
* @param parameterPosition index of the parameter position
5757
* @param argValue the value to set
58-
* @throws SQLException
58+
* @throws SQLException if thrown by PreparedStatement methods
5959
*/
6060
protected void doSetValue(PreparedStatement ps, int parameterPosition, Object argValue) throws SQLException {
6161
if (argValue instanceof SqlParameterValue) {

spring-jdbc/src/main/java/org/springframework/jdbc/core/ArgumentTypePreparedStatementSetter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -89,7 +89,7 @@ public void setValues(PreparedStatement ps) throws SQLException {
8989
* @param parameterPosition index of the parameter position
9090
* @param argType the argument type
9191
* @param argValue the argument value
92-
* @throws SQLException
92+
* @throws SQLException if thrown by PreparedStatement methods
9393
*/
9494
protected void doSetValue(PreparedStatement ps, int parameterPosition, int argType, Object argValue)
9595
throws SQLException {

spring-orm-hibernate5/src/main/java/org/springframework/orm/hibernate5/SessionFactoryUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -130,7 +130,7 @@ static FlushMode getFlushMode(Session session) {
130130
* {@link PersistenceException} wrappers accordingly.
131131
* @param session the Hibernate Session to flush
132132
* @param synch whether this flush is triggered by transaction synchronization
133-
* @throws DataAccessException
133+
* @throws DataAccessException in case of flush failures
134134
* @since 4.3.2
135135
*/
136136
static void flush(Session session, boolean synch) throws DataAccessException {

spring-test/src/main/java/org/springframework/test/annotation/IfProfileValue.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -109,15 +109,15 @@
109109
/**
110110
* A single, permissible {@code value} of the <em>profile value</em>
111111
* for the given {@link #name}.
112-
* <p>Note: Assigning values to both {@link #value} and {@link #values}
112+
* <p>Note: Assigning values to both {@code #value} and {@link #values}
113113
* will lead to a configuration conflict.
114114
*/
115115
String value() default "";
116116

117117
/**
118118
* A list of all permissible {@code values} of the <em>profile value</em>
119119
* for the given {@link #name}.
120-
* <p>Note: Assigning values to both {@link #value} and {@link #values}
120+
* <p>Note: Assigning values to both {@link #value} and {@code #values}
121121
* will lead to a configuration conflict.
122122
*/
123123
String[] values() default {};

spring-test/src/main/java/org/springframework/test/context/cache/ContextCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ public interface ContextCache {
5353
String CONTEXT_CACHE_LOGGING_CATEGORY = "org.springframework.test.context.cache";
5454

5555
/**
56-
* The default maximum size of the context cache: {@value #DEFAULT_MAX_CONTEXT_CACHE_SIZE}.
56+
* The default maximum size of the context cache: {@value}.
5757
* @since 4.3
5858
* @see #MAX_CONTEXT_CACHE_SIZE_PROPERTY_NAME
5959
*/

spring-test/src/main/java/org/springframework/test/context/support/AbstractContextLoader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -72,7 +72,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
7272
private static final Log logger = LogFactory.getLog(AbstractContextLoader.class);
7373

7474

75-
// --- SmartContextLoader -----------------------------------------------
75+
// SmartContextLoader
7676

7777
/**
7878
* For backwards compatibility with the {@link ContextLoader} SPI, the
@@ -189,7 +189,7 @@ protected void customizeContext(ConfigurableApplicationContext context, MergedCo
189189
}
190190

191191

192-
// --- ContextLoader -------------------------------------------------------
192+
// ContextLoader
193193

194194
/**
195195
* If the supplied {@code locations} are {@code null} or <em>empty</em>

spring-test/src/main/java/org/springframework/test/context/support/AbstractDelegatingSmartContextLoader.java

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -66,6 +66,7 @@
6666
* not result in an exception.
6767
*
6868
* @author Sam Brannen
69+
* @author Phillip Webb
6970
* @since 3.2
7071
* @see SmartContextLoader
7172
*/
@@ -85,16 +86,13 @@ public abstract class AbstractDelegatingSmartContextLoader implements SmartConte
8586
*/
8687
protected abstract SmartContextLoader getAnnotationConfigLoader();
8788

88-
// --- SmartContextLoader --------------------------------------------------
8989

90-
private static String name(SmartContextLoader loader) {
91-
return loader.getClass().getSimpleName();
92-
}
90+
// SmartContextLoader
9391

9492
private static void delegateProcessing(SmartContextLoader loader, ContextConfigurationAttributes configAttributes) {
9593
if (logger.isDebugEnabled()) {
96-
logger.debug(String.format("Delegating to %s to process context configuration %s.", name(loader),
97-
configAttributes));
94+
logger.debug(String.format("Delegating to %s to process context configuration %s.",
95+
name(loader), configAttributes));
9896
}
9997
loader.processContextConfiguration(configAttributes);
10098
}
@@ -110,10 +108,10 @@ private static ApplicationContext delegateLoading(SmartContextLoader loader, Mer
110108

111109
private boolean supports(SmartContextLoader loader, MergedContextConfiguration mergedConfig) {
112110
if (loader == getAnnotationConfigLoader()) {
113-
return mergedConfig.hasClasses() && !mergedConfig.hasLocations();
111+
return (mergedConfig.hasClasses() && !mergedConfig.hasLocations());
114112
}
115113
else {
116-
return mergedConfig.hasLocations() && !mergedConfig.hasClasses();
114+
return (mergedConfig.hasLocations() && !mergedConfig.hasClasses());
117115
}
118116
}
119117

@@ -152,8 +150,8 @@ private boolean supports(SmartContextLoader loader, MergedContextConfiguration m
152150
public void processContextConfiguration(final ContextConfigurationAttributes configAttributes) {
153151
Assert.notNull(configAttributes, "configAttributes must not be null");
154152
Assert.isTrue(!(configAttributes.hasLocations() && configAttributes.hasClasses()), String.format(
155-
"Cannot process locations AND classes for context configuration %s: "
156-
+ "configure one or the other, but not both.", configAttributes));
153+
"Cannot process locations AND classes for context configuration %s: " +
154+
"configure one or the other, but not both.", configAttributes));
157155

158156
// If the original locations or classes were not empty, there's no
159157
// need to bother with default detection checks; just let the
@@ -174,14 +172,14 @@ else if (configAttributes.hasClasses()) {
174172
if (xmlLoaderDetectedDefaults) {
175173
if (logger.isInfoEnabled()) {
176174
logger.info(String.format("%s detected default locations for context configuration %s.",
177-
name(getXmlLoader()), configAttributes));
175+
name(getXmlLoader()), configAttributes));
178176
}
179177
}
180178

181179
if (configAttributes.hasClasses()) {
182180
throw new IllegalStateException(String.format(
183-
"%s should NOT have detected default configuration classes for context configuration %s.",
184-
name(getXmlLoader()), configAttributes));
181+
"%s should NOT have detected default configuration classes for context configuration %s.",
182+
name(getXmlLoader()), configAttributes));
185183
}
186184

187185
// Now let the annotation config loader process the configuration.
@@ -190,24 +188,24 @@ else if (configAttributes.hasClasses()) {
190188
if (configAttributes.hasClasses()) {
191189
if (logger.isInfoEnabled()) {
192190
logger.info(String.format(
193-
"%s detected default configuration classes for context configuration %s.",
194-
name(getAnnotationConfigLoader()), configAttributes));
191+
"%s detected default configuration classes for context configuration %s.",
192+
name(getAnnotationConfigLoader()), configAttributes));
195193
}
196194
}
197195

198196
if (!xmlLoaderDetectedDefaults && configAttributes.hasLocations()) {
199197
throw new IllegalStateException(String.format(
200-
"%s should NOT have detected default locations for context configuration %s.",
201-
name(getAnnotationConfigLoader()), configAttributes));
198+
"%s should NOT have detected default locations for context configuration %s.",
199+
name(getAnnotationConfigLoader()), configAttributes));
202200
}
203201

204202
if (configAttributes.hasLocations() && configAttributes.hasClasses()) {
205-
String message = String.format(
206-
"Configuration error: both default locations AND default configuration classes "
207-
+ "were detected for context configuration %s; configure one or the other, but not both.",
208-
configAttributes);
209-
logger.error(message);
210-
throw new IllegalStateException(message);
203+
String msg = String.format(
204+
"Configuration error: both default locations AND default configuration classes " +
205+
"were detected for context configuration %s; configure one or the other, but not both.",
206+
configAttributes);
207+
logger.error(msg);
208+
throw new IllegalStateException(msg);
211209
}
212210
}
213211
}
@@ -239,9 +237,9 @@ public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) t
239237

240238
if (mergedConfig.hasLocations() && mergedConfig.hasClasses()) {
241239
throw new IllegalStateException(String.format(
242-
"Neither %s nor %s supports loading an ApplicationContext from %s: "
243-
+ "declare either 'locations' or 'classes' but not both.", name(getXmlLoader()),
244-
name(getAnnotationConfigLoader()), mergedConfig));
240+
"Neither %s nor %s supports loading an ApplicationContext from %s: " +
241+
"declare either 'locations' or 'classes' but not both.", name(getXmlLoader()),
242+
name(getAnnotationConfigLoader()), mergedConfig));
245243
}
246244

247245
for (SmartContextLoader loader : candidates) {
@@ -261,22 +259,28 @@ public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) t
261259

262260
// else...
263261
throw new IllegalStateException(String.format(
264-
"Neither %s nor %s was able to load an ApplicationContext from %s.", name(getXmlLoader()),
265-
name(getAnnotationConfigLoader()), mergedConfig));
262+
"Neither %s nor %s was able to load an ApplicationContext from %s.", name(getXmlLoader()),
263+
name(getAnnotationConfigLoader()), mergedConfig));
266264
}
267265

268-
// --- ContextLoader -------------------------------------------------------
266+
private static String name(SmartContextLoader loader) {
267+
return loader.getClass().getSimpleName();
268+
}
269+
270+
271+
// ContextLoader
269272

270273
/**
271274
* {@code AbstractDelegatingSmartContextLoader} does not support the
272275
* {@link ContextLoader#processLocations(Class, String...)} method. Call
273276
* {@link #processContextConfiguration(ContextConfigurationAttributes)} instead.
274-
* @throws UnsupportedOperationException
277+
* @throws UnsupportedOperationException in this implementation
275278
*/
276279
@Override
277280
public final String[] processLocations(Class<?> clazz, String... locations) {
278-
throw new UnsupportedOperationException("DelegatingSmartContextLoaders do not support the ContextLoader SPI. "
279-
+ "Call processContextConfiguration(ContextConfigurationAttributes) instead.");
281+
throw new UnsupportedOperationException(
282+
"DelegatingSmartContextLoaders do not support the ContextLoader SPI. " +
283+
"Call processContextConfiguration(ContextConfigurationAttributes) instead.");
280284
}
281285

282286
/**
@@ -287,8 +291,9 @@ public final String[] processLocations(Class<?> clazz, String... locations) {
287291
*/
288292
@Override
289293
public final ApplicationContext loadContext(String... locations) throws Exception {
290-
throw new UnsupportedOperationException("DelegatingSmartContextLoaders do not support the ContextLoader SPI. "
291-
+ "Call loadContext(MergedContextConfiguration) instead.");
294+
throw new UnsupportedOperationException(
295+
"DelegatingSmartContextLoaders do not support the ContextLoader SPI. " +
296+
"Call loadContext(MergedContextConfiguration) instead.");
292297
}
293298

294299
}

0 commit comments

Comments
 (0)