Fix tests broken by enhanced RedundantSamConstructor inspection
- The inspection now works in more cases, so the test data had to be updated accordingly
This commit is contained in:
committed by
Roman Golyshev
parent
22a5bc4144
commit
4042214bb2
+77
@@ -15,6 +15,17 @@
|
||||
<problem_class severity="WARNING" attribute_key="WEAK_WARNING">Redundant SAM-constructors</problem_class>
|
||||
<description>Redundant SAM-constructor</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>redundantSamConstructor.kt</file>
|
||||
<line>12</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="method" FQNAME="redundantSamConstructor.RedundantSamConstructorKt void test()" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant SAM constructor</problem_class>
|
||||
<description>Redundant SAM-constructor</description>
|
||||
<highlighted_element>Runnable</highlighted_element>
|
||||
<offset>37</offset>
|
||||
<length>8</length>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>redundantSamConstructor.kt</file>
|
||||
<line>22</line>
|
||||
@@ -39,6 +50,17 @@
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant SAM-constructor</problem_class>
|
||||
<description>Redundant SAM-constructor</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>redundantSamConstructor.kt</file>
|
||||
<line>28</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="method" FQNAME="redundantSamConstructor.RedundantSamConstructorKt void test()" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant SAM constructor</problem_class>
|
||||
<description>Redundant SAM-constructor</description>
|
||||
<highlighted_element>Runnable</highlighted_element>
|
||||
<offset>31</offset>
|
||||
<length>8</length>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>redundantSamConstructor.kt</file>
|
||||
<line>38</line>
|
||||
@@ -47,6 +69,17 @@
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant SAM-constructor</problem_class>
|
||||
<description>Redundant SAM-constructor</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>redundantSamConstructor.kt</file>
|
||||
<line>44</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="method" FQNAME="redundantSamConstructor.RedundantSamConstructorKt void test()" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant SAM constructor</problem_class>
|
||||
<description>Redundant SAM-constructor</description>
|
||||
<highlighted_element>Runnable</highlighted_element>
|
||||
<offset>27</offset>
|
||||
<length>8</length>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>redundantSamConstructorWithGenericsInReturnType.kt</file>
|
||||
<line>9</line>
|
||||
@@ -63,6 +96,17 @@
|
||||
<problem_class severity="WARNING" attribute_key="WEAK_WARNING">Redundant SAM-constructors</problem_class>
|
||||
<description>Redundant SAM-constructor</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>redundantSamConstructorWithGenericsInReturnType.kt</file>
|
||||
<line>12</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="method" FQNAME="redundantSamConstructor.RedundantSamConstructorWithGenericsInReturnTypeKt void testGenericsReturnType()" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant SAM constructor</problem_class>
|
||||
<description>Redundant SAM-constructor</description>
|
||||
<highlighted_element>JFunction0</highlighted_element>
|
||||
<offset>39</offset>
|
||||
<length>10</length>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>redundantSamConstructorWithGenericsInReturnType.kt</file>
|
||||
<line>15</line>
|
||||
@@ -87,6 +131,17 @@
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant SAM-constructor</problem_class>
|
||||
<description>Redundant SAM-constructor</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>redundantSamConstructorWithGenericsInReturnType.kt</file>
|
||||
<line>21</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="method" FQNAME="redundantSamConstructor.RedundantSamConstructorWithGenericsInReturnTypeKt void testGenericsReturnType()" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant SAM constructor</problem_class>
|
||||
<description>Redundant SAM-constructor</description>
|
||||
<highlighted_element>JFunction0</highlighted_element>
|
||||
<offset>31</offset>
|
||||
<length>10</length>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>redundantSamConstructorWithGenericsInReturnType.kt</file>
|
||||
<line>24</line>
|
||||
@@ -173,4 +228,26 @@
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant SAM constructor</problem_class>
|
||||
<description>Redundant SAM-constructor</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>redundantSamConstructorWithGenerics.kt</file>
|
||||
<line>12</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="method" FQNAME="redundantSamConstructor.RedundantSamConstructorWithGenericsKt void testGenerics()" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant SAM constructor</problem_class>
|
||||
<description>Redundant SAM-constructor</description>
|
||||
<highlighted_element>JFunction1<String></highlighted_element>
|
||||
<offset>39</offset>
|
||||
<length>18</length>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>redundantSamConstructorWithGenerics.kt</file>
|
||||
<line>21</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="method" FQNAME="redundantSamConstructor.RedundantSamConstructorWithGenericsKt void testGenerics()" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant SAM constructor</problem_class>
|
||||
<description>Redundant SAM-constructor</description>
|
||||
<highlighted_element>JFunction1<String></highlighted_element>
|
||||
<offset>31</offset>
|
||||
<length>18</length>
|
||||
</problem>
|
||||
</problems>
|
||||
Vendored
+7
-2
@@ -9,7 +9,7 @@ fun test() {
|
||||
MyJavaClass.staticFun1({ })
|
||||
MyJavaClass.staticFun1(runnable)
|
||||
MyJavaClass.staticFun2({ }, { })
|
||||
MyJavaClass.staticFun2(runnable, Runnable { })
|
||||
MyJavaClass.staticFun2(runnable, { })
|
||||
MyJavaClass.staticFun2({ }, { })
|
||||
MyJavaClass.staticFun2(
|
||||
object: Runnable {
|
||||
@@ -25,7 +25,7 @@ fun test() {
|
||||
klass.memberFun1({ })
|
||||
klass.memberFun1(runnable)
|
||||
klass.memberFun2({ }, { })
|
||||
klass.memberFun2(runnable, Runnable { })
|
||||
klass.memberFun2(runnable, { })
|
||||
klass.memberFun2({ }, { })
|
||||
klass.memberFun2(
|
||||
object: Runnable {
|
||||
@@ -40,4 +40,9 @@ fun test() {
|
||||
|
||||
MyJavaClass.staticFunWithOtherParam(1, { })
|
||||
klass.memberFun1({ })
|
||||
|
||||
MyJavaClass.staticFun2({ }, Runnable {
|
||||
if (p > 0) return@Runnable
|
||||
print(1)
|
||||
})
|
||||
}
|
||||
+2
-2
@@ -9,7 +9,7 @@ fun testGenerics() {
|
||||
GenericClass1.staticFun1(JFunction1<String> { })
|
||||
GenericClass1.staticFun1(runnable)
|
||||
GenericClass1.staticFun2(JFunction1<String> { }, JFunction1<String> { })
|
||||
GenericClass1.staticFun2(runnable, JFunction1<String> { })
|
||||
GenericClass1.staticFun2(runnable, { })
|
||||
GenericClass1.staticFun2({ s: String -> }, { s: String -> })
|
||||
|
||||
GenericClass1.staticFunWithOtherParam(1, JFunction1<String> { })
|
||||
@@ -18,7 +18,7 @@ fun testGenerics() {
|
||||
klass.memberFun1(JFunction1<String> { })
|
||||
klass.memberFun1(runnable)
|
||||
klass.memberFun2(JFunction1<String> { }, JFunction1<String> { })
|
||||
klass.memberFun2(runnable, JFunction1<String> { })
|
||||
klass.memberFun2(runnable, { })
|
||||
klass.memberFun2({ s: String -> }, { s: String -> })
|
||||
|
||||
klass.memberFunWithOtherParam(1, JFunction1<String> { })
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ fun testGenericsReturnType() {
|
||||
GenericClass2.staticFun1({ "" })
|
||||
GenericClass2.staticFun1(runnable)
|
||||
GenericClass2.staticFun2({ "" }, { "" })
|
||||
GenericClass2.staticFun2(runnable, JFunction0 { "" })
|
||||
GenericClass2.staticFun2(runnable, { "" })
|
||||
GenericClass2.staticFun2({ -> "" }, { -> "" })
|
||||
|
||||
GenericClass2.staticFunWithOtherParam(1, { "" })
|
||||
@@ -18,7 +18,7 @@ fun testGenericsReturnType() {
|
||||
klass.memberFun1({ "" })
|
||||
klass.memberFun1(runnable)
|
||||
klass.memberFun2({ "" }, { "" })
|
||||
klass.memberFun2(runnable, JFunction0 { "" })
|
||||
klass.memberFun2(runnable, { "" })
|
||||
klass.memberFun2({ -> "" }, { -> "" })
|
||||
|
||||
klass.memberFunWithOtherParam(1, { "" })
|
||||
|
||||
@@ -14,9 +14,4 @@ fun testNonApplicableAmbiguity(p: Int) {
|
||||
if (p > 0) return@Runnable
|
||||
print(1)
|
||||
})
|
||||
|
||||
MyJavaClass.staticFun2(Runnable { }, Runnable {
|
||||
if (p > 0) return@Runnable
|
||||
print(1)
|
||||
})
|
||||
}
|
||||
@@ -40,4 +40,9 @@ fun test() {
|
||||
|
||||
MyJavaClass.staticFunWithOtherParam(1, java.lang.Runnable { })
|
||||
klass.memberFun1(java.lang.Runnable { })
|
||||
|
||||
MyJavaClass.staticFun2(Runnable { }, Runnable {
|
||||
if (p > 0) return@Runnable
|
||||
print(1)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user