docs: @Override
      public void execute() throws MojoExecutionException, MojoFailureException {
          if (this.skipFormatting) {
              getLog().info("Formatting is skipped");
              return;
          }
  
          long startClock = System.currentTimeMillis();
  
          if (StringUtils.isEmpty(this.encoding)) {
              this.encoding = ReaderFactory.FILE_ENCODING;
              getLog().warn("File encoding has not been set, using platform encoding (" + this.encoding
                      + ") to format source files, i.e. build is platform dependent!");
          } else {
              if (!Charset.isSupported(this.encoding)) {
                  throw new MojoExecutionException("Encoding '" + this.encoding + "' is not supported");
              }
              getLog().info("Using '" + this.encoding + "' encoding to format source files.");
          }
  
          List<File> files = new ArrayList<>();
          if (this.directories != null) {
              for (File directory : this.directories) {
                  if (directory.exists() && directory.isDirectory()) {
                      files.addAll(addCollectionFiles(directory));
                  }
              }
          } else {
              // Using defaults of source main and test dirs
              if (this.sourceDirectory != null && this.sourceDirectory.exists() && this.sourceDirectory.isDirectory()) {
                  files.addAll(addCollectionFiles(this.sourceDirectory));
              }
              if (this.testSourceDirectory != null && this.testSourceDirectory.exists()
                      && this.testSourceDirectory.isDirectory()) {
                  files.addAll(addCollectionFiles(this.testSourceDirectory));
              }
          }
  
          int numberOfFiles = files.size();
          Log log = getLog();
          log.info("Number of files to be formatted: " + numberOfFiles);
  
          if (numberOfFiles > 0) {
              createCodeFormatter();
              ResultCollector rc = new ResultCollector();
              Properties hashCache = readFileHashCacheFile();
  
              String basedirPath = getBasedirPath();
              for (int i = 0, n = files.size(); i < n; i++) {
                  File file = files.get(i);
                  if (file.exists()) {
                      if (file.canWrite()) {
                          formatFile(file, rc, hashCache, basedirPath);
                      } else {
                          rc.readOnlyCount++;
                      }
                  } else {
                      rc.failCount++;
                  }
              }
  
              storeFileHashCache(hashCache);
  
              long endClock = System.currentTimeMillis();
  
              log.info("Successfully formatted:          " + rc.successCount + FILE_S);
              log.info("Fail to format:                  " + rc.failCount + FILE_S);
              log.info("Skipped:                         " + rc.skippedCount + FILE_S);
              log.info("Read only skipped:               " + rc.readOnlyCount + FILE_S);
              log.info("Approximate time taken:          " + ((endClock - startClock) / 1000) + "s");
          }
      }