mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
create method from usage: check corresponding to used subst
This commit is contained in:
+2
-1
@@ -78,10 +78,11 @@ public class CreateMethodFromUsageFix extends CreateFromUsageBaseFix {
|
||||
|
||||
private static boolean isMethodSignatureExists(PsiMethodCallExpression call, PsiClass target) {
|
||||
String name = call.getMethodExpression().getReferenceName();
|
||||
final JavaResolveResult resolveResult = call.getMethodExpression().advancedResolve(false);
|
||||
PsiExpressionList list = call.getArgumentList();
|
||||
PsiMethod[] methods = target.findMethodsByName(name, false);
|
||||
for (PsiMethod method : methods) {
|
||||
if (PsiUtil.isApplicable(method, PsiSubstitutor.EMPTY, list)) return true;
|
||||
if (PsiUtil.isApplicable(method, resolveResult.getSubstitutor(), list)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user