While analyzing #28590, I noticed that many of the examples involving setter injection and Kotlin incorrectly use field injection.
Searching for lateinit var movieFinder: MovieFinder will reveal several of those -- for example, those using @Resource, @Autowired, @Inject.
There may well be other cases in the reference manual.
Regarding the "fix", #28590 proposed the @Required set shorthand syntax for annotating a setter method in Kotlin. I'm not a Kotlin expert and therefore assume that works, but I'm wondering if it wouldn't be better to demonstrate annotated setter methods with a complete setXyz(...) method.
While analyzing #28590, I noticed that many of the examples involving setter injection and Kotlin incorrectly use field injection.
Searching for
lateinit var movieFinder: MovieFinderwill reveal several of those -- for example, those using@Resource,@Autowired,@Inject.There may well be other cases in the reference manual.
Regarding the "fix", #28590 proposed the
@Required setshorthand syntax for annotating a setter method in Kotlin. I'm not a Kotlin expert and therefore assume that works, but I'm wondering if it wouldn't be better to demonstrate annotated setter methods with a completesetXyz(...)method.