@Override protected boolean queryExternalUsagesRequests( @NotNull final RefManager manager, @NotNull final GlobalJavaInspectionContext globalContext, @NotNull final ProblemDescriptionsProcessor processor) { final EntryPointsManager entryPointsManager = globalContext.getEntryPointsManager(manager); for (RefElement entryPoint : entryPointsManager.getEntryPoints()) { ignoreElement(processor, entryPoint); } ExtensionPoint<VisibilityExtension> point = Extensions.getRootArea().getExtensionPoint(ExtensionPoints.VISIBLITY_TOOL); for (VisibilityExtension addin : point.getExtensions()) { addin.fillIgnoreList(manager, processor); } manager.iterate( new RefJavaVisitor() { @Override public void visitElement(@NotNull final RefEntity refEntity) { if (!(refEntity instanceof RefElement)) return; if (processor.getDescriptions(refEntity) == null) return; refEntity.accept( new RefJavaVisitor() { @Override public void visitField(@NotNull final RefField refField) { if (refField.getAccessModifier() != PsiModifier.PRIVATE) { globalContext.enqueueFieldUsagesProcessor( refField, new GlobalJavaInspectionContext.UsagesProcessor() { @Override public boolean process(PsiReference psiReference) { ignoreElement(processor, refField); return false; } }); } } @Override public void visitMethod(@NotNull final RefMethod refMethod) { if (!refMethod.isExternalOverride() && refMethod.getAccessModifier() != PsiModifier.PRIVATE && !(refMethod instanceof RefImplicitConstructor)) { globalContext.enqueueDerivedMethodsProcessor( refMethod, new GlobalJavaInspectionContext.DerivedMethodsProcessor() { @Override public boolean process(PsiMethod derivedMethod) { ignoreElement(processor, refMethod); return false; } }); globalContext.enqueueMethodUsagesProcessor( refMethod, new GlobalJavaInspectionContext.UsagesProcessor() { @Override public boolean process(PsiReference psiReference) { ignoreElement(processor, refMethod); return false; } }); if (entryPointsManager.isAddNonJavaEntries()) { final RefClass ownerClass = refMethod.getOwnerClass(); if (refMethod.isConstructor() && ownerClass.getDefaultConstructor() != null) { String qualifiedName = ownerClass.getElement().getQualifiedName(); if (qualifiedName != null) { final Project project = manager.getProject(); PsiSearchHelper.SERVICE .getInstance(project) .processUsagesInNonJavaFiles( qualifiedName, new PsiNonJavaFileReferenceProcessor() { @Override public boolean process( PsiFile file, int startOffset, int endOffset) { entryPointsManager.addEntryPoint(refMethod, false); ignoreElement(processor, refMethod); return false; } }, GlobalSearchScope.projectScope(project)); } } } } } @Override public void visitClass(@NotNull final RefClass refClass) { if (!refClass.isAnonymous()) { globalContext.enqueueDerivedClassesProcessor( refClass, new GlobalJavaInspectionContext.DerivedClassesProcessor() { @Override public boolean process(PsiClass inheritor) { ignoreElement(processor, refClass); return false; } }); globalContext.enqueueClassUsagesProcessor( refClass, new GlobalJavaInspectionContext.UsagesProcessor() { @Override public boolean process(PsiReference psiReference) { ignoreElement(processor, refClass); return false; } }); } } }); } }); return false; }