Browse Source

Fix Kotlin warnings

pull/1354/head
Sebastien Deleuze 8 years ago
parent
commit
9963c4a495
  1. 1
      spring-beans/src/main/kotlin/org/springframework/beans/factory/BeanFactoryExtensions.kt
  2. 2
      spring-jdbc/src/main/kotlin/org/springframework/jdbc/core/JdbcOperationsExtensions.kt
  3. 4
      spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/JdbcOperationsExtensionsTests.kt
  4. 2
      spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/server/RouterFunctionExtensionsTests.kt
  5. 2
      spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/view/script/ScriptTemplateWithBindingsExtensions.kt
  6. 2
      spring-webmvc/src/test/kotlin/org/springframework/web/servlet/view/script/ScriptTemplateWithBindingsExtensions.kt

1
spring-beans/src/main/kotlin/org/springframework/beans/factory/BeanFactoryExtensions.kt

@ -36,6 +36,7 @@ fun <T : Any> BeanFactory.getBean(name: String, requiredType: KClass<T>) = @@ -36,6 +36,7 @@ fun <T : Any> BeanFactory.getBean(name: String, requiredType: KClass<T>) =
* @author Sebastien Deleuze
* @since 5.0
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
inline fun <reified T : Any> BeanFactory.getBean(name: String) =
getBean(name, T::class.java)

2
spring-jdbc/src/main/kotlin/org/springframework/jdbc/core/JdbcOperationsExtensions.kt

@ -106,6 +106,7 @@ fun <T : Any> JdbcOperations.queryForList(sql: String, elementType: KClass<T>): @@ -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 @@ -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)

4
spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/JdbcOperationsExtensionsTests.kt

@ -88,7 +88,7 @@ class JdbcOperationsExtensionsTests { @@ -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 { @@ -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())

2
spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/server/RouterFunctionExtensionsTests.kt

@ -133,8 +133,10 @@ class RouterFunctionExtensionsTests { @@ -133,8 +133,10 @@ class RouterFunctionExtensionsTests {
path("/baz") { handle(req) }
}
@Suppress("UNUSED_PARAMETER")
fun handleFromClass(req: ServerRequest) = ok().build()
}
}
@Suppress("UNUSED_PARAMETER")
fun handle(req: ServerRequest) = ok().build()

2
spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/view/script/ScriptTemplateWithBindingsExtensions.kt

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
@file:Suppress("UNCHECKED_CAST")
package org.springframework.web.reactive.result.view.script
import kotlin.script.templates.standard.ScriptTemplateWithBindings

2
spring-webmvc/src/test/kotlin/org/springframework/web/servlet/view/script/ScriptTemplateWithBindingsExtensions.kt

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
@file:Suppress("UNCHECKED_CAST")
package org.springframework.web.reactive.result.view.script
import kotlin.script.templates.standard.ScriptTemplateWithBindings

Loading…
Cancel
Save