boolean (Set<? super String> possibleClassNames, final JavaPsiFacade facade, final GlobalSearchScope searchScope, final boolean method, final String memberName, final boolean staticAccess, boolean addInheritors) { final PsiShortNamesCache cache = PsiShortNamesCache.getInstance(facade.getProject()); final boolean[] allClasses = {false}; ReadAction.run(() -> { final PsiClass objectClass = facade.findClass(CommonClassNames.JAVA_LANG_OBJECT, searchScope); if (objectClass != null) { if (method && objectClass.findMethodsByName(memberName, false).length > 0) { allClasses[0] = true; } else if (!method) { final PsiField field = objectClass.findFieldByName(memberName, false); if (hasCorrectModifiers(field, staticAccess)) { allClasses[0] = true; } } } }); if (allClasses[0]) { possibleClassNames.add(CommonClassNames.JAVA_LANG_OBJECT); if (!addInheritors) { return true; } final String[] strings = ReadAction.compute(cache::getAllClassNames); for (final String className : strings) { final PsiClass[] classes = ReadAction.compute(() -> cache.getClassesByName(className, searchScope)); for (final PsiClass aClass : classes) { final String qname = getQualifiedName(aClass); ContainerUtil.addIfNotNull(possibleClassNames, qname); } } return true; } return false; }