Skip to content

Commit 6420a78

Browse files
Add RunReadAction wrapper for slow Spring operation (#2148)
1 parent 6e60829 commit 6420a78

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/UtTestsDialogProcessor.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,13 @@ object UtTestsDialogProcessor {
236236
when (val approach = model.typeReplacementApproach) {
237237
DoNotReplace -> emptyList()
238238
is ReplaceIfPossible -> {
239-
val contentRoots = listOfNotNull(
240-
model.srcModule,
241-
springConfigClass?.module
242-
).distinct().flatMap { module ->
243-
ModuleRootManager.getInstance(module).contentRoots.toList()
239+
val contentRoots = runReadAction {
240+
listOfNotNull(
241+
model.srcModule,
242+
springConfigClass?.module
243+
).distinct().flatMap { module ->
244+
ModuleRootManager.getInstance(module).contentRoots.toList()
245+
}
244246
}
245247
process.getSpringBeanQualifiedNames(
246248
classpathForClassLoader,

0 commit comments

Comments
 (0)