code: @SuppressWarnings("deprecation")
      Result begin(String... argv) {
          // Preprocess @file arguments
          try {
              argv = CommandLine.parse(argv);
          } catch (IOException e) {
              error("main.cant.read", e.getMessage());
              return ERROR;
          }
  
          if (argv.length > 0 && "-Xold".equals(argv[0])) {
              warn("main.legacy_api");
              String[] nargv = Arrays.copyOfRange(argv, 1, argv.length);
              int rc = com.sun.tools.javadoc.Main.execute(
                      messager.programName,
                      messager.getWriter(WriterKind.ERROR),
                      messager.getWriter(WriterKind.WARNING),
                      messager.getWriter(WriterKind.NOTICE),
                      OldStdDocletName,
                      nargv);
              return (rc == 0) ? OK : ERROR;
          }
          return begin(Arrays.asList(argv), Collections.emptySet());
      }
docs: Main program - external wrapper. In order to maintain backward
  CLI  compatibility, we dispatch to the old tool or the old doclet's
  Start mechanism, based on the options present on the command line
  with the following precedence:
  1. presence of -Xold, dispatch to old tool
  2. doclet variant, if old, dispatch to old Start
  3. taglet variant, if old, dispatch to old Start
  
  Thus the presence of -Xold switches the tool, soon after command files
  if any, are expanded, this is performed here, noting that the messager
  is available at this point in time.
  The doclet/taglet tests are performed in the begin method, further on,
  this is to minimize argument processing and most importantly the impact
  of class loader creation, needed to detect the doclet/taglet class variants.