code: private User createAccount(SignupInfo si) throws IOException {
          if (!si.errors.isEmpty()) {
              String messages = getErrorMessages(si);
              throw new IllegalArgumentException("invalid signup info passed to createAccount(si): " + messages);
          }
          // register the user
          User user = createAccount(si.username, si.password1);
          user.setFullName(si.fullname);
          if (isMailerPluginPresent()) {
              try {
                  // legacy hack. mail support has moved out to a separate plugin
                  Class<?> up = Jenkins.getInstance().pluginManager.uberClassLoader.loadClass("hudson.tasks.Mailer$UserProperty");
                  Constructor<?> c = up.getDeclaredConstructor(String.class);
                  user.addProperty((UserProperty) c.newInstance(si.email));
              } catch (ReflectiveOperationException e) {
                  throw new RuntimeException(e);
              }
          }
          user.save();
          return user;
      }
docs: Creates a new account from a valid signup info. A signup info is valid if its {@link SignupInfo#errors}
  field is empty.
  
  @param si the valid signup info to create an account from
  @return a valid {@link User} object created from given signup info
  @throws IllegalArgumentException if an invalid signup info is passed