Rename by @JvmName("Xxx") or directly use XxxKt?

I write a lib in kotlin, this lib may be used by both java and kotlin.
Should I rename the kotlin file(@file:JvmName) to avoid name like “XxxKt”? In kotlin, there is no such problem, in java, it is a little ugly.

It the file contains many top level functions that you expect to be called from java I’d use @JvmName. There is also an annotation that allows you to combine files into a single java class to group top level functions. Can’t remember its name but I consider using that as well.

1 Like