Skip to content

Calling MethodParameter.isOptional() for Kotlin Continuation parameter fails with IndexOutOfBoundsException #23991

@mp911de

Description

@mp911de

Affects: 5.2.1.RELEASE

Calling MethodParameter.isOptional() for a kotlin.coroutines.Continuation parameter of a suspend fun fails when introspecting a Coroutines method.

java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

	at java.util.ArrayList.rangeCheck(ArrayList.java:657)
	at java.util.ArrayList.get(ArrayList.java:433)
	at org.springframework.core.MethodParameter$KotlinDelegate.isOptional(MethodParameter.java:899)
	at org.springframework.core.MethodParameter.isOptional(MethodParameter.java:408)

The backing collection of KParameters does not contain the parameter and therefore optionality checks fail.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions