From eeea728a282e6cb48d6added794a747c8ea16be7 Mon Sep 17 00:00:00 2001 From: "Alexey.Merkulov" Date: Fri, 4 Sep 2026 19:54:24 +0200 Subject: [PATCH] [debugger] IDEA-393273 Rework compiler invocations for breakpoint instrumentation to prevent long read actions This is a combined commit of 2, squashed together (cherry picked from commit a69aa2166b93267fcd84012a77b1e79a426ba5f0) (cherry picked from commit 2c7c8313707fc49228a61e1433fbe7703400a89c) IJ-CR-221035 GitOrigin-RevId: 6c75f6c316c850757f0250c2450054f35e584763 --- .../ui/impl/watch/CompilingEvaluatorImpl.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluatorImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluatorImpl.java index eb6db9832d18..79b3fa60e23c 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluatorImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluatorImpl.java @@ -71,23 +71,25 @@ public class CompilingEvaluatorImpl extends CompilingEvaluator { options.add("UTF-8"); List platformClasspath = new ArrayList<>(); List classpath = new ArrayList<>(); - AnnotationProcessingConfiguration profile = null; - if (myModule != null) { - assert myProject.equals(myModule.getProject()) : myModule + " is from another project"; - profile = CompilerConfiguration.getInstance(myProject).getAnnotationProcessingConfiguration(myModule); - ModuleRootManager rootManager = ModuleRootManager.getInstance(myModule); - for (String s : rootManager.orderEntries().compileOnly().recursively().exportedOnly().withoutSdk().getPathsList().getPathList()) { - classpath.add(new File(s)); - } - for (String s : rootManager.orderEntries().compileOnly().sdkOnly().getPathsList().getPathList()) { - platformClasspath.add(new File(s)); - } + ReadAction.runBlocking(() -> { + AnnotationProcessingConfiguration profile = null; + if (myModule != null) { + assert myProject.equals(myModule.getProject()) : myModule + " is from another project"; + profile = CompilerConfiguration.getInstance(myProject).getAnnotationProcessingConfiguration(myModule); + ModuleRootManager rootManager = ModuleRootManager.getInstance(myModule); + for (String s : rootManager.orderEntries().compileOnly().recursively().exportedOnly().withoutSdk().getPathsList().getPathList()) { + classpath.add(new File(s)); + } + for (String s : rootManager.orderEntries().compileOnly().sdkOnly().getPathsList().getPathList()) { + platformClasspath.add(new File(s)); + } - if (myLanguageLevel != null && myLanguageLevel.isPreview()) { - options.add(JavaParameters.JAVA_ENABLE_PREVIEW_PROPERTY); + if (myLanguageLevel != null && myLanguageLevel.isPreview()) { + options.add(JavaParameters.JAVA_ENABLE_PREVIEW_PROPERTY); + } } - } - JavaBuilder.addAnnotationProcessingOptions(options, profile); + JavaBuilder.addAnnotationProcessingOptions(options, profile); + }); Pair runtime = BuildManager.getJavacRuntimeSdk(myProject); JavaSdkVersion buildRuntimeVersion = runtime.getSecond();