Skip to content

Commit 618bce3

Browse files
committed
Adapt MyBeanRegistrar Kotlin code sample
This commit adapts the MyBeanRegistrar Kotlin code sample to use a lambda supplier instead of a callable reference since this capability has been removed. See gh-35549 Closes gh-35694
1 parent 4356fc1 commit 618bce3

File tree

1 file changed

+3
-1
lines changed
  • framework-docs/src/main/kotlin/org/springframework/docs/core/beans/java/beansjavaprogrammaticregistration

1 file changed

+3
-1
lines changed

framework-docs/src/main/kotlin/org/springframework/docs/core/beans/java/beansjavaprogrammaticregistration/MyBeanRegistrar.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ class MyBeanRegistrar : BeanRegistrarDsl({
3333
registerBean { Baz("Hello World!") }
3434
}
3535
registerBean<MyRepository>()
36-
registerBean(::myRouter)
36+
registerBean {
37+
myRouter(bean<MyRepository>()) // Also possible with just myRouter(bean())
38+
}
3739
})
3840

3941
fun myRouter(myRepository: MyRepository) = router {

0 commit comments

Comments
 (0)