LightMethodBuilder (PsiClass typeDefinition, PsiMethod method, PsiClass baseClass, PsiSubstitutor substitutor) { final LightMethodBuilder builder = new LightMethodBuilder(method.getManager(), method.getName()); substitutor = substitutor.putAll(TypeConversionUtil.getSuperClassSubstitutor(baseClass, typeDefinition, PsiSubstitutor.EMPTY)); for (PsiParameter parameter : method.getParameterList().getParameters()) { builder.addParameter(parameter.getName(), substitutor.substitute(parameter.getType())); } builder.setMethodReturnType(substitutor.substitute(method.getReturnType())); for (String modifier : STUB_MODIFIERS) { if (method.hasModifierProperty(modifier)) { builder.addModifier(modifier); } } return builder; }