if (file instanceof PsiJavaFile) {
<BUG>PsiPackage aPackage = JavaPsiFacade.getInstance(member.getProject()).findPackage(((PsiJavaFile)file).getPackageName());
</BUG>
if (aPackage != null) {
SearchScope scope = PackageScope.packageScope(aPackage, false);
<BUG>scope = scope.intersectWith(maximalUseScope);

return scope;</BUG>
}
}

if (file instanceof PsiJavaFile) {
PsiPackage aPackage = JavaPsiFacade.getInstance(project).findPackage(((PsiJavaFile)file).getPackageName());
if (aPackage != null) {
SearchScope scope = PackageScope.packageScope(aPackage, false);
return scope.intersectWith(maximalUseScope);
}
}
