mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ensure a unique sem chunk per file
This commit is contained in:
@@ -312,8 +312,12 @@ public class SemServiceImpl extends SemService{
|
||||
private ConcurrentMap<SemKey, List<SemElement>> cacheOrGetMap(final PsiElement element, @NotNull PsiElement root) {
|
||||
FileChunk chunk = obtainChunk(root);
|
||||
if (chunk == null) {
|
||||
chunk = new FileChunk(root);
|
||||
myCache.putIfAbsent(root, new SoftReference(chunk));
|
||||
synchronized (myCache) {
|
||||
chunk = obtainChunk(root);
|
||||
if (chunk == null) {
|
||||
myCache.put(root, new SoftReference(chunk = new FileChunk(root)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ConcurrentMap<SemKey, List<SemElement>> map = chunk.map.get(element);
|
||||
|
||||
Reference in New Issue
Block a user