void (PsiLocalVariable variable, PsiStatement body) { if (variable == null) return; if (!HighlightControlFlowUtil.isEffectivelyFinal(variable, body, null)) return; List<PsiReferenceExpression> references = VariableAccessUtils.getVariableReferences(variable, body); PsiExpression initializer = variable.getInitializer(); if (initializer == null) return; references.forEach(reference -> CommonJavaInlineUtil.getInstance().inlineVariable(variable, initializer, reference, null)); variable.delete(); }