-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed as not planned
Closed as not planned
Copy link
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: invalidAn issue that we don't feel is validAn issue that we don't feel is validtheme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin support
Description
kotlinVersion = "1.3.21"
springBootVersion = '2.1.3.RELEASE'
Following code throws an exception breaking context setup:
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.SpringBootConfiguration
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.context.annotation.ComponentScan
import org.springframework.stereotype.Component
@SpringBootConfiguration
@ComponentScan
class MyConfig{
@Component
inner class BeanB {
fun print() {
println("beanB")
}
}
}
@SpringBootTest
class KotlinTest {
@Autowired
lateinit var beanB: MyConfig.BeanB
@Test
fun a() {
beanB.print()
}
}
The error is:
Error creating bean with name kotlin.MyConfig$BeanB'
...
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:705)
When translating and running the snippet on Java everything works as expected.
ToxicMushroom and MrTomato
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: invalidAn issue that we don't feel is validAn issue that we don't feel is validtheme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin support