Fix Kotlin warnings

This commit is contained in:
Sebastien Deleuze
2017-03-10 10:35:30 +01:00
parent 813d3efe61
commit 9963c4a495
6 changed files with 11 additions and 2 deletions

View File

@@ -106,6 +106,7 @@ fun <T : Any> JdbcOperations.queryForList(sql: String, elementType: KClass<T>):
* @author Mario Arias
* @since 5.0
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
inline fun <reified T : Any> JdbcOperations.queryForList(sql: String): List<T> =
queryForList(sql, T::class.java)
@@ -124,6 +125,7 @@ fun <T : Any> JdbcOperations.queryForList(sql: String, args: Array<out Any>, arg
* @author Mario Arias
* @since 5.0
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
inline fun <reified T : Any> JdbcOperations.queryForList(sql: String, args: Array<out Any>, argTypes: IntArray): List<T> =
queryForList(sql, args, argTypes, T::class.java)

View File

@@ -88,7 +88,7 @@ class JdbcOperationsExtensionsTests {
@Test
fun `queryForObject with RowMapper-like function`() {
val i = template.queryForObject("select age from customer where id = ?", 3) { rs, i ->
val i = template.queryForObject("select age from customer where id = ?", 3) { rs, _ ->
rs.getInt(1)
}
assertEquals(22, i)
@@ -181,7 +181,7 @@ class JdbcOperationsExtensionsTests {
@Test
fun `query with RowMapper-like function`() {
val i = template.query("select age from customer where id = ?", 3) { rs, i ->
val i = template.query("select age from customer where id = ?", 3) { rs, _ ->
rs.getInt(1)
}
assertEquals(22, i.first())