}
@Override
- public boolean shouldIgnoreUsagesInCurrentFile() {
+ public boolean isCurrentFileAlreadyChecked() {
return true;
}
if (isImplicitUsage(method, progress)) {
return true;
}
- if (!helper.shouldIgnoreUsagesInCurrentFile()) {
+ if (!helper.isCurrentFileAlreadyChecked()) {
return !weAreSureThereAreNoUsages(method, progress, helper);
}
}
}
PsiSearchHelper.SearchCostResult cheapEnough = PsiSearchHelper.SERVICE.getInstance(project).isCheapEnoughToSearch(name, (GlobalSearchScope)useScope,
- helper.shouldIgnoreUsagesInCurrentFile() ? member.getContainingFile() : null,
+ helper.isCurrentFileAlreadyChecked() ? member.getContainingFile() : null,
progress);
if (cheapEnough == PsiSearchHelper.SearchCostResult.TOO_MANY_OCCURRENCES) return false;
private static boolean isReallyUsed(PsiClass aClass, ProgressIndicator progress, GlobalUsageHelper helper) {
if (isImplicitUsage(aClass, progress) || helper.isLocallyUsed(aClass)) return true;
- if (aClass.getContainingClass() != null && aClass.hasModifierProperty(PsiModifier.PRIVATE) ||
- aClass.getParent() instanceof PsiDeclarationStatement ||
- aClass instanceof PsiTypeParameter) return false;
+ if (helper.isCurrentFileAlreadyChecked()) {
+ if (aClass.getContainingClass() != null && aClass.hasModifierProperty(PsiModifier.PRIVATE) ||
+ aClass.getParent() instanceof PsiDeclarationStatement ||
+ aClass instanceof PsiTypeParameter) return false;
+ }
return !weAreSureThereAreNoUsages(aClass, progress, helper);
}
class <warning descr="Class UnusedClass is unused">UnusedClass</warning> {}
-class Bar {
+class Bar<T, <warning descr="Class Unused is unused">Unused</warning>> {
int <warning descr="Property unusedProperty is unused">unusedProperty</warning> = 2
- int usedProperty = 39
+ T usedProperty = null
int usedProperty2 = 39
int usedProperty3 = 39
def <warning descr="Method unusedMethod is unused">unusedMethod</warning>() {}