From 273541eb88c0f56de1fd94b3f277bb9e6cf988ca Mon Sep 17 00:00:00 2001 From: Sergei Tachenov Date: Wed, 29 Oct 2025 12:00:48 +0200 Subject: [PATCH] [UI] IJPL-189308 Fix the type checking in getGeneralizedParentOfType One of those easy-to-make hard-to-notice bugs: the wrong variable was checked. (cherry picked from commit c7242d63506b7a1e1efccbfdfa3217ffb61d47e7) IJ-CR-180119 GitOrigin-RevId: cf185297b897b592b57ff4d94360d9678a447f9d --- platform/util/ui/src/com/intellij/util/ui/UIUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/util/ui/src/com/intellij/util/ui/UIUtil.java b/platform/util/ui/src/com/intellij/util/ui/UIUtil.java index e624dc2f9a01..98f05659327d 100644 --- a/platform/util/ui/src/com/intellij/util/ui/UIUtil.java +++ b/platform/util/ui/src/com/intellij/util/ui/UIUtil.java @@ -2167,7 +2167,7 @@ public final class UIUtil { public static @Nullable T getGeneralizedParentOfType(@NotNull Class type, @Nullable Component component) { var result = component; while (result != null) { - if (type.isInstance(component)) { + if (type.isInstance(result)) { //noinspection unchecked return (T)result; }