Closed
Description
Expected Behavior
Functions that take a class as a parameter could be written in a idiomatic kotlin way like
addFilterAt<BasicAuthenticationFilter>(myFilter)
also removing some noise.
Current Behavior
The current version of the function takes a java class as a parameter:
addFilterAt(myFilter, BasicAuthenticationFilter::class.java)
Context
When using any Kotlin DSL I don't expect to pass a java class as a parameter. Normally you would pass Kotlins KClass (BasicAuthenticationFilter::class
) or use the even more idiomatic way of with a generic reified type. That's also embraced in other parts of Spring like the RestTemplate that for example has an extension functions for post (postForObject(url)).