void (@NotNull Project project, @NotNull Map<PsiElement, AnnotationPlace> placedElement, @NotNull TaintValueFactory taintValueFactory) { String title = JvmAnalysisBundle.message("jvm.inspections.source.unsafe.to.sink.flow.mark.as.safe.command.name"); ArrayList<PsiElement> toAnnotate = new ArrayList<>(); ArrayList<PsiElement> toConfig = new ArrayList<>(); for (Map.Entry<PsiElement, AnnotationPlace> entry : placedElement.entrySet()) { AnnotationPlace annotationPlace = entry.getValue(); if (annotationPlace == AnnotationPlace.IN_CODE) { toAnnotate.add(entry.getKey()); } if (annotationPlace == AnnotationPlace.EXTERNAL || annotationPlace == AnnotationPlace.NEED_ASK_USER) { toConfig.add(entry.getKey()); } } PsiFile[] files = filesToAnnotate(toAnnotate); WriteCommandAction.runWriteCommandAction(project, title, null, () -> { annotateInCode(project, toAnnotate, taintValueFactory, true, new ArrayList<>()); addToConfig(project, toConfig, taintValueFactory.getConfiguration()); }, files); }