if(status == InitializerUsageStatus.AT_WANTED_PLACE_ONLY) {
initializer.delete();
}
<BUG>PsiElement result =
foreachStatement.replace(elementFactory.createStatementFromText(var.getName() + " = " + replacement + ";", foreachStatement));
simplifyAndFormat(project, result);</BUG>
}
}
static void simplifyAndFormat(@NotNull Project project, PsiElement result) {
if (result == null) return;

if(status == InitializerUsageStatus.AT_WANTED_PLACE_ONLY) {
initializer.delete();
}
return
foreachStatement.replace(elementFactory.createStatementFromText(var.getName() + " = " + replacement + ";", foreachStatement));
}
}
static void simplifyAndFormat(@NotNull Project project, PsiElement result) {
if (result == null) return;
