JDK-8077105 : DateTimeFormatter javadoc has error in example
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.time
  • Affected Version: 8u40
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86_64
  • Submitted: 2015-04-01
  • Updated: 2015-04-07
  • Resolved: 2015-04-07
Related Reports
Duplicate :  
Duplicate :  
Description
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