Cleanup kotlin sources

1. remove unused import
2. remove redundant semicolon
3. remove redundant empty constructor and SAM-constructor
4. remove unnecessary type argument
5. adjust indent

See gh-31913
This commit is contained in:
Yanming Zhou
2023-12-28 10:41:06 +08:00
committed by Stéphane Nicoll
parent 28a7b6103a
commit 7474af4f09
10 changed files with 57 additions and 59 deletions

View File

@@ -35,7 +35,7 @@ inline fun <reified T> JdbcOperations.queryForObject(sql: String): T =
* @since 5.0
*/
inline fun <reified T> JdbcOperations.queryForObject(sql: String, vararg args: Any, crossinline function: (ResultSet, Int) -> T): T =
queryForObject(sql, RowMapper { resultSet, i -> function(resultSet, i) }, *args) as T
queryForObject(sql, { resultSet, i -> function(resultSet, i) }, *args) as T
/**
* Extension for [JdbcOperations.queryForObject] providing a
@@ -113,7 +113,7 @@ inline fun <reified T> JdbcOperations.query(sql: String, vararg args: Any,
* @since 5.0
*/
fun JdbcOperations.query(sql: String, vararg args: Any, function: (ResultSet) -> Unit): Unit =
query(sql, RowCallbackHandler { function(it) }, *args)
query(sql, { function(it) }, *args)
/**
* Extensions for [JdbcOperations.query] providing a RowMapper-like function variant:
@@ -123,4 +123,4 @@ fun JdbcOperations.query(sql: String, vararg args: Any, function: (ResultSet) ->
* @since 5.0
*/
fun <T> JdbcOperations.query(sql: String, vararg args: Any, function: (ResultSet, Int) -> T): List<T> =
query(sql, RowMapper { rs, i -> function(rs, i) }, *args)
query(sql, { rs, i -> function(rs, i) }, *args)