diff --git a/idea/resources/intentionDescriptions/ReplaceWithOperatorAssignmentIntention/after.kt.template b/idea/resources/intentionDescriptions/ReplaceWithOperatorAssignmentIntention/after.kt.template
deleted file mode 100644
index 7e28488958f..00000000000
--- a/idea/resources/intentionDescriptions/ReplaceWithOperatorAssignmentIntention/after.kt.template
+++ /dev/null
@@ -1,4 +0,0 @@
-fun foo(x: Int) {
- var y = 1
- y += x
-}
\ No newline at end of file
diff --git a/idea/resources/intentionDescriptions/ReplaceWithOperatorAssignmentIntention/before.kt.template b/idea/resources/intentionDescriptions/ReplaceWithOperatorAssignmentIntention/before.kt.template
deleted file mode 100644
index ca45039a136..00000000000
--- a/idea/resources/intentionDescriptions/ReplaceWithOperatorAssignmentIntention/before.kt.template
+++ /dev/null
@@ -1,4 +0,0 @@
-fun foo(x: Int) {
- var y = 1
- y = y + x
-}
\ No newline at end of file
diff --git a/idea/resources/intentionDescriptions/ReplaceWithOperatorAssignmentIntention/description.html b/idea/resources/intentionDescriptions/ReplaceWithOperatorAssignmentIntention/description.html
deleted file mode 100644
index 0736ef904f1..00000000000
--- a/idea/resources/intentionDescriptions/ReplaceWithOperatorAssignmentIntention/description.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-This intention transforms a modification of a variable with a simple assignment into an operation-assignment.
-
-
\ No newline at end of file
diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml
index af00acc586f..e255d6a107a 100644
--- a/idea/src/META-INF/plugin.xml
+++ b/idea/src/META-INF/plugin.xml
@@ -1072,11 +1072,6 @@
Kotlin
-
- org.jetbrains.kotlin.idea.intentions.ReplaceWithOperatorAssignmentIntention
- Kotlin
-
-
org.jetbrains.kotlin.idea.intentions.ReplaceWithOrdinaryAssignmentIntention
Kotlin
@@ -1656,7 +1651,7 @@
language="kotlin"
/>
- (ReplaceWithOperatorAssignmentIntention::class)
+class ReplaceWithOperatorAssignmentInspection : AbstractApplicabilityBasedInspection() {
+ override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean, session: LocalInspectionToolSession): KtVisitorVoid =
+ object : KtVisitorVoid() {
+ override fun visitBinaryExpression(expression: KtBinaryExpression) {
+ super.visitBinaryExpression(expression)
+ visitTargetElement(expression, holder, isOnTheFly)
+ }
+ }
-class ReplaceWithOperatorAssignmentIntention : SelfTargetingOffsetIndependentIntention(KtBinaryExpression::class.java, "Replace with operator-assignment") {
- override fun isApplicableTo(element: KtBinaryExpression): Boolean {
+ override fun isApplicable(element: KtBinaryExpression): Boolean {
if (element.operationToken != KtTokens.EQ) return false
val left = element.left as? KtNameReferenceExpression ?: return false
val right = element.right as? KtBinaryExpression ?: return false
@@ -51,13 +57,18 @@ class ReplaceWithOperatorAssignmentIntention : SelfTargetingOffsetIndependentInt
return newBindingContext.diagnostics.forElement(opAssign.operationReference).isEmpty()
}
+ override fun inspectionText(element: KtBinaryExpression) = "Replaceable with operator-assignment"
+
+ override val defaultFixText = "Replace with operator-assignment"
+
+ override fun fixText(element: KtBinaryExpression) =
+ "Replace with ${element.operationReference.operationSignTokenType?.value}= expression"
+
private fun checkExpressionRepeat(variableExpression: KtNameReferenceExpression, expression: KtBinaryExpression, bindingContext: BindingContext): Boolean {
val descriptor = bindingContext[BindingContext.REFERENCE_TARGET, expression.operationReference]?.containingDeclaration
val isPrimitiveOperation = descriptor is ClassDescriptor && KotlinBuiltIns.isPrimitiveType(descriptor.defaultType)
val operationToken = expression.operationToken
- text = "Replace with ${expression.operationReference.text}= expression"
-
val expressionLeft = expression.left
val expressionRight = expression.right
return when {
@@ -87,8 +98,8 @@ class ReplaceWithOperatorAssignmentIntention : SelfTargetingOffsetIndependentInt
operationToken == KtTokens.DIV ||
operationToken == KtTokens.PERC
- override fun applyTo(element: KtBinaryExpression, editor: Editor?) {
- element.replace(buildOperatorAssignment(element))
+ override fun applyTo(element: PsiElement, project: Project, editor: Editor?) {
+ (element as? KtBinaryExpression)?.replace(buildOperatorAssignment(element))
}
private fun buildOperatorAssignment(element: KtBinaryExpression): KtBinaryExpression {
@@ -100,21 +111,32 @@ class ReplaceWithOperatorAssignmentIntention : SelfTargetingOffsetIndependentInt
return KtPsiFactory(element).createExpression(replacement) as KtBinaryExpression
}
- tailrec private fun buildOperatorAssignmentText(variableExpression: KtNameReferenceExpression, expression: KtBinaryExpression, tail: String): String {
+ private tailrec fun buildOperatorAssignmentText(
+ variableExpression: KtNameReferenceExpression,
+ expression: KtBinaryExpression,
+ tail: String
+ ): String {
val operationText = expression.operationReference.text
val variableName = variableExpression.text
fun String.appendTail() = if (tail.isEmpty()) this else "$this $tail"
return when {
- variableExpression.matches(expression.left) -> "$variableName $operationText= ${expression.right!!.text}".appendTail()
+ variableExpression.matches(expression.left) ->
+ "$variableName $operationText= ${expression.right!!.text}".appendTail()
- variableExpression.matches(expression.right) -> "$variableName $operationText= ${expression.left!!.text}".appendTail()
+ variableExpression.matches(expression.right) ->
+ "$variableName $operationText= ${expression.left!!.text}".appendTail()
expression.left is KtBinaryExpression ->
- buildOperatorAssignmentText(variableExpression, expression.left as KtBinaryExpression, "$operationText ${expression.right!!.text}".appendTail())
+ buildOperatorAssignmentText(
+ variableExpression,
+ expression.left as KtBinaryExpression,
+ "$operationText ${expression.right!!.text}".appendTail()
+ )
- else -> tail
+ else ->
+ tail
}
}
}
diff --git a/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/.inspection b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/.inspection
new file mode 100644
index 00000000000..0131ed75866
--- /dev/null
+++ b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/.inspection
@@ -0,0 +1 @@
+org.jetbrains.kotlin.idea.inspections.ReplaceWithOperatorAssignmentInspection
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/flexibleTypeBug.kt b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/flexibleTypeBug.kt
similarity index 86%
rename from idea/testData/intentions/replaceWithOperatorAssignment/flexibleTypeBug.kt
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/flexibleTypeBug.kt
index d83ae3480bc..f8156b76dab 100644
--- a/idea/testData/intentions/replaceWithOperatorAssignment/flexibleTypeBug.kt
+++ b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/flexibleTypeBug.kt
@@ -1,4 +1,4 @@
-// IS_APPLICABLE: false
+// PROBLEM: none
// WITH_RUNTIME
fun foo() {
var list1 = java.util.Collections.emptyList()
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/illegalMultipleOperators.kt b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/illegalMultipleOperators.kt
similarity index 68%
rename from idea/testData/intentions/replaceWithOperatorAssignment/illegalMultipleOperators.kt
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/illegalMultipleOperators.kt
index 2adf22e0c02..a9a9bf0eba8 100644
--- a/idea/testData/intentions/replaceWithOperatorAssignment/illegalMultipleOperators.kt
+++ b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/illegalMultipleOperators.kt
@@ -1,4 +1,4 @@
-// IS_APPLICABLE: false
+// PROBLEM: none
fun foo() {
var x = 0
x = x / 1 + 1
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/illegalMultipleOperatorsMiddle.kt b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/illegalMultipleOperatorsMiddle.kt
similarity index 73%
rename from idea/testData/intentions/replaceWithOperatorAssignment/illegalMultipleOperatorsMiddle.kt
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/illegalMultipleOperatorsMiddle.kt
index 16835e68df3..caee21b2164 100644
--- a/idea/testData/intentions/replaceWithOperatorAssignment/illegalMultipleOperatorsMiddle.kt
+++ b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/illegalMultipleOperatorsMiddle.kt
@@ -1,4 +1,4 @@
-// IS_APPLICABLE: false
+// PROBLEM: none
fun foo() {
var x = 0
val y = 0
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/invalidSubtraction.kt b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/invalidSubtraction.kt
similarity index 66%
rename from idea/testData/intentions/replaceWithOperatorAssignment/invalidSubtraction.kt
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/invalidSubtraction.kt
index 092f0ee8568..51c4938384c 100644
--- a/idea/testData/intentions/replaceWithOperatorAssignment/invalidSubtraction.kt
+++ b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/invalidSubtraction.kt
@@ -1,4 +1,4 @@
-// IS_APPLICABLE: false
+// PROBLEM: none
fun foo() {
var x = 0
x = 1 - x
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/multipleOperators.kt b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/multipleOperators.kt
similarity index 100%
rename from idea/testData/intentions/replaceWithOperatorAssignment/multipleOperators.kt
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/multipleOperators.kt
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/multipleOperators.kt.after b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/multipleOperators.kt.after
similarity index 100%
rename from idea/testData/intentions/replaceWithOperatorAssignment/multipleOperators.kt.after
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/multipleOperators.kt.after
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/multipleOperatorsRightSideRepeat.kt b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/multipleOperatorsRightSideRepeat.kt
similarity index 100%
rename from idea/testData/intentions/replaceWithOperatorAssignment/multipleOperatorsRightSideRepeat.kt
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/multipleOperatorsRightSideRepeat.kt
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/multipleOperatorsRightSideRepeat.kt.after b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/multipleOperatorsRightSideRepeat.kt.after
similarity index 100%
rename from idea/testData/intentions/replaceWithOperatorAssignment/multipleOperatorsRightSideRepeat.kt.after
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/multipleOperatorsRightSideRepeat.kt.after
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/nonCommutativeRepeat.kt b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/nonCommutativeRepeat.kt
similarity index 68%
rename from idea/testData/intentions/replaceWithOperatorAssignment/nonCommutativeRepeat.kt
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/nonCommutativeRepeat.kt
index e8029e6c30d..2f14693bacb 100644
--- a/idea/testData/intentions/replaceWithOperatorAssignment/nonCommutativeRepeat.kt
+++ b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/nonCommutativeRepeat.kt
@@ -1,4 +1,4 @@
-// IS_APPLICABLE: false
+// PROBLEM: none
fun foo() {
var x = 0
x = x - 1 - 1
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/nonRepeatingAssignment.kt b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/nonRepeatingAssignment.kt
similarity index 76%
rename from idea/testData/intentions/replaceWithOperatorAssignment/nonRepeatingAssignment.kt
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/nonRepeatingAssignment.kt
index c7ca185f721..b958422cc95 100644
--- a/idea/testData/intentions/replaceWithOperatorAssignment/nonRepeatingAssignment.kt
+++ b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/nonRepeatingAssignment.kt
@@ -1,4 +1,4 @@
-// IS_APPLICABLE: false
+// PROBLEM: none
fun foo() {
var x = 0
val y = 0
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/plusAssignConflict.kt b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/plusAssignConflict.kt
similarity index 86%
rename from idea/testData/intentions/replaceWithOperatorAssignment/plusAssignConflict.kt
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/plusAssignConflict.kt
index cc8a92200c3..4fcecfc9cf3 100644
--- a/idea/testData/intentions/replaceWithOperatorAssignment/plusAssignConflict.kt
+++ b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/plusAssignConflict.kt
@@ -1,4 +1,4 @@
-// IS_APPLICABLE: false
+// PROBLEM: none
class A
operator fun A.plus(a: A): A = A()
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/rightSideRepeat.kt b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/rightSideRepeat.kt
similarity index 100%
rename from idea/testData/intentions/replaceWithOperatorAssignment/rightSideRepeat.kt
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/rightSideRepeat.kt
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/rightSideRepeat.kt.after b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/rightSideRepeat.kt.after
similarity index 100%
rename from idea/testData/intentions/replaceWithOperatorAssignment/rightSideRepeat.kt.after
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/rightSideRepeat.kt.after
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/simpleAssign.kt b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/simpleAssign.kt
similarity index 100%
rename from idea/testData/intentions/replaceWithOperatorAssignment/simpleAssign.kt
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/simpleAssign.kt
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/simpleAssign.kt.after b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/simpleAssign.kt.after
similarity index 100%
rename from idea/testData/intentions/replaceWithOperatorAssignment/simpleAssign.kt.after
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/simpleAssign.kt.after
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/validSubtraction.kt b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/validSubtraction.kt
similarity index 100%
rename from idea/testData/intentions/replaceWithOperatorAssignment/validSubtraction.kt
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/validSubtraction.kt
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/validSubtraction.kt.after b/idea/testData/inspectionsLocal/replaceWithOperatorAssignment/validSubtraction.kt.after
similarity index 100%
rename from idea/testData/intentions/replaceWithOperatorAssignment/validSubtraction.kt.after
rename to idea/testData/inspectionsLocal/replaceWithOperatorAssignment/validSubtraction.kt.after
diff --git a/idea/testData/intentions/replaceWithOperatorAssignment/.intention b/idea/testData/intentions/replaceWithOperatorAssignment/.intention
deleted file mode 100644
index bc246c96d59..00000000000
--- a/idea/testData/intentions/replaceWithOperatorAssignment/.intention
+++ /dev/null
@@ -1 +0,0 @@
-org.jetbrains.kotlin.idea.intentions.ReplaceWithOperatorAssignmentIntention
diff --git a/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java
index 51b8d5b14a0..e1f018a6cbe 100644
--- a/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java
+++ b/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java
@@ -3294,6 +3294,87 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
}
}
+ @TestMetadata("idea/testData/inspectionsLocal/replaceWithOperatorAssignment")
+ @TestDataPath("$PROJECT_ROOT")
+ @RunWith(JUnit3RunnerWithInners.class)
+ public static class ReplaceWithOperatorAssignment extends AbstractLocalInspectionTest {
+ public void testAllFilesPresentInReplaceWithOperatorAssignment() throws Exception {
+ KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/inspectionsLocal/replaceWithOperatorAssignment"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), TargetBackend.ANY, true);
+ }
+
+ @TestMetadata("flexibleTypeBug.kt")
+ public void testFlexibleTypeBug() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceWithOperatorAssignment/flexibleTypeBug.kt");
+ doTest(fileName);
+ }
+
+ @TestMetadata("illegalMultipleOperators.kt")
+ public void testIllegalMultipleOperators() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceWithOperatorAssignment/illegalMultipleOperators.kt");
+ doTest(fileName);
+ }
+
+ @TestMetadata("illegalMultipleOperatorsMiddle.kt")
+ public void testIllegalMultipleOperatorsMiddle() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceWithOperatorAssignment/illegalMultipleOperatorsMiddle.kt");
+ doTest(fileName);
+ }
+
+ @TestMetadata("invalidSubtraction.kt")
+ public void testInvalidSubtraction() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceWithOperatorAssignment/invalidSubtraction.kt");
+ doTest(fileName);
+ }
+
+ @TestMetadata("multipleOperators.kt")
+ public void testMultipleOperators() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceWithOperatorAssignment/multipleOperators.kt");
+ doTest(fileName);
+ }
+
+ @TestMetadata("multipleOperatorsRightSideRepeat.kt")
+ public void testMultipleOperatorsRightSideRepeat() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceWithOperatorAssignment/multipleOperatorsRightSideRepeat.kt");
+ doTest(fileName);
+ }
+
+ @TestMetadata("nonCommutativeRepeat.kt")
+ public void testNonCommutativeRepeat() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceWithOperatorAssignment/nonCommutativeRepeat.kt");
+ doTest(fileName);
+ }
+
+ @TestMetadata("nonRepeatingAssignment.kt")
+ public void testNonRepeatingAssignment() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceWithOperatorAssignment/nonRepeatingAssignment.kt");
+ doTest(fileName);
+ }
+
+ @TestMetadata("plusAssignConflict.kt")
+ public void testPlusAssignConflict() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceWithOperatorAssignment/plusAssignConflict.kt");
+ doTest(fileName);
+ }
+
+ @TestMetadata("rightSideRepeat.kt")
+ public void testRightSideRepeat() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceWithOperatorAssignment/rightSideRepeat.kt");
+ doTest(fileName);
+ }
+
+ @TestMetadata("simpleAssign.kt")
+ public void testSimpleAssign() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceWithOperatorAssignment/simpleAssign.kt");
+ doTest(fileName);
+ }
+
+ @TestMetadata("validSubtraction.kt")
+ public void testValidSubtraction() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceWithOperatorAssignment/validSubtraction.kt");
+ doTest(fileName);
+ }
+ }
+
@TestMetadata("idea/testData/inspectionsLocal/selfAssignment")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
diff --git a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java
index b09f2a33552..f595d62cfa4 100644
--- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java
+++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java
@@ -14154,87 +14154,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
}
}
- @TestMetadata("idea/testData/intentions/replaceWithOperatorAssignment")
- @TestDataPath("$PROJECT_ROOT")
- @RunWith(JUnit3RunnerWithInners.class)
- public static class ReplaceWithOperatorAssignment extends AbstractIntentionTest {
- public void testAllFilesPresentInReplaceWithOperatorAssignment() throws Exception {
- KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/replaceWithOperatorAssignment"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), TargetBackend.ANY, true);
- }
-
- @TestMetadata("flexibleTypeBug.kt")
- public void testFlexibleTypeBug() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceWithOperatorAssignment/flexibleTypeBug.kt");
- doTest(fileName);
- }
-
- @TestMetadata("illegalMultipleOperators.kt")
- public void testIllegalMultipleOperators() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceWithOperatorAssignment/illegalMultipleOperators.kt");
- doTest(fileName);
- }
-
- @TestMetadata("illegalMultipleOperatorsMiddle.kt")
- public void testIllegalMultipleOperatorsMiddle() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceWithOperatorAssignment/illegalMultipleOperatorsMiddle.kt");
- doTest(fileName);
- }
-
- @TestMetadata("invalidSubtraction.kt")
- public void testInvalidSubtraction() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceWithOperatorAssignment/invalidSubtraction.kt");
- doTest(fileName);
- }
-
- @TestMetadata("multipleOperators.kt")
- public void testMultipleOperators() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceWithOperatorAssignment/multipleOperators.kt");
- doTest(fileName);
- }
-
- @TestMetadata("multipleOperatorsRightSideRepeat.kt")
- public void testMultipleOperatorsRightSideRepeat() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceWithOperatorAssignment/multipleOperatorsRightSideRepeat.kt");
- doTest(fileName);
- }
-
- @TestMetadata("nonCommutativeRepeat.kt")
- public void testNonCommutativeRepeat() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceWithOperatorAssignment/nonCommutativeRepeat.kt");
- doTest(fileName);
- }
-
- @TestMetadata("nonRepeatingAssignment.kt")
- public void testNonRepeatingAssignment() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceWithOperatorAssignment/nonRepeatingAssignment.kt");
- doTest(fileName);
- }
-
- @TestMetadata("plusAssignConflict.kt")
- public void testPlusAssignConflict() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceWithOperatorAssignment/plusAssignConflict.kt");
- doTest(fileName);
- }
-
- @TestMetadata("rightSideRepeat.kt")
- public void testRightSideRepeat() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceWithOperatorAssignment/rightSideRepeat.kt");
- doTest(fileName);
- }
-
- @TestMetadata("simpleAssign.kt")
- public void testSimpleAssign() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceWithOperatorAssignment/simpleAssign.kt");
- doTest(fileName);
- }
-
- @TestMetadata("validSubtraction.kt")
- public void testValidSubtraction() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceWithOperatorAssignment/validSubtraction.kt");
- doTest(fileName);
- }
- }
-
@TestMetadata("idea/testData/intentions/replaceWithOrdinaryAssignment")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)