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();