Spring Support: Support @Transactional annotation in "Make annotated declaration open" inspection

This commit is contained in:
Alexey Sedunov
2016-04-06 18:13:31 +03:00
parent 119cf0f0cd
commit 905ca21799
5 changed files with 109 additions and 11 deletions
@@ -1,7 +1,7 @@
<problems>
<problem>
<file>test.kt</file>
<line>18</line>
<line>22</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>
@@ -9,7 +9,7 @@
</problem>
<problem>
<file>test.kt</file>
<line>21</line>
<line>25</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>
@@ -17,7 +17,7 @@
</problem>
<problem>
<file>test.kt</file>
<line>32</line>
<line>36</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>
@@ -25,7 +25,7 @@
</problem>
<problem>
<file>test.kt</file>
<line>41</line>
<line>45</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>
@@ -33,7 +33,7 @@
</problem>
<problem>
<file>test.kt</file>
<line>44</line>
<line>48</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>
@@ -41,7 +41,7 @@
</problem>
<problem>
<file>test.kt</file>
<line>47</line>
<line>51</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>
@@ -49,7 +49,7 @@
</problem>
<problem>
<file>test.kt</file>
<line>50</line>
<line>54</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>
@@ -57,7 +57,7 @@
</problem>
<problem>
<file>test.kt</file>
<line>55</line>
<line>59</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>
@@ -65,10 +65,66 @@
</problem>
<problem>
<file>test.kt</file>
<line>58</line>
<line>62</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>74</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>@Transactional class should be declared open</description>
</problem>
<problem>
<file>test.kt</file>
<line>76</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>@Transactional function should be declared open</description>
</problem>
<problem>
<file>test.kt</file>
<line>79</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>@Transactional function should be declared open</description>
</problem>
<problem>
<file>test.kt</file>
<line>82</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>@Transactional function should be declared open</description>
</problem>
<problem>
<file>test.kt</file>
<line>85</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>@Transactional function should be declared open</description>
</problem>
<problem>
<file>test.kt</file>
<line>91</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>@Transactional function should be declared open</description>
</problem>
<problem>
<file>test.kt</file>
<line>94</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>@Transactional function should be declared open</description>
</problem>
</problems>
@@ -5,6 +5,7 @@ import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration
import org.springframework.stereotype.Component
import org.springframework.transaction.annotation.Transactional
@Configuration
annotation class MyConfiguration
@@ -12,6 +13,9 @@ annotation class MyConfiguration
@Bean
annotation class MyBean
@Transactional
annotation class MyTransactional
// @Configuration
@Configuration
@@ -62,4 +66,36 @@ open class Utils2 {
@MyBean
open fun foo4() = Component4()
}
// @Transactional
@Transactional
class Trans1 {
@Transactional
fun foo1() = Component1()
@MyTransactional
fun foo2() = Component2()
@Transactional
open fun foo3() = Component3()
@MyTransactional
open fun foo4() = Component4()
}
@Transactional
open class Trans2 {
@Transactional
fun foo1() = Component1()
@MyTransactional
fun foo2() = Component2()
@Transactional
open fun foo3() = Component3()
@MyTransactional
open fun foo4() = Component4()
}