DateTimeFormatter javadoc has error in example

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • None
    • Affects Version/s: 8u40
    • Component/s: core-libs
    • x86_64
    • linux

      A DESCRIPTION OF THE PROBLEM :
      In the javadoc for the class java.time.format.DateTimeFormatter, the example that reads:
      String text = date.toString(formatter);
      should read:
      String text = date.format(formatter);


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      String text = date.format(formatter);

      ACTUAL -
      String text = date.toString(formatter);

      URL OF FAULTY DOCUMENTATION :
      https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html

            Assignee:
            Roger Riggs
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: