mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java 8: anonymous class fields could be available later in next lambdas (IDEA-123731); narrow down scope of chained calls to the containing statement
This commit is contained in:
@@ -544,7 +544,7 @@ public class PsiImplUtil {
|
||||
PsiClass aClass = member.getContainingClass();
|
||||
if (aClass instanceof PsiAnonymousClass) {
|
||||
//member from anonymous class can be called from outside the class
|
||||
PsiElement methodCallExpr = PsiUtil.isLanguageLevel8OrHigher(aClass) ? PsiTreeUtil.getParentOfType(aClass, PsiMember.class)
|
||||
PsiElement methodCallExpr = PsiUtil.isLanguageLevel8OrHigher(aClass) ? PsiTreeUtil.getTopmostParentOfType(aClass, PsiStatement.class)
|
||||
: PsiTreeUtil.getParentOfType(aClass, PsiMethodCallExpression.class);
|
||||
return new LocalSearchScope(methodCallExpr != null ? methodCallExpr : aClass);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user