PsiMethod[] (PsiField field) { final PsiMethod setter = GenerateMembersUtil.generateSimpleSetterPrototype(field); final Project project = field.getProject(); final PsiType wrappedType = JavaFxPsiUtil.getWrappedPropertyType(field, project, JavaFxCommonNames.ourWritableMap); LOG.assertTrue(wrappedType != null, field.getType()); final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(project); final PsiTypeElement newTypeElement = elementFactory.createTypeElement(wrappedType); final PsiParameter[] parameters = setter.getParameterList().getParameters(); LOG.assertTrue(parameters.length == 1); final PsiParameter parameter = parameters[0]; final PsiTypeElement typeElement = parameter.getTypeElement(); LOG.assertTrue(typeElement != null); typeElement.replace(newTypeElement); final PsiCodeBlock body = setter.getBody(); LOG.assertTrue(body != null); body.getStatements()[0].replace(elementFactory.createStatementFromText("this." + field.getName() + ".set(" + parameter.getName() + ");", field)); return new PsiMethod[] {setter}; }