I think that the functions that store field in variables at the beginning of a method are a little bit more thread aware than functions that use field and assume they don’t change.
I do however agree that both are not completely thread safe.
I also agree that the first case looks like boilerplate.
The second case looks pretty clear to me, although I agree that the decompiled code seems less obvious.
I believe however that if you want to use Java, you don’t have the problem at all.
At the moment I would choose a third option, which is very clear, but only works in easy cases like this, so isn’t really the solution:
fun Person.fullName() = "$firstName $lastName"
fun getOwnerName() = owner?.fullName() ?: "NOBODY"
Ps. Take a look at this topic:
Where I want to highlight:
https://youtrack.jetbrains.com/issue/KT-20294