private PsiClass @Nullable [] findClassesHeuristically(final String name, GlobalSearchScope scope) {
    if (findSubPackageByName(name) != null) {
      return PsiClass.EMPTY_ARRAY;
    }

    Map<Pair<GlobalSearchScope, String>, PsiClass[]> partial = dereference(myDumbModePartialCache);
    if (partial == null) {
      myDumbModePartialCache = new SoftReference<>(partial = new ConcurrentHashMap<>());
    }
    PsiClass[] result = partial.get(Pair.create(scope, name));
    if (result == null) {
      RecursionGuard.StackStamp stamp = RecursionManager.markStack();
      List<PsiClass> fastClasses = new ArrayList<>();
      for (PsiDirectory directory : getDirectories(scope)) {
        List<PsiFile> sameNamed = ContainerUtil.filter(directory.getFiles(), file -> file.getName().contains(name));
        PsiClass[] classes = CoreJavaDirectoryService.getPsiClasses(directory, sameNamed.toArray(PsiFile.EMPTY_ARRAY));
        for (PsiClass aClass : classes) {
          if (name.equals(aClass.getName())) {
            fastClasses.add(aClass);
          }
        }
      }
      if (!fastClasses.isEmpty() && stamp.mayCacheNow()) {
        partial.put(Pair.create(scope, name), result = fastClasses.toArray(PsiClass.EMPTY_ARRAY));
      }
    }
    return result;
  }
private PsiClass @Nullable [] findClassesHeuristically(final String name, GlobalSearchScope scope)