Don't set role in Kotlin bean DSL unless specified
Issue: SPR-17275
This commit is contained in:
parent
47d6e91227
commit
f7839675f6
|
|
@ -172,7 +172,7 @@ open class BeanDefinitionDsl(private val init: BeanDefinitionDsl.() -> Unit,
|
||||||
initMethodName: String? = null,
|
initMethodName: String? = null,
|
||||||
destroyMethodName: String? = null,
|
destroyMethodName: String? = null,
|
||||||
description: String? = null,
|
description: String? = null,
|
||||||
role: Role = Role.APPLICATION) {
|
role: Role? = null) {
|
||||||
|
|
||||||
val customizer = BeanDefinitionCustomizer { bd ->
|
val customizer = BeanDefinitionCustomizer { bd ->
|
||||||
scope?.let { bd.scope = scope.name.toLowerCase() }
|
scope?.let { bd.scope = scope.name.toLowerCase() }
|
||||||
|
|
@ -182,7 +182,7 @@ open class BeanDefinitionDsl(private val init: BeanDefinitionDsl.() -> Unit,
|
||||||
initMethodName?.let { bd.initMethodName = initMethodName }
|
initMethodName?.let { bd.initMethodName = initMethodName }
|
||||||
destroyMethodName?.let { bd.destroyMethodName = destroyMethodName }
|
destroyMethodName?.let { bd.destroyMethodName = destroyMethodName }
|
||||||
description?.let { bd.description = description }
|
description?.let { bd.description = description }
|
||||||
bd.role = role.ordinal
|
role?. let { bd.role = role.ordinal }
|
||||||
}
|
}
|
||||||
|
|
||||||
val beanName = name ?: BeanDefinitionReaderUtils.uniqueBeanName(T::class.java.name, context);
|
val beanName = name ?: BeanDefinitionReaderUtils.uniqueBeanName(T::class.java.name, context);
|
||||||
|
|
@ -214,7 +214,7 @@ open class BeanDefinitionDsl(private val init: BeanDefinitionDsl.() -> Unit,
|
||||||
initMethodName: String? = null,
|
initMethodName: String? = null,
|
||||||
destroyMethodName: String? = null,
|
destroyMethodName: String? = null,
|
||||||
description: String? = null,
|
description: String? = null,
|
||||||
role: Role = Role.APPLICATION,
|
role: Role? = null,
|
||||||
crossinline function: () -> T) {
|
crossinline function: () -> T) {
|
||||||
|
|
||||||
val customizer = BeanDefinitionCustomizer { bd ->
|
val customizer = BeanDefinitionCustomizer { bd ->
|
||||||
|
|
@ -225,7 +225,7 @@ open class BeanDefinitionDsl(private val init: BeanDefinitionDsl.() -> Unit,
|
||||||
initMethodName?.let { bd.initMethodName = initMethodName }
|
initMethodName?.let { bd.initMethodName = initMethodName }
|
||||||
destroyMethodName?.let { bd.destroyMethodName = destroyMethodName }
|
destroyMethodName?.let { bd.destroyMethodName = destroyMethodName }
|
||||||
description?.let { bd.description = description }
|
description?.let { bd.description = description }
|
||||||
bd.role = role.ordinal
|
role?. let { bd.role = role.ordinal }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue