mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix containing field detection
This commit is contained in:
+1
-1
@@ -125,7 +125,7 @@ public class AnonymousCanBeLambdaInspection extends BaseJavaBatchLocalInspection
|
||||
if (bodyContainsForbiddenRefs[0]) return;
|
||||
super.visitReferenceExpression(expression);
|
||||
if (!(expression.getParent() instanceof PsiMethodCallExpression)) {
|
||||
PsiField field = HighlightUtil.findEnclosingFieldInitializer(expression);
|
||||
final PsiField field = PsiTreeUtil.getParentOfType(expression, PsiField.class);
|
||||
if (field != null) {
|
||||
final PsiElement resolved = expression.resolve();
|
||||
if (resolved instanceof PsiField &&
|
||||
|
||||
Reference in New Issue
Block a user