void (@NotNull PsiLocalVariable variable, @NotNull CommonJavaInlineUtil inlineUtil) { final PsiExpression initializer = variable.getInitializer(); assert initializer != null; final Collection<PsiReference> references = ReferencesSearch.search(variable).findAll(); for (PsiReference reference : references) { inlineUtil.inlineVariable(variable, initializer, (PsiJavaCodeReferenceElement)reference, null); } if (!VariableAccessUtils.variableIsAssigned(variable)) { variable.delete(); } }