From 498848764c7b3c056de896c467c93e2cbcaae209 Mon Sep 17 00:00:00 2001 From: Bart van Helvert Date: Sun, 24 Aug 2025 15:21:29 +0200 Subject: [PATCH] [java] Check if editor belongs to project before removing cache #IJPL-10786 GitOrigin-RevId: d3da33ac2438ff9a74be9c1f4fc1029adc9da25b --- .../daemon/problems/pass/ProjectProblemFileSelectionListener.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/problems/pass/ProjectProblemFileSelectionListener.kt b/java/java-impl/src/com/intellij/codeInsight/daemon/problems/pass/ProjectProblemFileSelectionListener.kt index ad8c54125077..e455ace569ad 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/problems/pass/ProjectProblemFileSelectionListener.kt +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/problems/pass/ProjectProblemFileSelectionListener.kt @@ -188,6 +188,7 @@ private class ProjectProblemFileSelectionListenerStartupActivity : ProjectActivi // Remove fragments from the cache once the editor gets released EditorFactory.getInstance().addEditorFactoryListener(object : EditorFactoryListener { override fun editorReleased(event: EditorFactoryEvent) { + if (event.editor.project != project) return val virtualFile = FileDocumentManager.getInstance().getFile(event.editor.document) ?: return ReadAction.nonBlocking { if (!virtualFile.isValid) return@nonBlocking null