Skip to content

Commit 9d0e62e

Browse files
committed
Javadoc format and related polishing
1 parent 3dd6c19 commit 9d0e62e

File tree

28 files changed

+210
-238
lines changed

28 files changed

+210
-238
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.
@@ -34,6 +34,7 @@
3434
* for detailed instructions.
3535
*
3636
* @author Chris Beams
37+
* @author Stephane Nicoll
3738
* @since 3.1
3839
* @see EnableCaching
3940
* @see CachingConfigurerSupport
@@ -69,8 +70,8 @@ public interface CachingConfigurer {
6970
* Return the {@link CacheResolver} bean to use to resolve regular caches for
7071
* annotation-driven cache management. This is an alternative and more powerful
7172
* option of specifying the {@link CacheManager} to use.
72-
* <p>If both a {@link #cacheManager()} and {@link #cacheResolver()} are set, the
73-
* cache manager is ignored.
73+
* <p>If both a {@link #cacheManager()} and {@code #cacheResolver()} are set,
74+
* the cache manager is ignored.
7475
* <p>Implementations must explicitly declare
7576
* {@link org.springframework.context.annotation.Bean @Bean}, e.g.
7677
* <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-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.
@@ -185,7 +185,7 @@ protected void processProperties(ConfigurableListableBeanFactory beanFactoryToPr
185185
/**
186186
* Implemented for compatibility with {@link org.springframework.beans.factory.config.PlaceholderConfigurerSupport}.
187187
* @deprecated in favor of {@link #processProperties(ConfigurableListableBeanFactory, ConfigurablePropertyResolver)}
188-
* @throws UnsupportedOperationException
188+
* @throws UnsupportedOperationException in this implementation
189189
*/
190190
@Override
191191
@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-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.
@@ -58,7 +58,7 @@ public void setValues(PreparedStatement ps) throws SQLException {
5858
* @param ps the PreparedStatement
5959
* @param parameterPosition index of the parameter position
6060
* @param argValue the value to set
61-
* @throws SQLException
61+
* @throws SQLException if thrown by PreparedStatement methods
6262
*/
6363
protected void doSetValue(PreparedStatement ps, int parameterPosition, Object argValue) throws SQLException {
6464
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-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.
@@ -92,7 +92,7 @@ public void setValues(PreparedStatement ps) throws SQLException {
9292
* @param parameterPosition index of the parameter position
9393
* @param argType the argument type
9494
* @param argValue the argument value
95-
* @throws SQLException
95+
* @throws SQLException if thrown by PreparedStatement methods
9696
*/
9797
protected void doSetValue(PreparedStatement ps, int parameterPosition, int argType, Object argValue)
9898
throws SQLException {

spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/SqlParameterSourceUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public abstract class SqlParameterSourceUtils {
4242
* @return an array of {@link SqlParameterSource}
4343
* @see MapSqlParameterSource
4444
* @see BeanPropertySqlParameterSource
45-
* @see NamedParameterJdbcTemplate#batchUpdate(String, SqlParameterSource[]))
45+
* @see NamedParameterJdbcTemplate#batchUpdate(String, SqlParameterSource[])
4646
*/
4747
@SuppressWarnings("unchecked")
4848
public static SqlParameterSource[] createBatch(Object... candidates) {
@@ -58,7 +58,7 @@ public static SqlParameterSource[] createBatch(Object... candidates) {
5858
* @since 5.0.2
5959
* @see MapSqlParameterSource
6060
* @see BeanPropertySqlParameterSource
61-
* @see NamedParameterJdbcTemplate#batchUpdate(String, SqlParameterSource[]))
61+
* @see NamedParameterJdbcTemplate#batchUpdate(String, SqlParameterSource[])
6262
*/
6363
@SuppressWarnings("unchecked")
6464
public static SqlParameterSource[] createBatch(Collection<?> candidates) {

spring-orm/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.
@@ -133,7 +133,7 @@ static FlushMode getFlushMode(Session session) {
133133
* {@link PersistenceException} wrappers accordingly.
134134
* @param session the Hibernate Session to flush
135135
* @param synch whether this flush is triggered by transaction synchronization
136-
* @throws DataAccessException
136+
* @throws DataAccessException in case of flush failures
137137
* @since 4.3.2
138138
*/
139139
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.
@@ -54,7 +54,7 @@ public interface ContextCache {
5454
String CONTEXT_CACHE_LOGGING_CATEGORY = "org.springframework.test.context.cache";
5555

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

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-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.
@@ -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: 37 additions & 33 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.
@@ -67,6 +67,7 @@
6767
* not result in an exception.
6868
*
6969
* @author Sam Brannen
70+
* @author Phillip Webb
7071
* @since 3.2
7172
* @see SmartContextLoader
7273
*/
@@ -86,16 +87,13 @@ public abstract class AbstractDelegatingSmartContextLoader implements SmartConte
8687
*/
8788
protected abstract SmartContextLoader getAnnotationConfigLoader();
8889

89-
// --- SmartContextLoader --------------------------------------------------
9090

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

9593
private static void delegateProcessing(SmartContextLoader loader, ContextConfigurationAttributes configAttributes) {
9694
if (logger.isDebugEnabled()) {
97-
logger.debug(String.format("Delegating to %s to process context configuration %s.", name(loader),
98-
configAttributes));
95+
logger.debug(String.format("Delegating to %s to process context configuration %s.",
96+
name(loader), configAttributes));
9997
}
10098
loader.processContextConfiguration(configAttributes);
10199
}
@@ -111,10 +109,10 @@ private static ApplicationContext delegateLoading(SmartContextLoader loader, Mer
111109

112110
private boolean supports(SmartContextLoader loader, MergedContextConfiguration mergedConfig) {
113111
if (loader == getAnnotationConfigLoader()) {
114-
return mergedConfig.hasClasses() && !mergedConfig.hasLocations();
112+
return (mergedConfig.hasClasses() && !mergedConfig.hasLocations());
115113
}
116114
else {
117-
return mergedConfig.hasLocations() && !mergedConfig.hasClasses();
115+
return (mergedConfig.hasLocations() && !mergedConfig.hasClasses());
118116
}
119117
}
120118

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

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

@@ -188,9 +186,8 @@ else if (configAttributes.hasClasses()) {
188186

189187
if (configAttributes.hasClasses()) {
190188
if (logger.isInfoEnabled()) {
191-
logger.info(String.format(
192-
"%s detected default configuration classes for context configuration %s.",
193-
name(getAnnotationConfigLoader()), configAttributes));
189+
logger.info(String.format("%s detected default configuration classes for context configuration %s.",
190+
name(getAnnotationConfigLoader()), configAttributes));
194191
}
195192
}
196193

@@ -199,12 +196,12 @@ else if (configAttributes.hasClasses()) {
199196
name(getAnnotationConfigLoader()), configAttributes));
200197

201198
if (configAttributes.hasLocations() && configAttributes.hasClasses()) {
202-
String message = String.format(
203-
"Configuration error: both default locations AND default configuration classes "
204-
+ "were detected for context configuration %s; configure one or the other, but not both.",
205-
configAttributes);
206-
logger.error(message);
207-
throw new IllegalStateException(message);
199+
String msg = String.format(
200+
"Configuration error: both default locations AND default configuration classes " +
201+
"were detected for context configuration %s; configure one or the other, but not both.",
202+
configAttributes);
203+
logger.error(msg);
204+
throw new IllegalStateException(msg);
208205
}
209206
}
210207
}
@@ -235,8 +232,8 @@ public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) t
235232
List<SmartContextLoader> candidates = Arrays.asList(getXmlLoader(), getAnnotationConfigLoader());
236233

237234
Assert.state(!(mergedConfig.hasLocations() && mergedConfig.hasClasses()), () -> String.format(
238-
"Neither %s nor %s supports loading an ApplicationContext from %s: "
239-
+ "declare either 'locations' or 'classes' but not both.", name(getXmlLoader()),
235+
"Neither %s nor %s supports loading an ApplicationContext from %s: " +
236+
"declare either 'locations' or 'classes' but not both.", name(getXmlLoader()),
240237
name(getAnnotationConfigLoader()), mergedConfig));
241238

242239
for (SmartContextLoader loader : candidates) {
@@ -256,34 +253,41 @@ public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) t
256253

257254
// else...
258255
throw new IllegalStateException(String.format(
259-
"Neither %s nor %s was able to load an ApplicationContext from %s.", name(getXmlLoader()),
260-
name(getAnnotationConfigLoader()), mergedConfig));
256+
"Neither %s nor %s was able to load an ApplicationContext from %s.", name(getXmlLoader()),
257+
name(getAnnotationConfigLoader()), mergedConfig));
261258
}
262259

263-
// --- ContextLoader -------------------------------------------------------
260+
private static String name(SmartContextLoader loader) {
261+
return loader.getClass().getSimpleName();
262+
}
263+
264+
265+
// ContextLoader
264266

265267
/**
266268
* {@code AbstractDelegatingSmartContextLoader} does not support the
267269
* {@link ContextLoader#processLocations(Class, String...)} method. Call
268270
* {@link #processContextConfiguration(ContextConfigurationAttributes)} instead.
269-
* @throws UnsupportedOperationException
271+
* @throws UnsupportedOperationException in this implementation
270272
*/
271273
@Override
272274
public final String[] processLocations(Class<?> clazz, @Nullable String... locations) {
273-
throw new UnsupportedOperationException("DelegatingSmartContextLoaders do not support the ContextLoader SPI. "
274-
+ "Call processContextConfiguration(ContextConfigurationAttributes) instead.");
275+
throw new UnsupportedOperationException(
276+
"DelegatingSmartContextLoaders do not support the ContextLoader SPI. " +
277+
"Call processContextConfiguration(ContextConfigurationAttributes) instead.");
275278
}
276279

277280
/**
278281
* {@code AbstractDelegatingSmartContextLoader} does not support the
279282
* {@link ContextLoader#loadContext(String...) } method. Call
280283
* {@link #loadContext(MergedContextConfiguration)} instead.
281-
* @throws UnsupportedOperationException
284+
* @throws UnsupportedOperationException in this implementation
282285
*/
283286
@Override
284287
public final ApplicationContext loadContext(String... locations) throws Exception {
285-
throw new UnsupportedOperationException("DelegatingSmartContextLoaders do not support the ContextLoader SPI. "
286-
+ "Call loadContext(MergedContextConfiguration) instead.");
288+
throw new UnsupportedOperationException(
289+
"DelegatingSmartContextLoaders do not support the ContextLoader SPI. " +
290+
"Call loadContext(MergedContextConfiguration) instead.");
287291
}
288292

289293
}

0 commit comments

Comments
 (0)