[RESTORED] Spring Support: Inspection for final Spring-annotated classes/functions
#KT-11098 Fixed
This commit is contained in:
idea/testData/ultimateInspections/spring/finalSpringAnnotatedDeclaration/inspectionData/expected.xml
Vendored
+74
@@ -0,0 +1,74 @@
|
||||
<problems>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>18</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Final Kotlin class or function with Spring annotation</problem_class>
|
||||
<description>@Configuration class should be declared open</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>21</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Final Kotlin class or function with Spring annotation</problem_class>
|
||||
<description>@Configuration class should be declared open</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>32</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Final Kotlin class or function with Spring annotation</problem_class>
|
||||
<description>@Component class should be declared open</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>41</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Final Kotlin class or function with Spring annotation</problem_class>
|
||||
<description>@Bean function should be declared open</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>44</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Final Kotlin class or function with Spring annotation</problem_class>
|
||||
<description>@Bean function should be declared open</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>47</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Final Kotlin class or function with Spring annotation</problem_class>
|
||||
<description>@Bean function should be declared open</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>50</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Final Kotlin class or function with Spring annotation</problem_class>
|
||||
<description>@Bean function should be declared open</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>55</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Final Kotlin class or function with Spring annotation</problem_class>
|
||||
<description>@Bean function should be declared open</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>58</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Final Kotlin class or function with Spring annotation</problem_class>
|
||||
<description>@Bean function should be declared open</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.spring.inspections.KotlinFinalClassOrFunSpringInspection
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
|
||||
// WITH_RUNTIME
|
||||
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.ComponentScan
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Configuration
|
||||
annotation class MyConfiguration
|
||||
|
||||
@Bean
|
||||
annotation class MyBean
|
||||
|
||||
// @Configuration
|
||||
|
||||
@Configuration
|
||||
class Application1
|
||||
|
||||
@MyConfiguration
|
||||
class Application2
|
||||
|
||||
@Configuration
|
||||
open class Application3
|
||||
|
||||
@MyConfiguration
|
||||
open class Application4
|
||||
|
||||
// @Component
|
||||
|
||||
@Component
|
||||
class Component1
|
||||
|
||||
@Component
|
||||
open class Component2
|
||||
|
||||
// @Bean
|
||||
|
||||
class Utils1 {
|
||||
@Bean
|
||||
fun foo1() = Component1()
|
||||
|
||||
@MyBean
|
||||
fun foo2() = Component2()
|
||||
|
||||
@Bean
|
||||
open fun foo3() = Component3()
|
||||
|
||||
@MyBean
|
||||
open fun foo4() = Component4()
|
||||
}
|
||||
|
||||
open class Utils2 {
|
||||
@Bean
|
||||
fun foo1() = Component1()
|
||||
|
||||
@MyBean
|
||||
fun foo2() = Component2()
|
||||
|
||||
@Bean
|
||||
open fun foo3() = Component3()
|
||||
|
||||
@MyBean
|
||||
open fun foo4() = Component4()
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.spring.inspections.KotlinFinalClassOrFunSpringInspection
|
||||
idea/testData/ultimateQuickFixes/spring/finalSpringAnnotatedDeclaration/classWithComponentRuntime.kt
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// "Make class Bean open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class <caret>Bean
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Make class Bean open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
open class <caret>Bean
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Make class Application open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@Configuration
|
||||
class <caret>Application
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Make class Application open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@Configuration
|
||||
open class <caret>Application
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Make class Application open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@Configuration
|
||||
annotation class MyConfiguration
|
||||
|
||||
@MyConfiguration
|
||||
class <caret>Application
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Make class Application open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@Configuration
|
||||
annotation class MyConfiguration
|
||||
|
||||
@MyConfiguration
|
||||
open class <caret>Application
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Make function foo open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.context.annotation.Bean
|
||||
|
||||
class Foo {
|
||||
@Bean
|
||||
fun <caret>foo() = ""
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Make function foo open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.context.annotation.Bean
|
||||
|
||||
open class Foo {
|
||||
@Bean
|
||||
open fun <caret>foo() = ""
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Make function foo open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.context.annotation.Bean
|
||||
|
||||
open class Foo {
|
||||
@Bean
|
||||
fun <caret>foo() = ""
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Make function foo open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.context.annotation.Bean
|
||||
|
||||
open class Foo {
|
||||
@Bean
|
||||
open fun <caret>foo() = ""
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Make function foo open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.context.annotation.Bean
|
||||
|
||||
@Bean
|
||||
annotation class MyBean
|
||||
|
||||
class Foo {
|
||||
@MyBean
|
||||
fun <caret>foo() = ""
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Make function foo open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.context.annotation.Bean
|
||||
|
||||
@Bean
|
||||
annotation class MyBean
|
||||
|
||||
open class Foo {
|
||||
@MyBean
|
||||
open fun <caret>foo() = ""
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Make function foo open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.context.annotation.Bean
|
||||
|
||||
@Bean
|
||||
annotation class MyBean
|
||||
|
||||
open class Foo {
|
||||
@MyBean
|
||||
fun <caret>foo() = ""
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Make function foo open" "true"
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// DISABLE-ERRORS
|
||||
import org.springframework.context.annotation.Bean
|
||||
|
||||
@Bean
|
||||
annotation class MyBean
|
||||
|
||||
open class Foo {
|
||||
@MyBean
|
||||
open fun <caret>foo() = ""
|
||||
}
|
||||
Reference in New Issue
Block a user