mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 10:07:41 +07:00
unchecked warning: do not traverse through lambda bounds (IDEA-130810)
This commit is contained in:
+2
-1
@@ -375,8 +375,9 @@ public class UncheckedWarningLocalInspectionBase extends BaseJavaBatchLocalInspe
|
||||
public void visitReturnStatement(PsiReturnStatement statement) {
|
||||
super.visitReturnStatement(statement);
|
||||
if (IGNORE_UNCHECKED_ASSIGNMENT) return;
|
||||
final PsiLambdaExpression lambdaExpression = PsiTreeUtil.getParentOfType(statement, PsiLambdaExpression.class);
|
||||
final PsiMethod method = PsiTreeUtil.getParentOfType(statement, PsiMethod.class);
|
||||
if (method != null) {
|
||||
if (method != null && (lambdaExpression == null || PsiTreeUtil.isAncestor(lambdaExpression, method, true))) {
|
||||
final PsiType returnType = method.getReturnType();
|
||||
if (returnType != null && returnType != PsiType.VOID) {
|
||||
final PsiExpression returnValue = statement.getReturnValue();
|
||||
|
||||
Reference in New Issue
Block a user