boolean (@NotNull Project project, @NotNull PsiFile containingFile, @NotNull PsiMethod method, @NotNull ProgressIndicator progress, @NotNull GlobalUsageHelper helper) { if (helper.isLocallyUsed(method)) return true; boolean isPrivate = method.hasModifierProperty(PsiModifier.PRIVATE); PsiClass containingClass = method.getContainingClass(); if (JavaHighlightUtil.isSerializationRelatedMethod(method, containingClass)) return true; if (isPrivate) { if (isIntentionalPrivateConstructor(method, containingClass)) { return true; } if (isImplicitUsage(project, method)) { return true; } if (!helper.isCurrentFileAlreadyChecked()) { return !weAreSureThereAreNoUsages(project, containingFile, method, progress, helper); } } else { //class maybe used in some weird way, e.g. from XML, therefore the only constructor is used too if (isTheOnlyConstructor(method, containingClass) && isClassUsed(project, containingFile, containingClass, progress, helper)) { return true; } if (isImplicitUsage(project, method)) return true; if (!method.isConstructor() && FindSuperElementsHelper.findSuperElements(method).length != 0) { return true; } return !weAreSureThereAreNoUsages(project, containingFile, method, progress, helper); } return false; }