From 290cc73d3d513086ac2ff927e908859641a7412c Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 9 Jun 2022 13:13:43 +0200 Subject: [PATCH 1/2] Fix Kotlin example for @Required Since @Required can only be declared on a method, this commit moves the @Required declaration from the field to the "set" method. Closes gh-28590 --- src/docs/asciidoc/core/core-beans.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/docs/asciidoc/core/core-beans.adoc b/src/docs/asciidoc/core/core-beans.adoc index 2a9728ba4c..a9125b7d8f 100644 --- a/src/docs/asciidoc/core/core-beans.adoc +++ b/src/docs/asciidoc/core/core-beans.adoc @@ -4688,8 +4688,9 @@ example: ---- class SimpleMovieLister { - @Required lateinit var movieFinder: MovieFinder + @Required + set // ... } From babff8e6353ed36de6f2bc03dd25e1a94f91839e Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 9 Jun 2022 13:16:19 +0200 Subject: [PATCH 2/2] Fix Kotlin example for dependency injection with static factory method Closes gh-28589 --- src/docs/asciidoc/core/core-beans.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/docs/asciidoc/core/core-beans.adoc b/src/docs/asciidoc/core/core-beans.adoc index a9125b7d8f..ac7a724903 100644 --- a/src/docs/asciidoc/core/core-beans.adoc +++ b/src/docs/asciidoc/core/core-beans.adoc @@ -1427,6 +1427,7 @@ The following example shows the corresponding `ExampleBean` class: // a static factory method; the arguments to this method can be // considered the dependencies of the bean that is returned, // regardless of how those arguments are actually used. + @JvmStatic fun createInstance(anotherBean: AnotherBean, yetAnotherBean: YetAnotherBean, i: Int): ExampleBean { val eb = ExampleBean (...) // some other operations...