new inference: reject isExact for no constructor parameterized class

This commit is contained in:
anna
2013-11-08 19:39:33 +01:00
parent 5fafbd5944
commit 35c07dac65
@@ -84,23 +84,22 @@ public class PsiMethodReferenceExpressionImpl extends PsiReferenceExpressionBase
}
else if (isConstructor()) {
methods = containingClass.getConstructors();
if (methods.length == 0) { //default constructor
return containingClass;
}
}
if (methods != null) {
PsiMethod psiMethod = null;
for (PsiMethod method : methods) {
if (PsiUtil.isAccessible(method, this, null)) {
if (psiMethod != null) return null;
psiMethod = method;
if (methods.length > 0) {
for (PsiMethod method : methods) {
if (PsiUtil.isAccessible(method, this, null)) {
if (psiMethod != null) return null;
psiMethod = method;
}
}
if (psiMethod == null) return null;
if (psiMethod.isVarArgs()) return null;
if (psiMethod.getTypeParameters().length > 0) {
final PsiReferenceParameterList parameterList = getParameterList();
return parameterList != null && parameterList.getTypeParameterElements().length > 0 ? psiMethod : null;
}
}
if (psiMethod == null) return null;
if (psiMethod.isVarArgs()) return null;
if (psiMethod.getTypeParameters().length > 0) {
final PsiReferenceParameterList parameterList = getParameterList();
return parameterList != null && parameterList.getTypeParameterElements().length > 0 ? psiMethod : null;
}
if (containingClass.hasTypeParameters()) {
final PsiElement qualifier = getQualifier();
@@ -119,7 +118,7 @@ public class PsiMethodReferenceExpressionImpl extends PsiReferenceExpressionBase
}
}
}
return psiMethod;
return psiMethod == null ? containingClass : psiMethod;
}
}
return null;