Skip to content

Commit 572c668

Browse files
committed
Polishing
1 parent 5520e73 commit 572c668

File tree

11 files changed

+110
-109
lines changed

11 files changed

+110
-109
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class CacheProxyFactoryBean extends AbstractSingletonProxyFactoryBean
5454

5555

5656
/**
57-
* Set the sources used to find cache operations.
57+
* Set one or more sources to find cache operations.
5858
* @see CacheInterceptor#setCacheOperationSources
5959
*/
6060
public void setCacheOperationSources(CacheOperationSource... cacheOperationSources) {
@@ -95,9 +95,9 @@ public void setCacheManager(CacheManager cacheManager) {
9595
}
9696

9797
/**
98-
* Set a pointcut, i.e a bean that can cause conditional invocation
99-
* of the CacheInterceptor depending on method and attributes passed.
100-
* Note: Additional interceptors are always invoked.
98+
* Set a pointcut, i.e. a bean that triggers conditional invocation of the
99+
* {@link CacheInterceptor} depending on the method and attributes passed.
100+
* <p>Note: Additional interceptors are always invoked.
101101
* @see #setPreInterceptors
102102
* @see #setPostInterceptors
103103
*/

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@
8585
* @see ResourceBundleMessageSource
8686
* @see java.util.ResourceBundle
8787
*/
88-
public class ReloadableResourceBundleMessageSource extends AbstractResourceBasedMessageSource implements ResourceLoaderAware {
88+
public class ReloadableResourceBundleMessageSource extends AbstractResourceBasedMessageSource
89+
implements ResourceLoaderAware {
8990

9091
private static final String PROPERTIES_SUFFIX = ".properties";
9192

@@ -101,13 +102,13 @@ public class ReloadableResourceBundleMessageSource extends AbstractResourceBased
101102

102103
private ResourceLoader resourceLoader = new DefaultResourceLoader();
103104

104-
/** Cache to hold filename lists per Locale */
105+
// Cache to hold filename lists per Locale
105106
private final ConcurrentMap<String, Map<Locale, List<String>>> cachedFilenames = new ConcurrentHashMap<>();
106107

107-
/** Cache to hold already loaded properties per filename */
108+
// Cache to hold already loaded properties per filename
108109
private final ConcurrentMap<String, PropertiesHolder> cachedProperties = new ConcurrentHashMap<>();
109110

110-
/** Cache to hold merged loaded properties per locale */
111+
// Cache to hold already loaded properties per filename
111112
private final ConcurrentMap<Locale, PropertiesHolder> cachedMergedProperties = new ConcurrentHashMap<>();
112113

113114

spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ public static class GenericBroadcasterImpl implements Broadcaster {
741741
}
742742

743743

744-
@SuppressWarnings({ "unused", "unchecked" })
744+
@SuppressWarnings({"unused", "unchecked"})
745745
public static abstract class GenericEventBroadcasterImpl<T extends Event>
746746
extends GenericBroadcasterImpl implements EventBroadcaster {
747747

spring-expression/src/main/java/org/springframework/expression/spel/ast/FunctionReference.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ public TypedValue getValueInternal(ExpressionState state) throws EvaluationExcep
7272
if (value == TypedValue.NULL) {
7373
throw new SpelEvaluationException(getStartPosition(), SpelMessage.FUNCTION_NOT_DEFINED, this.name);
7474
}
75-
76-
// Two possibilities: a lambda function or a Java static method registered as a function
7775
if (!(value.getValue() instanceof Method)) {
76+
// Two possibilities: a lambda function or a Java static method registered as a function
7877
throw new SpelEvaluationException(
7978
SpelMessage.FUNCTION_REFERENCE_CANNOT_BE_INVOKED, this.name, value.getClass());
8079
}
@@ -98,11 +97,13 @@ public TypedValue getValueInternal(ExpressionState state) throws EvaluationExcep
9897
private TypedValue executeFunctionJLRMethod(ExpressionState state, Method method) throws EvaluationException {
9998
Object[] functionArgs = getArguments(state);
10099

101-
if (!method.isVarArgs() && method.getParameterCount() != functionArgs.length) {
102-
throw new SpelEvaluationException(SpelMessage.INCORRECT_NUMBER_OF_ARGUMENTS_TO_FUNCTION,
103-
functionArgs.length, method.getParameterCount());
100+
if (!method.isVarArgs()) {
101+
int declaredParamCount = method.getParameterCount();
102+
if (declaredParamCount != functionArgs.length) {
103+
throw new SpelEvaluationException(SpelMessage.INCORRECT_NUMBER_OF_ARGUMENTS_TO_FUNCTION,
104+
functionArgs.length, declaredParamCount);
105+
}
104106
}
105-
// Only static methods can be called in this way
106107
if (!Modifier.isStatic(method.getModifiers())) {
107108
throw new SpelEvaluationException(getStartPosition(),
108109
SpelMessage.FUNCTION_MUST_BE_STATIC, ClassUtils.getQualifiedMethodName(method), this.name);

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

Lines changed: 5 additions & 5 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.
@@ -36,18 +36,18 @@
3636
*/
3737
public class SqlParameter {
3838

39-
/** The name of the parameter, if any */
39+
// The name of the parameter, if any
4040
@Nullable
4141
private String name;
4242

43-
/** SQL type constant from {@code java.sql.Types} */
43+
// SQL type constant from {@code java.sql.Types}
4444
private final int sqlType;
4545

46-
/** Used for types that are user-named like: STRUCT, DISTINCT, JAVA_OBJECT, named array types */
46+
// Used for types that are user-named like: STRUCT, DISTINCT, JAVA_OBJECT, named array types
4747
@Nullable
4848
private String typeName;
4949

50-
/** The scale to apply in case of a NUMERIC or DECIMAL type, if any */
50+
// The scale to apply in case of a NUMERIC or DECIMAL type, if any
5151
@Nullable
5252
private Integer scale;
5353

spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,47 +53,47 @@
5353
*/
5454
public class CallMetaDataContext {
5555

56-
/** Logger available to subclasses */
56+
// Logger available to subclasses
5757
protected final Log logger = LogFactory.getLog(getClass());
5858

59-
/** Name of procedure to call **/
59+
// Name of procedure to call
6060
@Nullable
6161
private String procedureName;
6262

63-
/** Name of catalog for call **/
63+
// Name of catalog for call
6464
@Nullable
6565
private String catalogName;
6666

67-
/** Name of schema for call **/
67+
// Name of schema for call
6868
@Nullable
6969
private String schemaName;
7070

71-
/** List of SqlParameter objects to be used in call execution */
71+
// List of SqlParameter objects to be used in call execution
7272
private List<SqlParameter> callParameters = new ArrayList<>();
7373

74-
/** Actual name to use for the return value in the output map */
74+
// Actual name to use for the return value in the output map
7575
@Nullable
7676
private String actualFunctionReturnName;
7777

78-
/** Set of in parameter names to exclude use for any not listed */
78+
// Set of in parameter names to exclude use for any not listed
7979
private Set<String> limitedInParameterNames = new HashSet<>();
8080

81-
/** List of SqlParameter names for out parameters */
81+
// List of SqlParameter names for out parameters
8282
private List<String> outParameterNames = new ArrayList<>();
8383

84-
/** Indicates whether this is a procedure or a function **/
84+
// Indicates whether this is a procedure or a function
8585
private boolean function = false;
8686

87-
/** Indicates whether this procedure's return value should be included **/
87+
// Indicates whether this procedure's return value should be included
8888
private boolean returnValueRequired = false;
8989

90-
/** Should we access call parameter meta data info or not */
90+
// Should we access call parameter meta data info or not
9191
private boolean accessCallParameterMetaData = true;
9292

93-
/** Should we bind parameter by name **/
93+
// Should we bind parameter by name
9494
private boolean namedBinding;
9595

96-
/** The provider of call meta data */
96+
// The provider of call meta data
9797
@Nullable
9898
private CallMetaDataProvider metaDataProvider;
9999

spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataContext.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,35 @@
4545
*/
4646
public class TableMetaDataContext {
4747

48-
/** Logger available to subclasses */
48+
// Logger available to subclasses
4949
protected final Log logger = LogFactory.getLog(getClass());
5050

51-
/** Name of table for this context */
51+
// Name of table for this context
5252
@Nullable
5353
private String tableName;
5454

55-
/** Name of catalog for this context */
55+
// Name of catalog for this context
5656
@Nullable
5757
private String catalogName;
5858

59-
/** Name of schema for this context */
59+
// Name of schema for this context
6060
@Nullable
6161
private String schemaName;
6262

63-
/** List of columns objects to be used in this context */
63+
// List of columns objects to be used in this context
6464
private List<String> tableColumns = new ArrayList<>();
6565

66-
/** should we access insert parameter meta data info or not */
66+
// Should we access insert parameter meta data info or not
6767
private boolean accessTableColumnMetaData = true;
6868

69-
/** should we override default for including synonyms for meta data lookups */
69+
// Should we override default for including synonyms for meta data lookups
7070
private boolean overrideIncludeSynonymsDefault = false;
7171

72-
/** the provider of table meta data */
72+
// The provider of table meta data
7373
@Nullable
7474
private TableMetaDataProvider metaDataProvider;
7575

76-
/** are we using generated key columns */
76+
// Are we using generated key columns
7777
private boolean generatedKeyColumnsUsed = false;
7878

7979

spring-jms/src/main/java/org/springframework/jms/config/MethodJmsListenerEndpoint.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,14 @@ public Method getMostSpecificMethod() {
105105
return this.mostSpecificMethod;
106106
}
107107
Method method = getMethod();
108-
if (method != null && AopUtils.isAopProxy(this.bean)) {
109-
Class<?> targetClass = AopProxyUtils.ultimateTargetClass(this.bean);
110-
return AopUtils.getMostSpecificMethod(method, targetClass);
111-
}
112-
else {
113-
return method;
108+
if (method != null) {
109+
Object bean = getBean();
110+
if (AopUtils.isAopProxy(bean)) {
111+
Class<?> targetClass = AopProxyUtils.ultimateTargetClass(bean);
112+
method = AopUtils.getMostSpecificMethod(method, targetClass);
113+
}
114114
}
115+
return method;
115116
}
116117

117118
/**

spring-web/src/main/java/org/springframework/web/util/HierarchicalUriComponents.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.
@@ -702,7 +702,7 @@ public String getPath() {
702702

703703
@Override
704704
public List<String> getPathSegments() {
705-
String[] segments = StringUtils.tokenizeToStringArray(this.path, PATH_DELIMITER_STRING);
705+
String[] segments = StringUtils.tokenizeToStringArray(getPath(), PATH_DELIMITER_STRING);
706706
return Collections.unmodifiableList(Arrays.asList(segments));
707707
}
708708

@@ -714,7 +714,7 @@ public PathComponent encode(Charset charset) {
714714

715715
@Override
716716
public void verify() {
717-
verifyUriComponent(this.path, Type.PATH);
717+
verifyUriComponent(getPath(), Type.PATH);
718718
}
719719

720720
@Override

0 commit comments

Comments
 (0)