better stub gc-ability during inheritor search in FindSuperElementsHelper.getSiblingInheritedViaSubClass

This commit is contained in:
peter
2015-08-20 18:05:06 +02:00
parent 500a9c7dc1
commit f455bf6aed
@@ -76,15 +76,15 @@ public class FindSuperElementsHelper {
if (!hasSubClass) {
return null;
}
final Collection<PsiClass> checkedInterfaces = new THashSet<PsiClass>();
final Collection<PsiAnchor> checkedInterfaces = new THashSet<PsiAnchor>();
final PsiMethod[] result = new PsiMethod[1];
ClassInheritorsSearch.search(containingClass, true).forEach(new Processor<PsiClass>() {
ClassInheritorsSearch.search(containingClass, containingClass.getUseScope(), true, true, false).forEach(new Processor<PsiClass>() {
@Override
public boolean process(PsiClass inheritor) {
for (PsiClassType interfaceType : inheritor.getImplementsListTypes()) {
PsiClassType.ClassResolveResult resolved = interfaceType.resolveGenerics();
PsiClass anInterface = resolved.getElement();
if (anInterface == null || !checkedInterfaces.add(anInterface)) continue;
if (anInterface == null || !checkedInterfaces.add(PsiAnchor.create(anInterface))) continue;
for (PsiMethod superMethod : anInterface.findMethodsByName(method.getName(), true)) {
PsiClass superInterface = superMethod.getContainingClass();
if (superInterface == null) {