mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: reject isExact for no constructor parameterized class
This commit is contained in:
+13
-14
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user