Hi, can someone help me to understand a behavior w...
# spring
d
Hi, can someone help me to understand a behavior with MessageSource and Kotlin? I have the following code that i use in my project:
Copy code
@Component
class MessageService(private val messageSource : MessageSource) {
    fun getMessage(id: String, vararg params: String) : String {
        val locale = LocaleContextHolder.getLocale()
        return messageSource.getMessage(id, arrayOf(params), id, locale)
    }
}
When called like this, where cardNumber is String:
val message = messageService.getMessage(messageKey, cardNumber)
the result message:
your card number: [Ljava.lang.String;@6b25306c
But if I change to use the spread operator,
return messageSource.getMessage(id, arrayOf(*params), id, locale)
it outputs the actual value of cardNumber. Why?