# HG changeset patch # User rriggs # Date 1422652437 18000 # Node ID 47403deaec4422d30681f1d3a8ba07075647d4cb # Parent a1dae439cdab8bc9fec42854ff81d36c814512e3 8068284: Missing @throws in DateTimeFormatterBuilder.appendOffset 8068285: Missing @throws in DateTimeFormatterBuilder.appendInstant 8062803: 'principal' should be 'principle' in java.time package description 8062796: java.time.format.DateTimeFormatter error in API doc example Reviewed-by: lancea, mchung diff -r a1dae439cdab -r 47403deaec44 jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java --- a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java Fri Jan 30 16:13:04 2015 -0500 +++ b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java Fri Jan 30 16:13:57 2015 -0500 @@ -117,8 +117,9 @@ * {@code parse(CharSequence text, DateTimeFormatter formatter)}. *

For example: *

+ *  LocalDate date = LocalDate.now();
  *  String text = date.format(formatter);
- *  LocalDate date = LocalDate.parse(text, formatter);
+ *  LocalDate parsedDate = LocalDate.parse(text, formatter);
  * 
*

* In addition to the format, formatters can be created with desired Locale, @@ -265,9 +266,10 @@ *

* For example: *

+ *  LocalDate date = LocalDate.now();
  *  DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy MM dd");
  *  String text = date.format(formatter);
- *  LocalDate date = LocalDate.parse(text, formatter);
+ *  LocalDate parsedDate = LocalDate.parse(text, formatter);
  * 
*

* All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters. The diff -r a1dae439cdab -r 47403deaec44 jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java --- a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java Fri Jan 30 16:13:04 2015 -0500 +++ b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java Fri Jan 30 16:13:57 2015 -0500 @@ -849,6 +849,7 @@ * @param fractionalDigits the number of fractional second digits to format with, * from 0 to 9, or -1 to use as many digits as necessary * @return this, for chaining, not null + * @throws IllegalArgumentException if the number of fractional digits is invalid */ public DateTimeFormatterBuilder appendInstant(int fractionalDigits) { if (fractionalDigits < -1 || fractionalDigits > 9) { @@ -909,6 +910,7 @@ * @param pattern the pattern to use, not null * @param noOffsetText the text to use when the offset is zero, not null * @return this, for chaining, not null + * @throws IllegalArgumentException if the pattern is invalid */ public DateTimeFormatterBuilder appendOffset(String pattern, String noOffsetText) { appendInternal(new OffsetIdPrinterParser(pattern, noOffsetText)); diff -r a1dae439cdab -r 47403deaec44 jdk/src/java.base/share/classes/java/time/package-info.java --- a/jdk/src/java.base/share/classes/java/time/package-info.java Fri Jan 30 16:13:04 2015 -0500 +++ b/jdk/src/java.base/share/classes/java/time/package-info.java Fri Jan 30 16:13:57 2015 -0500 @@ -65,7 +65,7 @@ * The main API for dates, times, instants, and durations. *

*

- * The classes defined here represent the principal date-time concepts, + * The classes defined here represent the principle date-time concepts, * including instants, durations, dates, times, time-zones and periods. * They are based on the ISO calendar system, which is the de facto world * calendar following the proleptic Gregorian rules. @@ -247,8 +247,8 @@ * *

* Multiple calendar systems is an awkward addition to the design challenges. - * The first principal is that most users want the standard ISO calendar system. - * As such, the main classes are ISO-only. The second principal is that most of those that want a + * The first principle is that most users want the standard ISO calendar system. + * As such, the main classes are ISO-only. The second principle is that most of those that want a * non-ISO calendar system want it for user interaction, thus it is a UI localization issue. * As such, date and time objects should be held as ISO objects in the data model and persistent * storage, only being converted to and from a local calendar for display.