Spring Support: Support "Autowired members defined in invalid Spring bean" inspection on Kotlin declarations
#KT-12079 Fixed
This commit is contained in:
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
<problems>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>9</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Autowired members defined in invalid Spring bean (Kotlin)</problem_class>
|
||||
<description>Autowired members must be defined in valid Spring bean (@Component|@Service|...)</description>
|
||||
</problem>
|
||||
</problems>
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.spring.inspections.SpringKotlinAutowiredMembersInspection
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
// WITH_RUNTIME
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.web.context.support.SpringBeanAutowiringSupport
|
||||
|
||||
open class KtBean1 {
|
||||
@Autowired var foo: Int = 1
|
||||
}
|
||||
|
||||
@Component
|
||||
open class KtBean2 {
|
||||
@Autowired var foo: Int = 1
|
||||
}
|
||||
|
||||
open class KtBean3 : SpringBeanAutowiringSupport() {
|
||||
@Autowired var foo: Int = 1
|
||||
}
|
||||
Reference in New Issue
Block a user