void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { final PsiIdentifier name = ObjectUtils.tryCast(startElement, PsiIdentifier.class); if (name == null) return; final PsiReferenceExpression expression = ObjectUtils.tryCast(name.getParent(), PsiReferenceExpression.class); if (expression == null) return; final PsiField field = ObjectUtils.tryCast(expression.resolve(), PsiField.class); if (field == null) return; PsiReplacementUtil.replaceExpressionWithReferenceTo(expression, field); }