From 8c0e3040c2e6d779207a3decad3ed77bd842b760 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 7 Feb 2014 18:06:13 +0100 Subject: [PATCH] Polishing --- .../context/support/SimpleThreadScope.java | 9 +++-- .../jdbc/core/JdbcOperations.java | 33 +++++++------------ 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java b/spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java index 478bb66491..34454f236c 100644 --- a/spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java +++ b/spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java @@ -26,13 +26,12 @@ import org.springframework.beans.factory.ObjectFactory; import org.springframework.beans.factory.config.Scope; import org.springframework.core.NamedThreadLocal; - /** - * Thread-backed {@link Scope} implementation. + * A simple thread-backed {@link Scope} implementation. * - *

Note that the {@code SimpleThreadScope} does not clean - * up any objects associated with it. As such, it's typically preferable to - * use the {@link org.springframework.web.context.request.RequestScope RequestScope} + *

Note: {@code SimpleThreadScope} does not clean up + * any objects associated with it. As such, it is typically preferable to + * use {@link org.springframework.web.context.request.RequestScope RequestScope} * in web environments. * *

For an implementation of a thread-based {@code Scope} with support for diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java index f26bf2656e..0c41df7cc5 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java @@ -311,8 +311,7 @@ public interface JdbcOperations { * @return a result object returned by the action, or {@code null} * @throws DataAccessException if there is any problem */ - T execute(PreparedStatementCreator psc, PreparedStatementCallback action) - throws DataAccessException; + T execute(PreparedStatementCreator psc, PreparedStatementCallback action) throws DataAccessException; /** * Execute a JDBC data access operation, implemented as callback action @@ -354,8 +353,7 @@ public interface JdbcOperations { * @return an arbitrary result object, as returned by the ResultSetExtractor * @throws DataAccessException if there is any problem */ - T query(String sql, PreparedStatementSetter pss, ResultSetExtractor rse) - throws DataAccessException; + T query(String sql, PreparedStatementSetter pss, ResultSetExtractor rse) throws DataAccessException; /** * Query given SQL to create a prepared statement from SQL and a list @@ -370,8 +368,7 @@ public interface JdbcOperations { * @throws DataAccessException if the query fails * @see java.sql.Types */ - T query(String sql, Object[] args, int[] argTypes, ResultSetExtractor rse) - throws DataAccessException; + T query(String sql, Object[] args, int[] argTypes, ResultSetExtractor rse) throws DataAccessException; /** * Query given SQL to create a prepared statement from SQL and a list @@ -428,8 +425,7 @@ public interface JdbcOperations { * @param rch object that will extract results, one row at a time * @throws DataAccessException if the query fails */ - void query(String sql, PreparedStatementSetter pss, RowCallbackHandler rch) - throws DataAccessException; + void query(String sql, PreparedStatementSetter pss, RowCallbackHandler rch) throws DataAccessException; /** * Query given SQL to create a prepared statement from SQL and a list of @@ -443,8 +439,7 @@ public interface JdbcOperations { * @throws DataAccessException if the query fails * @see java.sql.Types */ - void query(String sql, Object[] args, int[] argTypes, RowCallbackHandler rch) - throws DataAccessException; + void query(String sql, Object[] args, int[] argTypes, RowCallbackHandler rch) throws DataAccessException; /** * Query given SQL to create a prepared statement from SQL and a list of @@ -500,8 +495,7 @@ public interface JdbcOperations { * @return the result List, containing mapped objects * @throws DataAccessException if the query fails */ - List query(String sql, PreparedStatementSetter pss, RowMapper rowMapper) - throws DataAccessException; + List query(String sql, PreparedStatementSetter pss, RowMapper rowMapper) throws DataAccessException; /** * Query given SQL to create a prepared statement from SQL and a list @@ -516,8 +510,7 @@ public interface JdbcOperations { * @throws DataAccessException if the query fails * @see java.sql.Types */ - List query(String sql, Object[] args, int[] argTypes, RowMapper rowMapper) - throws DataAccessException; + List query(String sql, Object[] args, int[] argTypes, RowMapper rowMapper) throws DataAccessException; /** * Query given SQL to create a prepared statement from SQL and a list @@ -582,8 +575,7 @@ public interface JdbcOperations { * return exactly one row * @throws DataAccessException if the query fails */ - T queryForObject(String sql, Object[] args, RowMapper rowMapper) - throws DataAccessException; + T queryForObject(String sql, Object[] args, RowMapper rowMapper) throws DataAccessException; /** * Query given SQL to create a prepared statement from SQL and a list @@ -600,8 +592,7 @@ public interface JdbcOperations { * return exactly one row * @throws DataAccessException if the query fails */ - T queryForObject(String sql, RowMapper rowMapper, Object... args) - throws DataAccessException; + T queryForObject(String sql, RowMapper rowMapper, Object... args) throws DataAccessException; /** * Query given SQL to create a prepared statement from SQL and a @@ -1019,8 +1010,7 @@ public interface JdbcOperations { * (constants from {@code java.sql.Types}) * @return an array containing the numbers of rows affected by each update in the batch */ - public int[] batchUpdate(String sql, List batchArgs, int[] argTypes) - throws DataAccessException; + public int[] batchUpdate(String sql, List batchArgs, int[] argTypes) throws DataAccessException; /** * Execute multiple batches using the supplied SQL statement with the collect of supplied arguments. @@ -1054,8 +1044,7 @@ public interface JdbcOperations { * @return a result object returned by the action, or {@code null} * @throws DataAccessException if there is any problem */ - T execute(CallableStatementCreator csc, CallableStatementCallback action) - throws DataAccessException; + T execute(CallableStatementCreator csc, CallableStatementCallback action) throws DataAccessException; /** * Execute a JDBC data access operation, implemented as callback action