Skip to content

Commit 72b52d4

Browse files
committed
Polishing (backported from 5.2.x)
1 parent 3632b8b commit 72b52d4

File tree

9 files changed

+35
-35
lines changed

9 files changed

+35
-35
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public interface DisposableSqlTypeValue extends SqlTypeValue {
2929

3030
/**
3131
* Clean up resources held by this type value,
32-
* for example the LobCreator in case of a SqlLobValue.
32+
* for example the LobCreator in case of an SqlLobValue.
3333
* @see org.springframework.jdbc.core.support.SqlLobValue#cleanup()
3434
* @see org.springframework.jdbc.support.SqlValue#cleanup()
3535
*/

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public interface JdbcOperations {
223223
List<Map<String, Object>> queryForList(String sql) throws DataAccessException;
224224

225225
/**
226-
* Execute a query for a SqlRowSet, given static SQL.
226+
* Execute a query for an SqlRowSet, given static SQL.
227227
* <p>Uses a JDBC Statement, not a PreparedStatement. If you want to
228228
* execute a static query with a PreparedStatement, use the overloaded
229229
* {@code queryForRowSet} method with {@code null} as argument array.
@@ -234,7 +234,7 @@ public interface JdbcOperations {
234234
* class is used, which is part of JDK 1.5+ and also available separately as part of
235235
* Sun's JDBC RowSet Implementations download (rowset.jar).
236236
* @param sql the SQL query to execute
237-
* @return a SqlRowSet representation (possibly a wrapper around a
237+
* @return an SqlRowSet representation (possibly a wrapper around a
238238
* {@code javax.sql.rowset.CachedRowSet})
239239
* @throws DataAccessException if there is any problem executing the query
240240
* @see #queryForRowSet(String, Object...)
@@ -775,7 +775,7 @@ <T> List<T> queryForList(String sql, Object[] args, int[] argTypes, Class<T> ele
775775

776776
/**
777777
* Query given SQL to create a prepared statement from SQL and a list of
778-
* arguments to bind to the query, expecting a SqlRowSet.
778+
* arguments to bind to the query, expecting an SqlRowSet.
779779
* <p>The results will be mapped to an SqlRowSet which holds the data in a
780780
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
781781
* <p>Note that, for the default implementation, JDBC RowSet support needs to
@@ -786,7 +786,7 @@ <T> List<T> queryForList(String sql, Object[] args, int[] argTypes, Class<T> ele
786786
* @param args arguments to bind to the query
787787
* @param argTypes the SQL types of the arguments
788788
* (constants from {@code java.sql.Types})
789-
* @return a SqlRowSet representation (possibly a wrapper around a
789+
* @return an SqlRowSet representation (possibly a wrapper around a
790790
* {@code javax.sql.rowset.CachedRowSet})
791791
* @throws DataAccessException if there is any problem executing the query
792792
* @see #queryForRowSet(String)
@@ -798,7 +798,7 @@ <T> List<T> queryForList(String sql, Object[] args, int[] argTypes, Class<T> ele
798798

799799
/**
800800
* Query given SQL to create a prepared statement from SQL and a list of
801-
* arguments to bind to the query, expecting a SqlRowSet.
801+
* arguments to bind to the query, expecting an SqlRowSet.
802802
* <p>The results will be mapped to an SqlRowSet which holds the data in a
803803
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
804804
* <p>Note that, for the default implementation, JDBC RowSet support needs to
@@ -810,7 +810,7 @@ <T> List<T> queryForList(String sql, Object[] args, int[] argTypes, Class<T> ele
810810
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
811811
* may also contain {@link SqlParameterValue} objects which indicate not
812812
* only the argument value but also the SQL type and optionally the scale
813-
* @return a SqlRowSet representation (possibly a wrapper around a
813+
* @return an SqlRowSet representation (possibly a wrapper around a
814814
* {@code javax.sql.rowset.CachedRowSet})
815815
* @throws DataAccessException if there is any problem executing the query
816816
* @see #queryForRowSet(String)
@@ -974,7 +974,7 @@ <T> int[][] batchUpdate(String sql, Collection<T> batchArgs, int batchSize,
974974
<T> T execute(String callString, CallableStatementCallback<T> action) throws DataAccessException;
975975

976976
/**
977-
* Execute a SQL call using a CallableStatementCreator to provide SQL and
977+
* Execute an SQL call using a CallableStatementCreator to provide SQL and
978978
* any required parameters.
979979
* @param csc a callback that provides SQL and any necessary parameters
980980
* @param declaredParameters list of declared SqlParameter objects

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 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.
@@ -182,7 +182,7 @@ public JdbcTemplate(DataSource dataSource, boolean lazyInit) {
182182
/**
183183
* Set whether or not we want to ignore SQLWarnings.
184184
* <p>Default is "true", swallowing and logging all warnings. Switch this flag
185-
* to "false" to make the JdbcTemplate throw a SQLWarningException instead.
185+
* to "false" to make the JdbcTemplate throw an SQLWarningException instead.
186186
* @see java.sql.SQLWarning
187187
* @see org.springframework.jdbc.SQLWarningException
188188
* @see #handleWarnings
@@ -1350,7 +1350,7 @@ protected PreparedStatementSetter newArgTypePreparedStatementSetter(Object[] arg
13501350
}
13511351

13521352
/**
1353-
* Throw a SQLWarningException if we're not ignoring warnings,
1353+
* Throw an SQLWarningException if we're not ignoring warnings,
13541354
* otherwise log the warnings at debug level.
13551355
* @param stmt the current JDBC statement
13561356
* @throws SQLWarningException if not ignoring warnings
@@ -1373,7 +1373,7 @@ protected void handleWarnings(Statement stmt) throws SQLException {
13731373
}
13741374

13751375
/**
1376-
* Throw a SQLWarningException if encountering an actual warning.
1376+
* Throw an SQLWarningException if encountering an actual warning.
13771377
* @param warning the warnings object from the current statement.
13781378
* May be {@code null}, in which case this method does nothing.
13791379
* @throws SQLWarningException in case of an actual warning to be raised
@@ -1401,7 +1401,7 @@ protected DataAccessException translateException(String task, @Nullable String s
14011401

14021402
/**
14031403
* Determine SQL from potential provider object.
1404-
* @param sqlProvider object which is potentially a SqlProvider
1404+
* @param sqlProvider object which is potentially an SqlProvider
14051405
* @return the SQL string, or {@code null} if not known
14061406
* @see SqlProvider
14071407
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public interface ParameterDisposer {
3737
/**
3838
* Close the resources allocated by parameters that the implementing
3939
* object holds, for example in case of a DisposableSqlTypeValue
40-
* (like a SqlLobValue).
40+
* (like an SqlLobValue).
4141
* @see DisposableSqlTypeValue#cleanup()
4242
* @see org.springframework.jdbc.core.support.SqlLobValue#cleanup()
4343
*/

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public static void setParameterValue(PreparedStatement ps, int paramIndex, SqlPa
152152
* @param ps the prepared statement or callable statement
153153
* @param paramIndex index of the parameter we are setting
154154
* @param sqlType the SQL type of the parameter
155-
* @param inValue the value to set (plain value or a SqlTypeValue)
155+
* @param inValue the value to set (plain value or an SqlTypeValue)
156156
* @throws SQLException if thrown by PreparedStatement methods
157157
* @see SqlTypeValue
158158
*/
@@ -170,7 +170,7 @@ public static void setParameterValue(PreparedStatement ps, int paramIndex, int s
170170
* @param sqlType the SQL type of the parameter
171171
* @param typeName the type name of the parameter
172172
* (optional, only used for SQL NULL and SqlTypeValue)
173-
* @param inValue the value to set (plain value or a SqlTypeValue)
173+
* @param inValue the value to set (plain value or an SqlTypeValue)
174174
* @throws SQLException if thrown by PreparedStatement methods
175175
* @see SqlTypeValue
176176
*/
@@ -190,7 +190,7 @@ public static void setParameterValue(PreparedStatement ps, int paramIndex, int s
190190
* (optional, only used for SQL NULL and SqlTypeValue)
191191
* @param scale the number of digits after the decimal point
192192
* (for DECIMAL and NUMERIC types)
193-
* @param inValue the value to set (plain value or a SqlTypeValue)
193+
* @param inValue the value to set (plain value or an SqlTypeValue)
194194
* @throws SQLException if thrown by PreparedStatement methods
195195
* @see SqlTypeValue
196196
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ protected List<SqlParameter> reconcileParameters(List<SqlParameter> parameters)
390390
if (param == null) {
391391
throw new InvalidDataAccessApiUsageException(
392392
"Unable to locate declared parameter for function return value - " +
393-
" add a SqlOutParameter with name '" + getFunctionReturnName() + "'");
393+
" add an SqlOutParameter with name '" + getFunctionReturnName() + "'");
394394
}
395395
else {
396396
this.actualFunctionReturnName = param.getName();

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

Lines changed: 11 additions & 11 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-2020 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.
@@ -31,16 +31,16 @@
3131
public class CallParameterMetaData {
3232

3333
@Nullable
34-
private String parameterName;
34+
private final String parameterName;
3535

36-
private int parameterType;
36+
private final int parameterType;
3737

38-
private int sqlType;
38+
private final int sqlType;
3939

4040
@Nullable
41-
private String typeName;
41+
private final String typeName;
4242

43-
private boolean nullable;
43+
private final boolean nullable;
4444

4545

4646
/**
@@ -58,15 +58,15 @@ public CallParameterMetaData(
5858

5959

6060
/**
61-
* Get the parameter name.
61+
* Return the parameter name.
6262
*/
6363
@Nullable
6464
public String getParameterName() {
6565
return this.parameterName;
6666
}
6767

6868
/**
69-
* Get the parameter type.
69+
* Return the parameter type.
7070
*/
7171
public int getParameterType() {
7272
return this.parameterType;
@@ -84,22 +84,22 @@ public boolean isReturnParameter() {
8484
}
8585

8686
/**
87-
* Get the parameter SQL type.
87+
* Return the parameter SQL type.
8888
*/
8989
public int getSqlType() {
9090
return this.sqlType;
9191
}
9292

9393
/**
94-
* Get the parameter type name.
94+
* Return the parameter type name.
9595
*/
9696
@Nullable
9797
public String getTypeName() {
9898
return this.typeName;
9999
}
100100

101101
/**
102-
* Get whether the parameter is nullable.
102+
* Return whether the parameter is nullable.
103103
*/
104104
public boolean isNullable() {
105105
return this.nullable;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ <T> List<T> queryForList(String sql, Map<String, ?> paramMap, Class<T> elementTy
406406

407407
/**
408408
* Query given SQL to create a prepared statement from SQL and a
409-
* list of arguments to bind to the query, expecting a SqlRowSet.
409+
* list of arguments to bind to the query, expecting an SqlRowSet.
410410
* <p>The results will be mapped to an SqlRowSet which holds the data in a
411411
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
412412
* <p>Note that, for the default implementation, JDBC RowSet support needs to
@@ -415,7 +415,7 @@ <T> List<T> queryForList(String sql, Map<String, ?> paramMap, Class<T> elementTy
415415
* Sun's JDBC RowSet Implementations download (rowset.jar).
416416
* @param sql the SQL query to execute
417417
* @param paramSource container of arguments to bind to the query
418-
* @return a SqlRowSet representation (possibly a wrapper around a
418+
* @return an SqlRowSet representation (possibly a wrapper around a
419419
* {@code javax.sql.rowset.CachedRowSet})
420420
* @throws DataAccessException if there is any problem executing the query
421421
* @see org.springframework.jdbc.core.JdbcTemplate#queryForRowSet(String)
@@ -426,7 +426,7 @@ <T> List<T> queryForList(String sql, Map<String, ?> paramMap, Class<T> elementTy
426426

427427
/**
428428
* Query given SQL to create a prepared statement from SQL and a
429-
* list of arguments to bind to the query, expecting a SqlRowSet.
429+
* list of arguments to bind to the query, expecting an SqlRowSet.
430430
* <p>The results will be mapped to an SqlRowSet which holds the data in a
431431
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
432432
* <p>Note that, for the default implementation, JDBC RowSet support needs to
@@ -436,7 +436,7 @@ <T> List<T> queryForList(String sql, Map<String, ?> paramMap, Class<T> elementTy
436436
* @param sql the SQL query to execute
437437
* @param paramMap map of parameters to bind to the query
438438
* (leaving it to the PreparedStatement to guess the corresponding SQL type)
439-
* @return a SqlRowSet representation (possibly a wrapper around a
439+
* @return an SqlRowSet representation (possibly a wrapper around a
440440
* {@code javax.sql.rowset.CachedRowSet})
441441
* @throws DataAccessException if there is any problem executing the query
442442
* @see org.springframework.jdbc.core.JdbcTemplate#queryForRowSet(String)

spring-jdbc/src/main/java/org/springframework/jdbc/support/rowset/SqlRowSet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
* {@link java.sql.ResultSet} data.
3333
*
3434
* <p>The main difference to the standard JDBC RowSet is that a {@link java.sql.SQLException}
35-
* is never thrown here. This allows a SqlRowSet to be used without having to deal with
36-
* checked exceptions. A SqlRowSet will throw Spring's {@link InvalidResultSetAccessException}
35+
* is never thrown here. This allows an SqlRowSet to be used without having to deal with
36+
* checked exceptions. An SqlRowSet will throw Spring's {@link InvalidResultSetAccessException}
3737
* instead (when appropriate).
3838
*
3939
* <p>Note: This interface extends the {@code java.io.Serializable} marker interface.

0 commit comments

Comments
 (0)