Skip to content

Commit 4581bef

Browse files
committed
Move getting srcClassName inside ReadAction in plugin #729
1 parent 68a65ea commit 4581bef

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ object UtTestsDialogProcessor {
161161
)
162162

163163
for (srcClass in model.srcClasses) {
164-
val methods = ReadAction.nonBlocking<List<UtMethod<*>>> {
164+
val (methods, className) = ReadAction.nonBlocking<Pair<List<UtMethod<*>>, String?>> {
165165
val canonicalName = srcClass.canonicalName
166166
val clazz = classLoader.loadClass(canonicalName).kotlin
167167
psi2KClass[srcClass] = clazz
@@ -179,10 +179,9 @@ object UtTestsDialogProcessor {
179179
clazz.allNestedClasses.flatMap {
180180
findMethodsInClassMatchingSelected(it, srcMethods)
181181
}
182-
})
182+
}) to srcClass.name
183183
}.executeSynchronously()
184184

185-
val className = srcClass.name
186185
if (methods.isEmpty()) {
187186
logger.error { "No methods matching selected found in class $className." }
188187
continue

0 commit comments

Comments
 (0)