mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
fixing grammar
IDEA-CR-51559 GitOrigin-RevId: f44d7b539164a8086c022b786c721bf7011608b1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dd123f6c51
commit
1e5631c6ee
@@ -47,7 +47,7 @@ import java.util.*;
|
||||
|
||||
public class PsiReferenceExpressionImpl extends ExpressionPsiElement implements PsiReferenceExpression, SourceJavaCodeReference {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl");
|
||||
private static final ThreadLocal<Map<PsiReferenceExpression, ResolveResult[]>> ourQualifiersCache = ThreadLocal.withInitial(() -> new HashMap<>());
|
||||
private static final ThreadLocal<Map<PsiReferenceExpression, ResolveResult[]>> ourQualifierCache = ThreadLocal.withInitial(() -> new HashMap<>());
|
||||
|
||||
private volatile String myCachedQName;
|
||||
private volatile String myCachedNormalizedText;
|
||||
@@ -192,13 +192,13 @@ public class PsiReferenceExpressionImpl extends ExpressionPsiElement implements
|
||||
//if the global cache worked, then the result is already in ResolveCache
|
||||
//if top level resolve was started in the context where caching is prohibited,
|
||||
//foo() is already in the local cache ourQualifiersCache
|
||||
ResolveResult[] result = ourQualifiersCache.get().get(ref);
|
||||
ResolveResult[] result = ourQualifierCache.get().get(ref);
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
boolean empty = ourQualifiersCache.get().isEmpty();
|
||||
boolean empty = ourQualifierCache.get().isEmpty();
|
||||
try {
|
||||
resolveAllQualifiers(expression, containingFile);
|
||||
JavaResolveResult[] result = expression.resolve(parentType, containingFile);
|
||||
@@ -213,7 +213,7 @@ public class PsiReferenceExpressionImpl extends ExpressionPsiElement implements
|
||||
finally {
|
||||
//clear cache for the top level expression
|
||||
if (empty) {
|
||||
ourQualifiersCache.remove();
|
||||
ourQualifierCache.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -242,7 +242,7 @@ public class PsiReferenceExpressionImpl extends ExpressionPsiElement implements
|
||||
protected void elementFinished(@NotNull PsiElement element) {
|
||||
if (!(element instanceof PsiReferenceExpressionImpl)) return;
|
||||
PsiReferenceExpressionImpl chainedQualifier = (PsiReferenceExpressionImpl)element;
|
||||
ourQualifiersCache.get()
|
||||
ourQualifierCache.get()
|
||||
.put(chainedQualifier, resolveCache.resolveWithCaching(chainedQualifier, INSTANCE, false, false, containingFile));
|
||||
}
|
||||
|
||||
|
||||
@@ -67,8 +67,8 @@ public class InferencePerformanceTest extends LightDaemonAnalyzerTestCase {
|
||||
assertEmpty(highlightErrors());
|
||||
}
|
||||
|
||||
public void testLongQualifiersChainInsideLambda() {
|
||||
PlatformTestUtil.startPerformanceTest("long qualifiers chain", 12000, this::doTest).usesAllCPUCores().assertTiming();
|
||||
public void testLongQualifierChainInsideLambda() {
|
||||
PlatformTestUtil.startPerformanceTest("long qualifier chain", 12000, this::doTest).usesAllCPUCores().assertTiming();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
|
||||
Reference in New Issue
Block a user