Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8077105

DateTimeFormatter javadoc has error in example

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • 8u40
    • 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

            rriggs Roger Riggs
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: