void (@Nullable PsiElement declaration) { if (declaration == null) return; final PsiLocalVariable newVariable = extractDeclared(declaration); if (newVariable != null) { final PsiExpression initializer = PsiUtil.skipParenthesizedExprDown(newVariable.getInitializer()); if (VariableAccessUtils.isLocalVariableCopy(newVariable, initializer)) { Collection<PsiReference> references = ReferencesSearch.search(newVariable).findAll(); IntentionPreviewUtils.write(() -> { for (PsiReference reference : references) { CommonJavaInlineUtil.getInstance().inlineVariable(newVariable, initializer, (PsiJavaCodeReferenceElement)reference, null); } declaration.delete(); }); } } }