void (PsiVariable variable, PsiExpression expression) { if (!(expression instanceof PsiReferenceExpression refExpr)) { return; } final PsiExpression qualifier = refExpr.getQualifierExpression(); if ((qualifier == null || qualifier instanceof PsiQualifiedExpression || variable.hasModifierProperty(PsiModifier.STATIC)) && refExpr.isReferenceTo(variable)) { holder.registerProblem(refExpr, JavaBundle.message("assignment.to.declared.variable.problem.descriptor", variable.getName()), LocalQuickFix.notNullElements(createRemoveAssignmentFix(refExpr))); } }