mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[junit] avoid deadlock on runner retrieval (IDEA-297642)
GitOrigin-RevId: 07e44c38acb6d54ec60698e3fdab590e66148dbe
This commit is contained in:
committed by
intellij-monorepo-bot
parent
496550484c
commit
7d45076990
@@ -662,13 +662,16 @@ public abstract class TestObject extends JavaTestFrameworkRunnableState<JUnitCon
|
||||
}
|
||||
|
||||
private String myRunner;
|
||||
private static final Object LOCK = ObjectUtils.sentinel("JUnitRunner");
|
||||
|
||||
@NotNull
|
||||
protected synchronized String getRunner() {
|
||||
if (myRunner == null) {
|
||||
myRunner = ReadAction.nonBlocking(this::getRunnerInner).executeSynchronously();
|
||||
protected String getRunner() {
|
||||
synchronized (LOCK) {
|
||||
if (myRunner == null) {
|
||||
myRunner = ReadAction.nonBlocking(this::getRunnerInner).executeSynchronously();
|
||||
}
|
||||
return myRunner;
|
||||
}
|
||||
return myRunner;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user