void (@NotNull final Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getPsiElement(); if (element == null) { // stale PSI return; } final PsiFile file = element.getContainingFile(); optimizeImports(project, file); }