void (@NotNull PsiClassReferenceListStub stub, @NotNull IndexSink sink) { PsiReferenceList.Role role = stub.getRole(); if (role == PsiReferenceList.Role.EXTENDS_LIST || role == PsiReferenceList.Role.IMPLEMENTS_LIST) { String[] names = stub.getReferencedNames(); for (String name : names) { String shortName = PsiNameHelper.getShortClassName(name); if (!StringUtil.isEmptyOrSpaces(shortName)) { sink.occurrence(JavaStubIndexKeys.SUPER_CLASSES, shortName); } } if (role == PsiReferenceList.Role.EXTENDS_LIST) { StubElement<?> parentStub = stub.getParentStub(); if (parentStub instanceof PsiClassStub) { PsiClassStub<?> psiClassStub = (PsiClassStub<?>)parentStub; if (psiClassStub.isEnum()) { sink.occurrence(JavaStubIndexKeys.SUPER_CLASSES, "Enum"); } if (psiClassStub.isAnnotationType()) { sink.occurrence(JavaStubIndexKeys.SUPER_CLASSES, "Annotation"); } } } } }