void (MultiMap<PsiElement, @NlsContexts.DialogMessage String> conflicts) { checkParametersConflicts(conflicts); PsiMethod prototype; try { PsiElementFactory factory = JavaPsiFacade.getElementFactory(myProject); prototype = factory.createMethod(getChosenMethodName(), myReturnType); if (myTypeParameterList != null) prototype.getTypeParameterList().replace(myTypeParameterList); for (VariableData data : myInputVariables) { if (data.passAsParameter) { prototype.getParameterList().add(factory.createParameter(data.name, data.type)); } } // set the modifiers with which the method is supposed to be created PsiUtil.setModifierProperty(prototype, PsiModifier.PRIVATE, true); } catch (IncorrectOperationException e) { return; } ConflictsUtil.checkMethodConflicts(myTargetClass, null, prototype, conflicts); }