Skip to content

Commit 2afaaf2

Browse files
committed
Polishing
1 parent d9bc3b7 commit 2afaaf2

File tree

8 files changed

+36
-33
lines changed

8 files changed

+36
-33
lines changed

spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -298,9 +298,9 @@ else if (StringUtils.hasText(operation.getCacheManager())) {
298298
* @param expectedType type for the bean
299299
* @return the bean matching that name
300300
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException if such bean does not exist
301-
* @see CacheOperation#keyGenerator
302-
* @see CacheOperation#cacheManager
303-
* @see CacheOperation#cacheResolver
301+
* @see CacheOperation#getKeyGenerator()
302+
* @see CacheOperation#getCacheManager()
303+
* @see CacheOperation#getCacheResolver()
304304
*/
305305
protected <T> T getBean(String beanName, Class<T> expectedType) {
306306
return BeanFactoryAnnotationUtils.qualifiedBeanOfType(this.beanFactory, expectedType, beanName);
@@ -329,8 +329,8 @@ protected Object execute(CacheOperationInvoker invoker, Object target, Method me
329329

330330
/**
331331
* Execute the underlying operation (typically in case of cache miss) and return
332-
* the result of the invocation. If an exception occurs it will be wrapped in
333-
* a {@link CacheOperationInvoker.ThrowableWrapper}: the exception can be handled
332+
* the result of the invocation. If an exception occurs it will be wrapped in a
333+
* {@link CacheOperationInvoker.ThrowableWrapper}: the exception can be handled
334334
* or modified but it <em>must</em> be wrapped in a
335335
* {@link CacheOperationInvoker.ThrowableWrapper} as well.
336336
* @param invoker the invoker handling the operation being cached

spring-context/src/main/java/org/springframework/cache/interceptor/CacheOperationSource.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -25,13 +25,14 @@
2525
* source level, or elsewhere.
2626
*
2727
* @author Costin Leau
28+
* @author Juergen Hoeller
2829
* @since 3.1
2930
*/
3031
public interface CacheOperationSource {
3132

3233
/**
33-
* Return the collection of cache operations for this method, or {@code null}
34-
* if the method contains no <em>cacheable</em> annotations.
34+
* Return the collection of cache operations for this method,
35+
* or {@code null} if the method contains no <em>cacheable</em> annotations.
3536
* @param method the method to introspect
3637
* @param targetClass the target class (may be {@code null}, in which case
3738
* the declaring class of the method must be used)

spring-context/src/main/java/org/springframework/cache/interceptor/CompositeCacheOperationSource.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -28,6 +28,7 @@
2828
* over a given array of {@code CacheOperationSource} instances.
2929
*
3030
* @author Costin Leau
31+
* @author Juergen Hoeller
3132
* @since 3.1
3233
*/
3334
@SuppressWarnings("serial")
@@ -41,7 +42,7 @@ public class CompositeCacheOperationSource implements CacheOperationSource, Seri
4142
* @param cacheOperationSources the CacheOperationSource instances to combine
4243
*/
4344
public CompositeCacheOperationSource(CacheOperationSource... cacheOperationSources) {
44-
Assert.notEmpty(cacheOperationSources, "cacheOperationSources array must not be empty");
45+
Assert.notEmpty(cacheOperationSources, "CacheOperationSource array must not be empty");
4546
this.cacheOperationSources = cacheOperationSources;
4647
}
4748

@@ -53,20 +54,20 @@ public final CacheOperationSource[] getCacheOperationSources() {
5354
return this.cacheOperationSources;
5455
}
5556

57+
5658
@Override
5759
public Collection<CacheOperation> getCacheOperations(Method method, Class<?> targetClass) {
5860
Collection<CacheOperation> ops = null;
59-
6061
for (CacheOperationSource source : this.cacheOperationSources) {
6162
Collection<CacheOperation> cacheOperations = source.getCacheOperations(method, targetClass);
6263
if (cacheOperations != null) {
6364
if (ops == null) {
6465
ops = new ArrayList<CacheOperation>();
6566
}
66-
6767
ops.addAll(cacheOperations);
6868
}
6969
}
7070
return ops;
7171
}
72+
7273
}

spring-context/src/main/java/org/springframework/scripting/support/StandardScriptFactory.java

Lines changed: 3 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-2019 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,7 +33,7 @@
3333
/**
3434
* {@link org.springframework.scripting.ScriptFactory} implementation based
3535
* on the JSR-223 script engine abstraction (as included in Java 6+).
36-
* Supports JavaScript, Groovy, JRuby and other JSR-223 compliant engines.
36+
* Supports JavaScript, Groovy, JRuby, and other JSR-223 compliant engines.
3737
*
3838
* <p>Typically used in combination with a
3939
* {@link org.springframework.scripting.support.ScriptFactoryPostProcessor};
@@ -140,6 +140,7 @@ public Object getScriptedObject(ScriptSource scriptSource, Class<?>... actualInt
140140
if (script instanceof Class ? !requestedIfc.isAssignableFrom((Class<?>) script) :
141141
!requestedIfc.isInstance(script)) {
142142
adaptationRequired = true;
143+
break;
143144
}
144145
}
145146
if (adaptationRequired) {

spring-jdbc/src/main/java/org/springframework/jdbc/object/RdbmsOperation.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -116,7 +116,7 @@ public void setDataSource(DataSource dataSource) {
116116
* large result sets: Setting this higher than the default value will increase
117117
* processing speed at the cost of memory consumption; setting this lower can
118118
* avoid transferring row data that will never be read by the application.
119-
* <p>Default is 0, indicating to use the driver's default.
119+
* <p>Default is -1, indicating to use the driver's default.
120120
* @see org.springframework.jdbc.core.JdbcTemplate#setFetchSize
121121
*/
122122
public void setFetchSize(int fetchSize) {
@@ -127,7 +127,7 @@ public void setFetchSize(int fetchSize) {
127127
* Set the maximum number of rows for this RDBMS operation. This is important
128128
* for processing subsets of large result sets, avoiding to read and hold
129129
* the entire result set in the database or in the JDBC driver.
130-
* <p>Default is 0, indicating to use the driver's default.
130+
* <p>Default is -1, indicating to use the driver's default.
131131
* @see org.springframework.jdbc.core.JdbcTemplate#setMaxRows
132132
*/
133133
public void setMaxRows(int maxRows) {
@@ -136,7 +136,7 @@ public void setMaxRows(int maxRows) {
136136

137137
/**
138138
* Set the query timeout for statements that this RDBMS operation executes.
139-
* <p>Default is 0, indicating to use the JDBC driver's default.
139+
* <p>Default is -1, indicating to use the JDBC driver's default.
140140
* <p>Note: Any timeout specified here will be overridden by the remaining
141141
* transaction timeout when executing within a transaction that has a
142142
* timeout specified at the transaction level.

spring-tx/src/main/java/org/springframework/transaction/interceptor/CompositeTransactionAttributeSource.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -38,7 +38,7 @@ public class CompositeTransactionAttributeSource implements TransactionAttribute
3838
* Create a new CompositeTransactionAttributeSource for the given sources.
3939
* @param transactionAttributeSources the TransactionAttributeSource instances to combine
4040
*/
41-
public CompositeTransactionAttributeSource(TransactionAttributeSource[] transactionAttributeSources) {
41+
public CompositeTransactionAttributeSource(TransactionAttributeSource... transactionAttributeSources) {
4242
Assert.notNull(transactionAttributeSources, "TransactionAttributeSource array must not be null");
4343
this.transactionAttributeSources = transactionAttributeSources;
4444
}
@@ -54,10 +54,10 @@ public final TransactionAttributeSource[] getTransactionAttributeSources() {
5454

5555
@Override
5656
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
57-
for (TransactionAttributeSource tas : this.transactionAttributeSources) {
58-
TransactionAttribute ta = tas.getTransactionAttribute(method, targetClass);
59-
if (ta != null) {
60-
return ta;
57+
for (TransactionAttributeSource source : this.transactionAttributeSources) {
58+
TransactionAttribute attr = source.getTransactionAttribute(method, targetClass);
59+
if (attr != null) {
60+
return attr;
6161
}
6262
}
6363
return null;

spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSource.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -25,6 +25,7 @@
2525
* metadata attributes at source level (such as Java 5 annotations), or anywhere else.
2626
*
2727
* @author Rod Johnson
28+
* @author Juergen Hoeller
2829
* @since 15.04.2003
2930
* @see TransactionInterceptor#setTransactionAttributeSource
3031
* @see TransactionProxyFactoryBean#setTransactionAttributeSource
@@ -36,10 +37,9 @@ public interface TransactionAttributeSource {
3637
* Return the transaction attribute for the given method,
3738
* or {@code null} if the method is non-transactional.
3839
* @param method the method to introspect
39-
* @param targetClass the target class. May be {@code null},
40-
* in which case the declaring class of the method must be used.
41-
* @return TransactionAttribute the matching transaction attribute,
42-
* or {@code null} if none found
40+
* @param targetClass the target class (may be {@code null},
41+
* in which case the declaring class of the method must be used)
42+
* @return the matching transaction attribute, or {@code null} if none found
4343
*/
4444
TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass);
4545

spring-web/src/main/java/org/springframework/http/server/ServerHttpRequest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2019 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,8 +33,8 @@ public interface ServerHttpRequest extends HttpRequest, HttpInputMessage {
3333

3434
/**
3535
* Return a {@link java.security.Principal} instance containing the name of the
36-
* authenticated user. If the user has not been authenticated, the method returns
37-
* <code>null</code>.
36+
* authenticated user.
37+
* <p>If the user has not been authenticated, the method returns <code>null</code>.
3838
*/
3939
Principal getPrincipal();
4040

0 commit comments

Comments
 (0)