Skip to content

Refine KotlinDetector usages and implementation #34275

Closed
@sdeleuze

Description

@sdeleuze

Initially Spring Framework did not required kotlin-reflect in a mandatory way, it does now for some time as documented in the reference documentation, as it is almost impossible to provide a reasonable Spring experience without it. Also we expect that #21546 will largely improve kotlin-reflect efficiency.

Since KotlinDetector#isKotlinType and KotlinDetector#isSuspendingFunction already have fast and classpath-safe checks of the presence of Kotlin in the classpath, that means there are various KotlinDetector#isKotlinReflectPresent invocations that can be removed from the codebase.

There are also some useless KotlinDetector#isKotlinPresent invocations that we can remove as well.

com.fasterxml.jackson.module.kotlin.KotlinModule requires kotlin-reflect, so the related classpath check in Jackson2ObjectMapperBuilder should be adapted.

Finally, KotlinDetector implementation can be optimized.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions