mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Anticipate fixing Kotlin 2.3 compilation warning
Closes gh-36203
This commit is contained in:
@@ -46,7 +46,7 @@ class AopUtilsKotlinTests {
|
||||
@Test
|
||||
fun `Invoking suspending function on bridged method should return Mono`() {
|
||||
val value = "foo"
|
||||
val bridgedMethod = ReflectionUtils.findMethod(WithInterface::class.java, "handle", Object::class.java, Continuation::class.java)!!
|
||||
val bridgedMethod = ReflectionUtils.findMethod(WithInterface::class.java, "handle", Any::class.java, Continuation::class.java)!!
|
||||
val continuation = Continuation<Any>(CoroutineName("test")) { }
|
||||
val result = AopUtils.invokeJoinpointUsingReflection(WithInterface(), bridgedMethod, arrayOf(value, continuation))
|
||||
assertThat(result).isInstanceOfSatisfying(Mono::class.java) {
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ class BindingReflectionHintsRegistrarKotlinTests {
|
||||
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(SampleDataClass::class.java, "isNonNullable")).accepts(hints)
|
||||
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(SampleDataClass::class.java, "isNullable")).accepts(hints)
|
||||
val copyDefault: Method = SampleDataClass::class.java.getMethod("copy\$default", SampleDataClass::class.java,
|
||||
String::class.java, Boolean::class.javaPrimitiveType, Boolean::class.javaObjectType, Int::class.java, Object::class.java)
|
||||
String::class.java, Boolean::class.javaPrimitiveType, Boolean::class.javaObjectType, Int::class.java, Any::class.java)
|
||||
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(copyDefault)).accepts(hints)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ class GenericTypeResolverKotlinTests {
|
||||
@Test
|
||||
fun methodReturnTypes() {
|
||||
assertThat(resolveReturnTypeArgument(findMethod(MyTypeWithMethods::class.java, "integer")!!,
|
||||
MyInterfaceType::class.java)).isEqualTo(Integer::class.java)
|
||||
MyInterfaceType::class.java)).isEqualTo(Int::class.javaObjectType)
|
||||
assertThat(resolveReturnTypeArgument(findMethod(MyTypeWithMethods::class.java, "string")!!,
|
||||
MyInterfaceType::class.java)).isEqualTo(String::class.java)
|
||||
assertThat(resolveReturnTypeArgument(findMethod(MyTypeWithMethods::class.java, "raw")!!,
|
||||
|
||||
@@ -110,8 +110,8 @@ class MethodParameterKotlinTests {
|
||||
assertThat(returnGenericParameterType("suspendFun7")).isInstanceOf(TypeVariable::class.java)
|
||||
assertThat(returnGenericParameterTypeBoundName("suspendFun7")).isEqualTo("org.springframework.core.Consumer<? super java.lang.Number>")
|
||||
|
||||
assertThat(returnParameterType("suspendFun8")).isEqualTo(Object::class.java)
|
||||
assertThat(returnGenericParameterType("suspendFun8")).isEqualTo(Object::class.java)
|
||||
assertThat(returnParameterType("suspendFun8")).isEqualTo(Any::class.java)
|
||||
assertThat(returnGenericParameterType("suspendFun8")).isEqualTo(Any::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+4
-4
@@ -28,7 +28,7 @@ import reactor.core.publisher.Mono
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
suspend fun <T> RowsFetchSpec<T>.awaitOne(): T {
|
||||
suspend fun <T : Any> RowsFetchSpec<T>.awaitOne(): T {
|
||||
return one().awaitSingleOrNull() ?: throw EmptyResultDataAccessException(1)
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ suspend fun <T> RowsFetchSpec<T>.awaitOne(): T {
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
suspend fun <T> RowsFetchSpec<T>.awaitOneOrNull(): T? =
|
||||
suspend fun <T : Any> RowsFetchSpec<T>.awaitOneOrNull(): T? =
|
||||
one().awaitSingleOrNull()
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ suspend fun <T> RowsFetchSpec<T>.awaitOneOrNull(): T? =
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
suspend fun <T> RowsFetchSpec<T>.awaitSingle(): T {
|
||||
suspend fun <T : Any> RowsFetchSpec<T>.awaitSingle(): T {
|
||||
return first().awaitSingleOrNull() ?: throw EmptyResultDataAccessException(1)
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ suspend fun <T> RowsFetchSpec<T>.awaitSingle(): T {
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
suspend fun <T> RowsFetchSpec<T>.awaitSingleOrNull(): T? =
|
||||
suspend fun <T : Any> RowsFetchSpec<T>.awaitSingleOrNull(): T? =
|
||||
first().awaitSingleOrNull()
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ class MockMvcResultMatchersDsl(private val actions: ResultActions) {
|
||||
/**
|
||||
* @see MockMvcResultMatchers.jsonPath
|
||||
*/
|
||||
fun <T> jsonPath(expression: String, matcher: Matcher<T>) {
|
||||
fun <T : Any> jsonPath(expression: String, matcher: Matcher<T>) {
|
||||
actions.andExpect(MockMvcResultMatchers.jsonPath(expression, matcher))
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ class FlashAttributeResultMatchersDsl internal constructor (private val actions:
|
||||
/**
|
||||
* @see FlashAttributeResultMatchers.attribute
|
||||
*/
|
||||
fun <T> attribute(name: String, matcher: Matcher<T>) {
|
||||
fun <T : Any> attribute(name: String, matcher: Matcher<T>) {
|
||||
actions.andExpect(matchers.attribute(name, matcher))
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ class JsonPathResultMatchersDsl internal constructor(@PublishedApi internal val
|
||||
/**
|
||||
* @see JsonPathResultMatchers.value
|
||||
*/
|
||||
inline fun <reified T> value(matcher: Matcher<T>) {
|
||||
inline fun <reified T : Any> value(matcher: Matcher<T>) {
|
||||
actions.andExpect(matchers.value(matcher, T::class.java))
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ class ModelResultMatchersDsl internal constructor (private val actions: ResultAc
|
||||
/**
|
||||
* @see ModelResultMatchers.attribute
|
||||
*/
|
||||
fun <T> attribute(name: String, matcher: Matcher<T>) {
|
||||
fun <T : Any> attribute(name: String, matcher: Matcher<T>) {
|
||||
actions.andExpect(matchers.attribute(name, matcher))
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -46,7 +46,7 @@ class RequestResultMatchersDsl internal constructor (private val actions: Result
|
||||
/**
|
||||
* @see RequestResultMatchers.asyncResult
|
||||
*/
|
||||
fun <T> asyncResult(matcher: Matcher<T>) {
|
||||
fun <T : Any> asyncResult(matcher: Matcher<T>) {
|
||||
actions.andExpect(matchers.asyncResult(matcher))
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ class RequestResultMatchersDsl internal constructor (private val actions: Result
|
||||
/**
|
||||
* @see RequestResultMatchers.attribute
|
||||
*/
|
||||
fun <T> attribute(name: String, matcher: Matcher<T>) {
|
||||
fun <T : Any> attribute(name: String, matcher: Matcher<T>) {
|
||||
actions.andExpect(matchers.attribute(name, matcher))
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ class RequestResultMatchersDsl internal constructor (private val actions: Result
|
||||
/**
|
||||
* @see RequestResultMatchers.sessionAttribute
|
||||
*/
|
||||
fun <T> sessionAttribute(name: String, matcher: Matcher<T>) {
|
||||
fun <T : Any> sessionAttribute(name: String, matcher: Matcher<T>) {
|
||||
actions.andExpect(matchers.sessionAttribute(name, matcher))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user