void (@NotNull PsiThrowStatement statement) { PsiExpression typeCast = deparenthesizeExpression(statement.getException()); if (typeCast instanceof PsiTypeCastExpression) { PsiExpression operand = getInnerMostOperand(((PsiTypeCastExpression)typeCast).getOperand()); if (operand != null) { PsiType opType = operand.getType(); final PsiClass thrownClass = PsiUtil.resolveClassInType(opType); if (InheritanceUtil.isInheritor(thrownClass, false, CommonClassNames.JAVA_LANG_RUNTIME_EXCEPTION)) { addToResults((PsiTypeCastExpression)typeCast); } if (InheritanceUtil.isInheritor(thrownClass, false, CommonClassNames.JAVA_LANG_THROWABLE)) { final PsiParameterListOwner listOwner = PsiTreeUtil.getParentOfType(statement, PsiMethod.class, PsiLambdaExpression.class); if (listOwner instanceof PsiMethod) { processThrowsList((PsiMethod)listOwner, PsiSubstitutor.EMPTY, (PsiTypeCastExpression)typeCast, opType); } else if (listOwner instanceof PsiLambdaExpression) { PsiType functionalInterfaceType = ((PsiLambdaExpression)listOwner).getFunctionalInterfaceType(); final PsiClassType.ClassResolveResult functionalInterfaceResolveResult = PsiUtil.resolveGenericsClassInType(functionalInterfaceType); final PsiMethod interfaceMethod = LambdaUtil.getFunctionalInterfaceMethod(functionalInterfaceType); if (interfaceMethod != null) { processThrowsList(interfaceMethod, LambdaUtil.getSubstitutor(interfaceMethod, functionalInterfaceResolveResult), (PsiTypeCastExpression)typeCast, opType); } } } } } super.visitThrowStatement(statement); }