GitOrigin-RevId: 4bed85d2ab8d0a138370632f14266944d2766e33
This commit is contained in:
Vladimir Krivosheev
2021-02-03 19:23:47 +01:00
committed by intellij-monorepo-bot
parent d8328522e5
commit 99528c07c6
45 changed files with 115 additions and 268 deletions

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi.impl;
import com.intellij.openapi.progress.ProgressIndicatorProvider;
@@ -73,7 +73,9 @@ public class PsiShortNamesCacheImpl extends PsiShortNamesCache {
}
else if (res < 0) {
// aClass hides previousClass in classpath, so remove it from list later
if (hiddenClassesToRemove == null) hiddenClassesToRemove = new THashSet<>();
if (hiddenClassesToRemove == null) {
hiddenClassesToRemove = new HashSet<>();
}
hiddenClassesToRemove.add(previousClass);
qNamedClasses.add(aClass);
}

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi.impl.search;
import com.intellij.openapi.application.ReadAction;
@@ -20,9 +6,9 @@ import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.util.Pair;
import com.intellij.util.concurrency.Semaphore;
import com.intellij.util.containers.HashSetQueue;
import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.ForkJoinPool;
@@ -60,10 +46,10 @@ class LazyConcurrentCollection<T,V> implements Iterable<V> {
private final HashSetQueue.PositionalIterator<T> candidatesToFindSubclassesIterator; // guarded by lock
// classes for which DirectClassInheritorsSearch is running
private final Set<T> classesBeingProcessed = new THashSet<>(); // guarded by lock
private final Set<T> classesBeingProcessed = new HashSet<>(); // guarded by lock
// Classes for which DirectClassInheritorsSearch has already run (maybe in the other thread),
// but candidatesToFindSubclassesIterator hasn't caught them up yet. Elements from this set are removed as the iterator moves.
private final Set<T> classesProcessed = new THashSet<>(); // guarded by lock
private final Set<T> classesProcessed = new HashSet<>(); // guarded by lock
LazyConcurrentCollection(@NotNull T seedElement,
@NotNull Function<? super T, ? extends V> convertor,

View File

@@ -1,13 +1,13 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi.impl.search;
import com.intellij.openapi.application.ReadAction;
import com.intellij.psi.PsiMethod;
import com.intellij.util.Processor;
import com.intellij.util.QueryExecutor;
import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import java.util.HashSet;
import java.util.Set;
/**
@@ -20,7 +20,7 @@ public class MethodDeepestSuperSearcher implements QueryExecutor<PsiMethod, PsiM
}
public static boolean processDeepestSuperMethods(@NotNull PsiMethod method, @NotNull Processor<? super PsiMethod> consumer) {
final Set<PsiMethod> methods = new THashSet<>();
final Set<PsiMethod> methods = new HashSet<>();
methods.add(method);
return findDeepestSuperOrSelfSignature(method, methods, null, consumer);
}
@@ -37,7 +37,7 @@ public class MethodDeepestSuperSearcher implements QueryExecutor<PsiMethod, PsiM
}
for (PsiMethod superMethod : supers) {
if (guard == null) {
guard = new THashSet<>();
guard = new HashSet<>();
guard.add(method);
}
if (!findDeepestSuperOrSelfSignature(superMethod, set, guard, processor)) return false;