void (PsiVariable variable) { if (variable != null && variable.getName() != null && isDeclaredInside(variable) && myControlFlowWrapper.getUsedVariables().contains(variable) && !myControlFlowWrapper.needVariableValueAfterEnd(variable)) { PsiDeclarationStatement declaration = myElementFactory.createVariableDeclarationStatement(variable.getName(), variable.getType(), null); addToMethodCallLocation(declaration); } }