mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
KtI18NInspectionTest.testPropertyAssignment: superclass test (IDEA-247547)
GitOrigin-RevId: 4378e2d8c8f18e46b66b71ebbdb865c0fac7d5d5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
67615a6edb
commit
417a4cdf60
+22
-4
@@ -96,13 +96,14 @@ class KtI18NInspectionTest : LightJavaCodeInsightFixtureTestCase() {
|
||||
|native void setFoo(@org.jetbrains.annotations.Nls String s);
|
||||
|}""".trimMargin())
|
||||
myFixture.configureByText("Foo.kt", """
|
||||
class Foo {
|
||||
class Foo : X() {
|
||||
@org.jetbrains.annotations.Nls var prop = "";
|
||||
|
||||
fun foo(x : X) {
|
||||
// but Kotlin properties do not propagate annotations to getter ultra-light method
|
||||
prop = <warning descr="Hardcoded string literal: \"value\"">"value"</warning>
|
||||
x.foo = <warning descr="Hardcoded string literal: \"value\"">"value"</warning>
|
||||
prop = <warning descr="Hardcoded string literal: \"kotlin setter\"">"kotlin setter"</warning>
|
||||
x.foo = <warning descr="Hardcoded string literal: \"java qualified setter\"">"java qualified setter"</warning>
|
||||
foo = "java superclass setter"
|
||||
this.foo = "java superclass qualified setter"
|
||||
}
|
||||
}
|
||||
""".trimIndent())
|
||||
@@ -218,6 +219,23 @@ class KtI18NInspectionTest : LightJavaCodeInsightFixtureTestCase() {
|
||||
myFixture.testHighlighting()
|
||||
}
|
||||
|
||||
fun testList() {
|
||||
myFixture.enableInspections(I18nInspection())
|
||||
myFixture.configureByText("Foo.kt", """
|
||||
import org.jetbrains.annotations.*
|
||||
import java.util.*
|
||||
|
||||
public fun <T> listOf(vararg elements: T): List<T> = Arrays.asList(*elements)
|
||||
|
||||
class X {
|
||||
companion object {
|
||||
@NonNls private val LIST: List<String> = listOf("Foo bar", "Boo far")
|
||||
}
|
||||
}
|
||||
""".trimIndent())
|
||||
myFixture.testHighlighting()
|
||||
}
|
||||
|
||||
fun testCompareWithNonNls() {
|
||||
myFixture.enableInspections(I18nInspection())
|
||||
myFixture.addClass("public interface Y {@org.jetbrains.annotations.NonNls String getNonNls();}")
|
||||
|
||||
Reference in New Issue
Block a user