From d5c12ac5e3ec62454c09f43d2de1ba84236e92da Mon Sep 17 00:00:00 2001 From: "Maxim.Kolmakov" Date: Fri, 7 Feb 2025 01:56:59 +0100 Subject: [PATCH] [ui-tests] Greenify GitOrigin-RevId: c2ade3de9c05ffeb3fd4c5237600c69bd70ac860 --- .../test-sdk/src/com/intellij/driver/sdk/ui/UiText.kt | 7 ++++--- .../intellij/driver/sdk/ui/components/common/JEditorUi.kt | 2 +- .../intellij/driver/sdk/ui/components/elements/JListUI.kt | 2 +- .../src/com/intellij/driver/sdk/ui/remote/Robot.kt | 1 - .../test-sdk/src/com/intellij/driver/sdk/ui/utils.kt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/UiText.kt b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/UiText.kt index 0b19510ab43e..2e83d5685ac8 100644 --- a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/UiText.kt +++ b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/UiText.kt @@ -3,6 +3,7 @@ package com.intellij.driver.sdk.ui import com.intellij.driver.model.TextData import com.intellij.driver.sdk.ui.components.UiComponent import com.intellij.openapi.diagnostic.logger +import java.awt.Point class UiText(private val component: UiComponent, private val textData: TextData) { companion object { @@ -11,9 +12,9 @@ class UiText(private val component: UiComponent, private val textData: TextData) fun List.allText(separator: String = "") = joinToString(separator) { it.text } } - val text get() = textData.text - val point get() = textData.point - val bundleKey get() = textData.bundleKey + val text get(): String = textData.text + val point get(): Point = textData.point + val bundleKey get(): String = textData.bundleKey override fun toString(): String { return "UiText[$text]" diff --git a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/components/common/JEditorUi.kt b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/components/common/JEditorUi.kt index 8b776b5745d0..6c002cc87985 100644 --- a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/components/common/JEditorUi.kt +++ b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/components/common/JEditorUi.kt @@ -291,7 +291,7 @@ data class GutterState( class InlayHint(val offset: Int, val text: String) fun List.getHint(offset: Int): InlayHint { - val foundHint = this.find { it.offset.equals(offset) } + val foundHint = this.find { it.offset == offset } if (foundHint == null) { throw NoSuchElementException("cannot find hint with offset: $offset") } diff --git a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/components/elements/JListUI.kt b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/components/elements/JListUI.kt index 93090913142f..3198856cd8b0 100644 --- a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/components/elements/JListUI.kt +++ b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/components/elements/JListUI.kt @@ -55,7 +55,7 @@ open class JListUiComponent(data: ComponentData) : UiComponent(data) { fun doubleClickItem(itemText: String, fullMatch: Boolean = true) { findItemIndex(itemText, fullMatch)?.let { index -> val cellBounds = getCellBounds(index) - doubleClick(Point(cellBounds.getCenterX().toInt(), cellBounds.getCenterY().toInt())) + doubleClick(Point(cellBounds.centerX.toInt(), cellBounds.centerY.toInt())) } } diff --git a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/remote/Robot.kt b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/remote/Robot.kt index 874f8eacca4a..6935112e40a5 100644 --- a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/remote/Robot.kt +++ b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/remote/Robot.kt @@ -2,7 +2,6 @@ package com.intellij.driver.sdk.ui.remote import com.intellij.driver.client.Remote import com.intellij.driver.model.RemoteMouseButton -import java.awt.Color import java.awt.Point @Remote("com.jetbrains.performancePlugin.remotedriver.robot.SmoothRobot", plugin = REMOTE_ROBOT_MODULE_ID) diff --git a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/utils.kt b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/utils.kt index 234e8c310e14..e5a01abe42f4 100644 --- a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/utils.kt +++ b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/utils.kt @@ -58,7 +58,7 @@ interface SwingUtilities { fun computeDifference(rectA: Rectangle, rectB: Rectangle): Array } -val Rectangle.center get() = Point(getCenterX().toInt(), getCenterY().toInt()) +val Rectangle.center: Point get() = Point(centerX.toInt(), centerY.toInt()) fun printableString(toPrint: String): String { val resultString = toPrint.let {