code: @Restricted(NoExternalUse.class)
      public @Nonnull FormValidation doCheckNewName(@QueryParameter String newName) {
          // TODO: Create an Item.RENAME permission to use here, see JENKINS-18649.
          if (!hasPermission(Item.CONFIGURE)) {
              if (parent instanceof AccessControlled) {
                  ((AccessControlled)parent).checkPermission(Item.CREATE);
              }
              checkPermission(Item.DELETE);
          }
  
          newName = newName == null ? null : newName.trim();
          try {
              Jenkins.checkGoodName(newName);
              assert newName != null; // Would have thrown Failure
              if (newName.equals(name)) {
                  return FormValidation.warning(Messages.AbstractItem_NewNameUnchanged());
              }
              Jenkins.get().getProjectNamingStrategy().checkName(newName);
              checkIfNameIsUsed(newName);
              checkRename(newName);
          } catch (Failure e) {
              return FormValidation.error(e.getMessage());
          }
          return FormValidation.ok();
      }
docs: Called by {@link #doConfirmRename} and {@code rename.jelly} to validate renames.
  @return {@link FormValidation#ok} if this item can be renamed as specified, otherwise
  {@link FormValidation#error} with a message explaining the problem.