Affects: Spring Web 6.1.1 Spring Boot 3.2.0

When having a Kotlin class as a container for request parameters with a default arg, this used to work without any problems up to Spring Boot 3.1.6. After switch to 3.2.0 the controller now throws an IllegalStateException Cannot resolve parameter names for constructor private java.time.Duration(long,int).

@RestController
class WebController {
    @GetMapping(path = ["/test"])
    fun test(container: RequestParameterContainer) = ResponseEntity.ofNullable(container)
}

data class RequestParameterContainer(val duration: Duration = Duration.parse("PT1H"))

When making the class mutable, for instance something like this, it works:

class RequestParameterContainerMutable {
    var duration: Duration = Duration.parse("PT1H")
}

I created a small reproducible for you. When setting a value for the parameter, it works. When omitting and the default should be triggered, instead the exception is thrown.

kotlin-default-bug.zip

Comment From: rstoyanchev

This is likely as a result of changes for #20806.