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
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
- duplicates
-
JDK-8062796 java.time.format.DateTimeFormatter error in API doc example
-
- Resolved
-
-
JDK-8062796 java.time.format.DateTimeFormatter error in API doc example
-
- Resolved
-