MethodSignatureBackedByPsiMethod (@NotNull PsiMethod method, @NotNull PsiSubstitutor substitutor, boolean isRaw) { PsiTypeParameter[] methodTypeParameters = method.getTypeParameters(); if (isRaw) { substitutor = JavaPsiFacade.getElementFactory(method.getProject()).createRawSubstitutor(substitutor, methodTypeParameters); methodTypeParameters = PsiTypeParameter.EMPTY_ARRAY; } try { substitutor.ensureValid(); } catch (ProcessCanceledException e) { throw e; } catch (Throwable e) { throw PluginException.createByClass(e, method.getClass()); } final PsiParameter[] parameters = method.getParameterList().getParameters(); PsiType[] parameterTypes = PsiType.createArray(parameters.length); for (int i = 0; i < parameterTypes.length; i++) { PsiParameter parameter = parameters[i]; PsiType type = parameter.getType(); parameterTypes[i] = isRaw ? TypeConversionUtil.erasure(substitutor.substitute(type)) : type; } return new MethodSignatureBackedByPsiMethod(method, substitutor, isRaw, parameterTypes, methodTypeParameters); }