guard against DDOSing PsiElementFactory#createTypeByFQClassName with many expensive file scopes (IDEA-210047)

`fileScope(LightVirtualFile)` can hold hard reference to PSI and AST, and the memory snapshot contains many of those
This commit is contained in:
peter
2019-04-05 10:25:33 +02:00
parent be57f14427
commit 03acb49b5a
@@ -35,7 +35,7 @@ import java.util.concurrent.ConcurrentMap;
public class PsiElementFactoryImpl extends PsiJavaParserFacadeImpl implements PsiElementFactory {
private final ConcurrentMap<LanguageLevel, PsiClass> myArrayClasses = ContainerUtil.newConcurrentMap();
private final ConcurrentMap<GlobalSearchScope, PsiClassType> myCachedObjectType = ContainerUtil.newConcurrentMap();
private final ConcurrentMap<GlobalSearchScope, PsiClassType> myCachedObjectType = ContainerUtil.createConcurrentSoftMap();
public PsiElementFactoryImpl(final PsiManagerEx manager) {
super(manager);