mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
during stub-ast switch, expose PSI to other threads only after it points to AST (could explain some of EA-96572 - failedToBindStubToAst)
This commit is contained in:
@@ -87,8 +87,10 @@ class AstPathPsiMap {
|
||||
@NotNull
|
||||
StubBasedPsiElementBase<?> cachePsi(@NotNull AstPath key, @NotNull StubBasedPsiElementBase psi) {
|
||||
myQueue.cleanupStaleReferences();
|
||||
myMap.put(key, new MyReference(psi, key, myQueue));
|
||||
// ensure PSI will use AST path before making it available to other threads
|
||||
// otherwise another thread could invoke StubRef.getNode and fail since file's AST isn't set yet
|
||||
psi.setSubstrateRef(key);
|
||||
myMap.put(key, new MyReference(psi, key, myQueue));
|
||||
return psi;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user