code: public DateTimeFormatter toFormatter(Locale locale) {
          Jdk8Methods.requireNonNull(locale, "locale");
          while (active.parent != null) {
              optionalEnd();
          }
          CompositePrinterParser pp = new CompositePrinterParser(printerParsers, false);
          return new DateTimeFormatter(pp, locale, DecimalStyle.STANDARD, ResolverStyle.SMART, null, null, null);
      }
docs: Completes this builder by creating the DateTimeFormatter using the specified locale.
  <p>
  This will create a formatter with the specified locale.
  Numbers will be printed and parsed using the standard non-localized set of symbols.
  <p>
  Calling this method will end any open optional sections by repeatedly
  calling {@link #optionalEnd()} before creating the formatter.
  <p>
  This builder can still be used after creating the formatter if desired,
  although the state may have been changed by calls to {@code optionalEnd}.
  
  @param locale  the locale to use for formatting, not null
  @return the created formatter, not null