public static PsiSubstitutor chooseSiteSubstitutor(MethodCandidateInfo currentMethod,
                                                     JavaResolveResult resolveResult, PsiMethod method) {
    return resolveResult instanceof MethodCandidateInfo && method != null && !method.isConstructor() //constructor reference was erased 
           ? ((MethodCandidateInfo)resolveResult).getSiteSubstitutor() 
           : currentMethod != null ? currentMethod.getSiteSubstitutor() : PsiSubstitutor.EMPTY;
  }
public static PsiSubstitutor chooseSiteSubstitutor(MethodCandidateInfo currentMethod,
                                                     JavaResolveResult resolveResult, PsiMethod method)