Reputation: 28162
In kotlin I have a class that was converted to an object and now when I call it from java the method name is appended with $app. What does this mean?
Kotlin
object SomeObject {
internal val standardRetroService: WebPredictionService
get() = getCustomBaseRetroService(CloudUtil.doStuff)
}
Java
SomeObject.INSTANCE.getStandardRetroService$app().dostuff();
Upvotes: 2
Views: 228
Reputation: 89668
You get that postfix because of the internal
visibility modifer, which makes the property visible only within its module (app
) when using it from Kotlin.
There isn't such a visibility in Java / on the bytecode level, so instead the identifier gets "mangled" with this this postfix, which is supposed to signal to Java clients that they shouldn't be using it, at least if they aren't sure they know what they're doing.
Upvotes: 3