@NotNull @Override public PsiClass[] getClasses(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope scope) { String fqn = psiPackage.getQualifiedName(); if (isShortCircuit(fqn)) { return PsiClass.EMPTY_ARRAY; } addShortCircuit(fqn); try { PsiClass[] classes = psiPackage.getClasses(scope); return Arrays.stream(classes).map(LightClass::new).toArray(PsiClass[]::new); } finally { removeShortCircuit(fqn); } }
@Override public PsiClass[] findClasses(String fqn, GlobalSearchScope scope) { if (isShortCircuit(fqn)) { return PsiClass.EMPTY_ARRAY; } addShortCircuit(fqn); try { PsiClass[] classes = JavaPsiFacade.getInstance(scope.getProject()).findClasses(fqn, scope); return Arrays.stream(classes).map(LightClass::new).toArray(PsiClass[]::new); } finally { removeShortCircuit(fqn); } }
@Override public PsiClass findClass(String fqn, GlobalSearchScope scope) { if (isShortCircuit(fqn)) { return null; } addShortCircuit(fqn); try { PsiClass cls = JavaPsiFacade.getInstance(scope.getProject()).findClass(fqn, scope); return cls == null ? null : new LightClass(cls); } finally { removeShortCircuit(fqn); } }