boolean (@NotNull final Processor<? super PsiReference> processor, @NotNull final PsiMethod constructor, @NotNull final Project project, @NotNull final PsiClass aClass) { return DumbService.getInstance(project).runReadActionInSmartMode(() -> { for (PsiField field : aClass.getFields()) { if (field instanceof PsiEnumConstant) { PsiReference reference = field.getReference(); if (reference != null && reference.isReferenceTo(constructor)) { if (!processor.process(reference)) { return false; } } } } return true; }); }