mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
DataFlowInspectionBase: qualifier check (Review ID: IDEA-CR-28206)
This commit is contained in:
+3
-1
@@ -309,8 +309,10 @@ public class DataFlowInspectionBase extends AbstractBaseJavaLocalInspectionTool
|
||||
if (assignment != null) {
|
||||
Object constValue = ExpressionUtils.computeConstantExpression(assignment.getRExpression());
|
||||
if (constValue == PsiTypesUtil.getDefaultValue(expr.getType())) {
|
||||
PsiElement target = ((PsiReferenceExpression)expr).resolve();
|
||||
PsiReferenceExpression ref = (PsiReferenceExpression)expr;
|
||||
PsiElement target = ref.resolve();
|
||||
if (target instanceof PsiField &&
|
||||
(((PsiField)target).hasModifierProperty(PsiModifier.STATIC) || ExpressionUtils.isEffectivelyUnqualified(ref)) &&
|
||||
((PsiField)target).getContainingClass() == ((PsiClassInitializer)context).getContainingClass()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user