PsiClass[] (PsiFileWithStubSupport file) { StubbedSpine spine = file.getStubbedSpine(); List<PsiClass> result = new ArrayList<>(myClassNameMatchers.size() + (myAnonymousIndices == null ? 0 : myAnonymousIndices.size())); int anonymousId = 0; for (int i = 0; i < spine.getStubCount(); i++) { if (Constants.CLASS_BIT_SET.contains(spine.getStubType(i))) { PsiClass element = (PsiClass)spine.getStubPsi(i); if (element instanceof PsiAnonymousClass) { if (myAnonymousIndices != null && !myAnonymousIndices.isEmpty()) { if (myAnonymousIndices.contains(anonymousId)) { result.add(element); } anonymousId++; } } else if (match(element, myClassNameMatchers)) { result.add(element); } } } return result.toArray(PsiClass.EMPTY_ARRAY); }