[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
This commit is contained in:
Sergei Tachenov
2025-10-31 06:00:00 +00:00
committed by intellij-monorepo-bot
parent c4f4b935f0
commit 273541eb88
@@ -2167,7 +2167,7 @@ public final class UIUtil {
public static @Nullable <T> T getGeneralizedParentOfType(@NotNull Class<? extends T> type, @Nullable Component component) {
var result = component;
while (result != null) {
if (type.isInstance(component)) {
if (type.isInstance(result)) {
//noinspection unchecked
return (T)result;
}