boolean (PsiElement context, PsiExpression parent, PsiExpression child) { if (child != parent) return isEffectivelyFinal(context, child); if (child instanceof PsiLiteralExpression) return true; if (!(child instanceof PsiReferenceExpression)) return false; PsiVariable target = ObjectUtils.tryCast(((PsiReferenceExpression)child).resolve(), PsiVariable.class); if (!PsiUtil.isJvmLocalVariable(target)) return false; return HighlightControlFlowUtil.isEffectivelyFinal(target, context, null); }