diff --git a/plugins/kotlin/base/resources/resources-en/messages/KotlinBundle.properties b/plugins/kotlin/base/resources/resources-en/messages/KotlinBundle.properties index 783044b6a56a..b209413a1ee3 100644 --- a/plugins/kotlin/base/resources/resources-en/messages/KotlinBundle.properties +++ b/plugins/kotlin/base/resources/resources-en/messages/KotlinBundle.properties @@ -1843,7 +1843,8 @@ to.raw.string.literal=To raw string literal remove.underscores=Remove underscores add.underscores=Add underscores excluded.methods=Excluded methods -use.of.0.method.instead.of.property.access.syntax=Use of {0} method instead of property access syntax +use.of.getter.method.instead.of.property.access.syntax=Use of getter method instead of property access syntax +use.of.setter.method.instead.of.property.access.syntax=Use of setter method instead of property access syntax use.property.access.syntax=Use property access syntax convert.to.object.declaration=Convert to object declaration comment=Comment diff --git a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/intentions/UsePropertyAccessSyntaxIntention.kt b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/intentions/UsePropertyAccessSyntaxIntention.kt index 88b32fe4c610..458c1476afac 100644 --- a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/intentions/UsePropertyAccessSyntaxIntention.kt +++ b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/intentions/UsePropertyAccessSyntaxIntention.kt @@ -94,12 +94,11 @@ class UsePropertyAccessSyntaxInspection : IntentionBasedInspection "getter" - 1 -> "setter" - else -> null + return when (element.valueArguments.size) { + 0 -> KotlinBundle.message("use.of.getter.method.instead.of.property.access.syntax") + 1 -> KotlinBundle.message("use.of.setter.method.instead.of.property.access.syntax") + else -> error("getter or setter arg length can't be !in 0..1") } - return KotlinBundle.message("use.of.0.method.instead.of.property.access.syntax", accessor.toString()) } }