sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Use @JvmOverloads for Kotlin Classes' ctors for java-interop

Open romtsn opened this issue 3 years ago • 1 comments

Description

We used to manually create ctor overloads, but we could actually use @JvmOverloads annotation which would generate the overloads for us.

romtsn avatar Jun 22 '22 07:06 romtsn

We need to make sure that the JvmOverloads is enough and properly generates the overloads. Also, check if there's a possibility to lint/analyze the ctors, so we ensure this as best practice in the future.

https://stackoverflow.com/questions/46023983/how-default-argument-and-jvmoverloads-work-on-kotlin

romtsn avatar Jul 13 '22 13:07 romtsn

Closing as this seems to be working just fine and more less error-prone

romtsn avatar Oct 18 '23 15:10 romtsn