diff --git a/jvm/jvm-analysis-impl/src/com/intellij/codeInspection/blockingCallsDetection/ThrowsTypeBlockingMethodChecker.java b/jvm/jvm-analysis-impl/src/com/intellij/codeInspection/blockingCallsDetection/ThrowsTypeBlockingMethodChecker.java index fb552d9d6fbd..c7e5ff0b0249 100644 --- a/jvm/jvm-analysis-impl/src/com/intellij/codeInspection/blockingCallsDetection/ThrowsTypeBlockingMethodChecker.java +++ b/jvm/jvm-analysis-impl/src/com/intellij/codeInspection/blockingCallsDetection/ThrowsTypeBlockingMethodChecker.java @@ -3,10 +3,11 @@ package com.intellij.codeInspection.blockingCallsDetection; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiMethod; +import com.intellij.psi.util.InheritanceUtil; import com.intellij.util.containers.ContainerUtil; +import one.util.streamex.StreamEx; import org.jetbrains.annotations.NotNull; -import java.util.Arrays; import java.util.Set; public class ThrowsTypeBlockingMethodChecker implements BlockingMethodChecker { @@ -21,7 +22,8 @@ public class ThrowsTypeBlockingMethodChecker implements BlockingMethodChecker { @Override public boolean isMethodBlocking(@NotNull PsiMethod method) { - return Arrays.stream(method.getThrowsList().getReferenceElements()) - .anyMatch(thrownException -> BLOCKING_EXCEPTION_TYPES.contains(thrownException.getQualifiedName())); + return StreamEx.of(method.getThrowsList().getReferencedTypes()) + .cross(BLOCKING_EXCEPTION_TYPES) + .anyMatch(entry -> InheritanceUtil.isInheritor(entry.getKey(), entry.getValue())); } }