public static boolean hasReceiver( PsiType[] parameterTypes, QualifierResolveResult qualifierResolveResult, PsiMethodReferenceExpression methodRef) { if (parameterTypes.length > 0 && !methodRef.isConstructor() && isReceiverType( parameterTypes[0], qualifierResolveResult.getContainingClass(), qualifierResolveResult.getSubstitutor()) && isStaticallyReferenced(methodRef)) { return true; } return false; }
@Nullable public static PsiType getQualifierType(PsiMethodReferenceExpression expression) { PsiType qualifierType = null; final PsiTypeElement typeElement = expression.getQualifierType(); if (typeElement != null) { qualifierType = typeElement.getType(); } else { final PsiElement qualifier = expression.getQualifier(); if (qualifier instanceof PsiExpression) { qualifierType = ((PsiExpression) qualifier).getType(); } } if (qualifierType == null) { final QualifierResolveResult qualifierResolveResult = getQualifierResolveResult(expression); final PsiClass containingClass = qualifierResolveResult.getContainingClass(); if (containingClass == null) { return null; } qualifierType = JavaPsiFacade.getElementFactory(expression.getProject()).createType(containingClass); } return qualifierType; }