From eba859446fd060b95f2d48c7e607b5d528940909 Mon Sep 17 00:00:00 2001 From: Alexey Belkov Date: Fri, 19 May 2023 13:37:07 +0400 Subject: [PATCH] Apply "Kotlin | Assignment can be replaced with operator assignment" on whole project ^KTIJ-25352 GitOrigin-RevId: ed3283325767f207167717ca703a102f4eb50e66 --- .../openapi/projectRoots/impl/jdkDownloader/JdkUpdateTest.kt | 2 +- .../notebooks/visualization/r/inlays/components/HSLUtil.kt | 2 +- .../com/intellij/diff/tools/combined/CombinedDiffBlocks.kt | 2 +- .../com/intellij/internal/ui/uiDslTestAction/OnChangePanel.kt | 2 +- .../src/com/intellij/toolWindow/ToolWindowDragHelper.kt | 2 +- .../impl/jps/serialization/ModuleImlFileEntitiesSerializer.kt | 4 ++-- .../platform/workspaceModel/storage/tests/DiffBuilderTest.kt | 2 +- .../xdebugger/impl/ui/attach/dialog/AttachToProcessDialog.kt | 2 +- .../kotlin/idea/run/StandaloneScriptRunConfigurationTest.kt | 2 +- .../new/src/org/jetbrains/kotlin/nj2k/JavaToJKTreeBuilder.kt | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/java/idea-ui/testSrc/com/intellij/openapi/projectRoots/impl/jdkDownloader/JdkUpdateTest.kt b/java/idea-ui/testSrc/com/intellij/openapi/projectRoots/impl/jdkDownloader/JdkUpdateTest.kt index c0fea44042b8..5c0c0811d62b 100644 --- a/java/idea-ui/testSrc/com/intellij/openapi/projectRoots/impl/jdkDownloader/JdkUpdateTest.kt +++ b/java/idea-ui/testSrc/com/intellij/openapi/projectRoots/impl/jdkDownloader/JdkUpdateTest.kt @@ -181,7 +181,7 @@ class JdkUpdateTest : BareTestFixtureTestCase() { Assert.assertEquals(1, listOurActions().size) runWriteAction { - old1.jdk.sdkModificator.also { it.homePath = it.homePath + "-123" }.commitChanges() + old1.jdk.sdkModificator.also { it.homePath += "-123" }.commitChanges() } service().showNotification(old1.jdk, old1.oldItem, old1.newItem) diff --git a/notebooks/visualization/src/org/jetbrains/plugins/notebooks/visualization/r/inlays/components/HSLUtil.kt b/notebooks/visualization/src/org/jetbrains/plugins/notebooks/visualization/r/inlays/components/HSLUtil.kt index 415cb7643f85..6e1481e2d10f 100644 --- a/notebooks/visualization/src/org/jetbrains/plugins/notebooks/visualization/r/inlays/components/HSLUtil.kt +++ b/notebooks/visualization/src/org/jetbrains/plugins/notebooks/visualization/r/inlays/components/HSLUtil.kt @@ -67,7 +67,7 @@ fun convertHSLtoRGB(hslFloats: FloatArray, alpha: Float): Int { throw IllegalArgumentException(message) } // Formula needs all values between 0 - 1. - h = h % 360.0f + h %= 360.0f h /= 360f s /= 100f l /= 100f diff --git a/platform/diff-impl/src/com/intellij/diff/tools/combined/CombinedDiffBlocks.kt b/platform/diff-impl/src/com/intellij/diff/tools/combined/CombinedDiffBlocks.kt index 3a952f6b62d1..28c78435d2a0 100644 --- a/platform/diff-impl/src/com/intellij/diff/tools/combined/CombinedDiffBlocks.kt +++ b/platform/diff-impl/src/com/intellij/diff/tools/combined/CombinedDiffBlocks.kt @@ -205,7 +205,7 @@ private class CombinedSimpleDiffBlock(project: Project, someError = maxOf(e.gutterComponentEx.preferredSize.height - body.targetComponent.preferredSize.height, someError) } if (someError > 0) { - preferredSize.height = preferredSize.height + someError + preferredSize.height += someError } return preferredSize } diff --git a/platform/platform-impl/src/com/intellij/internal/ui/uiDslTestAction/OnChangePanel.kt b/platform/platform-impl/src/com/intellij/internal/ui/uiDslTestAction/OnChangePanel.kt index fe1cfd3e0249..e30fbdab9a11 100644 --- a/platform/platform-impl/src/com/intellij/internal/ui/uiDslTestAction/OnChangePanel.kt +++ b/platform/platform-impl/src/com/intellij/internal/ui/uiDslTestAction/OnChangePanel.kt @@ -83,6 +83,6 @@ internal class OnChangePanel { private fun log(component: JComponent, context: ChangeContext, text: String? = null) { val textLog = if (text == null) "" else "($text)" - log.text = log.text + "component = ${component::class.java.name}$textLog, binding = ${context.binding}, event: ${context.event}\n" + log.text += "component = ${component::class.java.name}$textLog, binding = ${context.binding}, event: ${context.event}\n" } } \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/toolWindow/ToolWindowDragHelper.kt b/platform/platform-impl/src/com/intellij/toolWindow/ToolWindowDragHelper.kt index 111ebef5ad77..1ca0ab7e36d8 100644 --- a/platform/platform-impl/src/com/intellij/toolWindow/ToolWindowDragHelper.kt +++ b/platform/platform-impl/src/com/intellij/toolWindow/ToolWindowDragHelper.kt @@ -290,7 +290,7 @@ internal class ToolWindowDragHelper(parent: Disposable, @JvmField val dragSource else { dragMoreButtonNewSide = LEFT } - bounds.width = bounds.width / 3 + bounds.width /= 3 dropTargetHighlightComponent.bounds = bounds relocateImageDialog(event) return diff --git a/platform/workspaceModel/jps/src/com/intellij/workspaceModel/ide/impl/jps/serialization/ModuleImlFileEntitiesSerializer.kt b/platform/workspaceModel/jps/src/com/intellij/workspaceModel/ide/impl/jps/serialization/ModuleImlFileEntitiesSerializer.kt index ef2a0bf15c0b..27911ab3468d 100644 --- a/platform/workspaceModel/jps/src/com/intellij/workspaceModel/ide/impl/jps/serialization/ModuleImlFileEntitiesSerializer.kt +++ b/platform/workspaceModel/jps/src/com/intellij/workspaceModel/ide/impl/jps/serialization/ModuleImlFileEntitiesSerializer.kt @@ -504,8 +504,8 @@ internal open class ModuleImlFileEntitiesSerializer(internal val modulePath: Mod else { (contentRoot as ContentRootEntity.Builder).apply { - this.sourceRoots = this.sourceRoots + sourceRoots - this.excludedUrls = this.excludedUrls + excludes + this.sourceRoots += sourceRoots + this.excludedUrls += excludes } // Add order of source roots if (sourceRootOrder != null) { diff --git a/platform/workspaceModel/storage/tests/testSrc/com/intellij/platform/workspaceModel/storage/tests/DiffBuilderTest.kt b/platform/workspaceModel/storage/tests/testSrc/com/intellij/platform/workspaceModel/storage/tests/DiffBuilderTest.kt index b7d4fc2822f3..d109df0ca06d 100644 --- a/platform/workspaceModel/storage/tests/testSrc/com/intellij/platform/workspaceModel/storage/tests/DiffBuilderTest.kt +++ b/platform/workspaceModel/storage/tests/testSrc/com/intellij/platform/workspaceModel/storage/tests/DiffBuilderTest.kt @@ -431,7 +431,7 @@ class DiffBuilderTest { val child = source addEntity XChildWithOptionalParentEntity(parentAndChildProperty, MySource) val parent = source addEntity XParentEntity(parentAndChildProperty, MySource) source.modifyEntity(parent) { - this.optionalChildren = this.optionalChildren + child + this.optionalChildren += child } target.addDiff(source) diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/attach/dialog/AttachToProcessDialog.kt b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/attach/dialog/AttachToProcessDialog.kt index 08ad4bf7472f..0dbe5f596a34 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/attach/dialog/AttachToProcessDialog.kt +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/attach/dialog/AttachToProcessDialog.kt @@ -245,7 +245,7 @@ open class AttachToProcessDialog( return } if (isNonPrintable(e.keyCode)) return - filterTextField.text = filterTextField.text + e.keyChar + filterTextField.text += e.keyChar } } list.getFocusedComponent().addKeyListener(keyListener) diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/run/StandaloneScriptRunConfigurationTest.kt b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/run/StandaloneScriptRunConfigurationTest.kt index bac5aacf106f..992a551b3d41 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/run/StandaloneScriptRunConfigurationTest.kt +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/run/StandaloneScriptRunConfigurationTest.kt @@ -128,7 +128,7 @@ class StandaloneScriptRunConfigurationTest : KotlinCodeInsightTestCase() { val runConfiguration = createConfigurationFromElement(script, save = true) as KotlinStandaloneScriptRunConfiguration Assert.assertEquals("script.kts", runConfiguration.name) - runConfiguration.workingDirectory = runConfiguration.workingDirectory + "/customWorkingDirectory" + runConfiguration.workingDirectory += "/customWorkingDirectory" val scriptVirtualFileBefore = script.containingFile.virtualFile val originalPath = scriptVirtualFileBefore.canonicalPath val originalWorkingDirectory = scriptVirtualFileBefore.parent.canonicalPath + "/customWorkingDirectory" diff --git a/plugins/kotlin/j2k/new/src/org/jetbrains/kotlin/nj2k/JavaToJKTreeBuilder.kt b/plugins/kotlin/j2k/new/src/org/jetbrains/kotlin/nj2k/JavaToJKTreeBuilder.kt index 78f1d47e0da4..1df6a5d29c8d 100644 --- a/plugins/kotlin/j2k/new/src/org/jetbrains/kotlin/nj2k/JavaToJKTreeBuilder.kt +++ b/plugins/kotlin/j2k/new/src/org/jetbrains/kotlin/nj2k/JavaToJKTreeBuilder.kt @@ -1215,7 +1215,7 @@ class JavaToJKTreeBuilder( } else -> - cases.lastOrNull()?.also { it.statements = it.statements + statement.toJK() } ?: run { + cases.lastOrNull()?.also { it.statements += statement.toJK() } ?: run { cases += JKJavaClassicLabelSwitchCase( listOf(JKStubExpression()), listOf(statement.toJK())