JavaResolveResult (@NotNull PsiJavaCodeReferenceElement ref, @NotNull PsiFile containingFile) { try { if (ref instanceof PsiReferenceExpressionImpl) { PsiReferenceExpressionImpl.OurGenericsResolver resolver = PsiReferenceExpressionImpl.OurGenericsResolver.INSTANCE; JavaResolveResult[] results = JavaResolveUtil.resolveWithContainingFile(ref, resolver, true, true, containingFile); return results.length == 1 ? results[0] : JavaResolveResult.EMPTY; } return ref.advancedResolve(true); } catch (IndexNotReadyException e) { return null; } }