code: public void setCommandExecutor(ActionCommandExecutor commandExecutor) {
          if (ObjectUtils.nullSafeEquals(this.commandExecutor, commandExecutor)) {
              return;
          }
          if (commandExecutor == null) {
              detachCommandExecutor();
          }
          else {
              if (this.commandExecutor instanceof GuardedActionCommandExecutor) {
                  unsubscribeFromGuardedCommandDelegate();
              }
              this.commandExecutor = commandExecutor;
              attachCommandExecutor();
          }
      }
docs: Attaches the given executor to this command instance, detaching the current executor in the process.
  
  @param commandExecutor The executor to be attached. May be null, in which case this command
  will be disabled.