void (@NotNull Project project, @NotNull PsiFile file, @Nullable Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { List<TaintNode> roots = ActionUtil.underModalProgress(project, CodeInsightBundle.message("progress.title.preparing.result"), ()->{ UExpression uExpression = UastContextKt.toUElementOfExpectedTypes(startElement, UExpression.class); if (uExpression == null) return null; PsiElement reportedElement = uExpression.getSourcePsi(); if (reportedElement == null) return null; TaintAnalyzer analyzer = new TaintAnalyzer(myTaintValueFactory); try { TaintValue value = analyzer.analyzeExpression(uExpression, false, TaintValue.TAINTED); if (value != TaintValue.UNKNOWN) return null; } catch (DeepTaintAnalyzerException e) { return null; } return ContainerUtil.map(analyzer.getNonMarkedElements(), nonMarkedElement -> new TaintNode(null, nonMarkedElement.myNonMarked, nonMarkedElement.myRef, myTaintValueFactory, nonMarkedElement.myNext)); }); if (roots == null || roots.isEmpty()) return; if (ApplicationManager.getApplication().isUnitTestMode()) { for (TaintNode root : roots) { Set<TaintNode> toAnnotate = new HashSet<>(); toAnnotate = PropagateAnnotationPanel.getSelectedElements(root, toAnnotate); if (toAnnotate == null || root.myTaintValue == TaintValue.TAINTED) continue; annotate(project, toAnnotate); } return; } Consumer<Collection<TaintNode>> callback = toAnnotate -> { annotate(project, toAnnotate); ToolWindow toolWindow = ProblemsViewToolWindowUtils.INSTANCE.getToolWindow(project); if (toolWindow != null) toolWindow.hide(); }; PropagateAnnotationPanel panel = new PropagateAnnotationPanel(project, roots, callback, supportRefactoring); String title = JvmAnalysisBundle.message("jvm.inspections.source.unsafe.to.sink.flow.propagate.safe.toolwindow.title"); ToolWindow toolWindow = ProblemsViewToolWindowUtils.INSTANCE.getToolWindow(project); if (toolWindow == null) return; Content content = ContentFactory.getInstance().createContent(panel, title, true); panel.setContent(content); ContentManager contentManager = toolWindow.getContentManager(); contentManager.addContent(content); contentManager.setSelectedContent(content); toolWindow.activate(null); }