mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
dfa: support outer class fields access with qualified this
This commit is contained in:
+8
@@ -107,6 +107,14 @@ public class DfaExpressionFactory {
|
||||
return myFactory.getConstFactory().createFromValue(value, type, null);
|
||||
}
|
||||
|
||||
if (expression instanceof PsiThisExpression) {
|
||||
PsiJavaCodeReferenceElement qualifier = ((PsiThisExpression)expression).getQualifier();
|
||||
PsiElement target = qualifier == null ? null : qualifier.resolve();
|
||||
if (target instanceof PsiClass) {
|
||||
return myFactory.getVarFactory().createVariableValue((PsiModifierListOwner)target, null, false, null);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,4 +43,19 @@ class TestInspection {
|
||||
private void doSomething(@NotNull String s) {
|
||||
//...
|
||||
}
|
||||
}
|
||||
|
||||
class WithInner {
|
||||
@Nullable Object o;
|
||||
|
||||
{
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (WithInner.this.o != null) {
|
||||
System.out.println(WithInner.this.o.toString());
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user