Last active
August 29, 2015 13:56
Revisions
-
jodastephen revised this gist
Mar 6, 2014 . 1 changed file with 279 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # HG changeset patch # User scolebourne # Date 1394124690 0 # Node ID a5bc7c88421b53704ee24c7a7cd003fec3a0cbc2 # Parent 164623eb3a9de2bc6c17831a2eb0e02cad770994 Fix typos and enhance Javadoc @@ -837,6 +837,17 @@ diff --git a/src/share/classes/java/time/Month.java b/src/share/classes/java/tim diff --git a/src/share/classes/java/time/MonthDay.java b/src/share/classes/java/time/MonthDay.java --- a/src/share/classes/java/time/MonthDay.java +++ b/src/share/classes/java/time/MonthDay.java @@ -90,8 +90,8 @@ * A month-day in the ISO-8601 calendar system, such as {@code --12-03}. * <p> * {@code MonthDay} is an immutable date-time object that represents the combination - * of a year and month. Any field that can be derived from a month and day, such as - * quarter-of-year, can be obtained. + * of a month and day-of-month. Any field that can be derived from a month and day, + * such as quarter-of-year, can be obtained. * <p> * This class does not store or represent a year, time or time-zone. * For example, the value "December 3rd" can be stored in a {@code MonthDay}. @@ -154,7 +154,7 @@ /** * Obtains the current month-day from the system clock in the default time-zone. @@ -882,6 +893,15 @@ diff --git a/src/share/classes/java/time/MonthDay.java b/src/share/classes/java/ * If it is not possible to return the value, because the field is not supported * or for some other reason, an exception is thrown. * <p> @@ -501,7 +501,7 @@ * This method checks whether this month and day and the input year form * a valid date. This can only return false for February 29th. * - * @param year the year to validate, an out of range value returns false + * @param year the year to validate * @return true if the year is valid for this month-day * @see Year#isValidMonthDay(MonthDay) */ @@ -685,7 +685,7 @@ } @@ -1665,6 +1685,15 @@ diff --git a/src/share/classes/java/time/Year.java b/src/share/classes/java/time * will only be one decade as it is one year short of two decades. * <p> * There are two equivalent ways of using this method. @@ -948,7 +948,7 @@ * <p> * The day-of-year value 366 is only valid in a leap year. * - * @param dayOfYear the day-of-year to use, not null + * @param dayOfYear the day-of-year to use, from 1 to 365-366 * @return the local date formed from this year and the specified date of year, not null * @throws DateTimeException if the day of year is zero or less, 366 or greater or equal * to 366 and this is not a leap year @@ -1025,7 +1025,7 @@ } @@ -2180,6 +2209,19 @@ diff --git a/src/share/classes/java/time/ZonedDateTime.java b/src/share/classes/ * will only be one month as it is one minute short of two months. * <p> * There are two equivalent ways of using this method. diff --git a/src/share/classes/java/time/chrono/ChronoLocalDate.java b/src/share/classes/java/time/chrono/ChronoLocalDate.java --- a/src/share/classes/java/time/chrono/ChronoLocalDate.java +++ b/src/share/classes/java/time/chrono/ChronoLocalDate.java @@ -256,8 +256,8 @@ * This allows dates in different calendar systems to be compared based * on the position of the date on the local time-line. * The underlying comparison is equivalent to comparing the epoch-day. + * * @return a comparator that compares in time-line order ignoring the chronology - * * @see #isAfter * @see #isBefore * @see #isEqual diff --git a/src/share/classes/java/time/chrono/ChronoLocalDateImpl.java b/src/share/classes/java/time/chrono/ChronoLocalDateImpl.java --- a/src/share/classes/java/time/chrono/ChronoLocalDateImpl.java +++ b/src/share/classes/java/time/chrono/ChronoLocalDateImpl.java @@ -2237,10 +2279,80 @@ diff --git a/src/share/classes/java/time/chrono/ChronoLocalDateImpl.java b/src/s * <p> * This subtracts the specified period in weeks to the date. * In some cases, subtracting weeks can cause the resulting date to become invalid. diff --git a/src/share/classes/java/time/chrono/ChronoLocalDateTime.java b/src/share/classes/java/time/chrono/ChronoLocalDateTime.java --- a/src/share/classes/java/time/chrono/ChronoLocalDateTime.java +++ b/src/share/classes/java/time/chrono/ChronoLocalDateTime.java @@ -131,7 +131,6 @@ * The underlying comparison is equivalent to comparing the epoch-day and nano-of-day. * * @return a comparator that compares in time-line order ignoring the chronology - * * @see #isAfter * @see #isBefore * @see #isEqual @@ -323,7 +322,7 @@ * what the result of this method will be. * <p> * The result of this method is obtained by invoking the - * {@link java.time.temporal.TemporalQuery#queryFrom(TemporalAccessor)} method on the + * {@link TemporalQuery#queryFrom(TemporalAccessor)} method on the * specified query passing {@code this} as the argument. * * @param <R> the type of the result diff --git a/src/share/classes/java/time/chrono/ChronoZonedDateTime.java b/src/share/classes/java/time/chrono/ChronoZonedDateTime.java --- a/src/share/classes/java/time/chrono/ChronoZonedDateTime.java +++ b/src/share/classes/java/time/chrono/ChronoZonedDateTime.java @@ -132,7 +132,6 @@ * The underlying comparison is equivalent to comparing the epoch-second and nano-of-second. * * @return a comparator that compares in time-line order ignoring the chronology - * * @see #isAfter * @see #isBefore * @see #isEqual @@ -292,7 +291,7 @@ * <p> * This instance is immutable and unaffected by this method call. * - * @return a {@code ZoneChronoDateTime} based on this date-time with the earlier offset, not null + * @return a {@code ChronoZonedDateTime} based on this date-time with the earlier offset, not null * @throws DateTimeException if no rules can be found for the zone * @throws DateTimeException if no rules are valid for this date-time */ @@ -319,7 +318,7 @@ ChronoZonedDateTime<D> withLaterOffsetAtOverlap(); /** - * Returns a copy of this ZonedDateTime with a different time-zone, + * Returns a copy of this date-time with a different time-zone, * retaining the local date-time if possible. * <p> * This method changes the time-zone and retains the local date-time. @@ -470,7 +469,7 @@ * what the result of this method will be. * <p> * The result of this method is obtained by invoking the - * {@link java.time.temporal.TemporalQuery#queryFrom(TemporalAccessor)} method on the + * {@link TemporalQuery#queryFrom(TemporalAccessor)} method on the * specified query passing {@code this} as the argument. * * @param <R> the type of the result diff --git a/src/share/classes/java/time/chrono/Chronology.java b/src/share/classes/java/time/chrono/Chronology.java --- a/src/share/classes/java/time/chrono/Chronology.java +++ b/src/share/classes/java/time/chrono/Chronology.java @@ -132,8 +132,9 @@ * The set of available chronologies can be extended by applications. * Adding a new calendar system requires the writing of an implementation of * {@code Chronology}, {@code ChronoLocalDate} and {@code Era}. - * The majority of the logic specific to the calendar system will be in - * {@code ChronoLocalDate}. The {@code Chronology} subclass acts as a factory. + * The majority of the logic specific to the calendar system will be in the + * {@code ChronoLocalDate} implementation. + * The {@code Chronology} implementation acts as a factory. * <p> * To permit the discovery of additional chronologies, the {@link java.util.ServiceLoader ServiceLoader} * is used. A file must be added to the {@code META-INF/services} directory with the @@ -167,7 +168,7 @@ * If the specified temporal object does not have a chronology, {@link IsoChronology} is returned. * <p> * This method matches the signature of the functional interface {@link TemporalQuery} @@ -2249,7 +2361,16 @@ diff --git a/src/share/classes/java/time/chrono/Chronology.java b/src/share/clas * * @param temporal the temporal to convert, not null * @return the chronology, not null @@ -413,7 +414,7 @@ * The alternate clock may be introduced using {@link Clock dependency injection}. * * @implSpec - * The default implementation invokes {@link #date(TemporalAccessor)} )}. + * The default implementation invokes {@link #date(TemporalAccessor)}. * * @param clock the clock to use, not null * @return the current local date, not null @@ -622,7 +623,7 @@ * The parameters control the style of the returned text and the locale. * * @implSpec @@ -2279,10 +2400,72 @@ diff --git a/src/share/classes/java/time/chrono/Era.java b/src/share/classes/jav * If it is not possible to return the value, because the field is not supported * or for some other reason, an exception is thrown. * <p> diff --git a/src/share/classes/java/time/format/DateTimeFormatter.java b/src/share/classes/java/time/format/DateTimeFormatter.java --- a/src/share/classes/java/time/format/DateTimeFormatter.java +++ b/src/share/classes/java/time/format/DateTimeFormatter.java @@ -1974,7 +1974,7 @@ * Errors are returned using the error index field of the {@code ParsePosition} * instead of {@code DateTimeParseException}. * The returned error index will be set to an index indicative of the error. - * Callers must check for errors before using the context. + * Callers must check for errors before using the result. * <p> * If the formatter parses the same field more than once with different values, * the result will be an error. diff --git a/src/share/classes/java/time/format/DateTimeFormatterBuilder.java b/src/share/classes/java/time/format/DateTimeFormatterBuilder.java --- a/src/share/classes/java/time/format/DateTimeFormatterBuilder.java +++ b/src/share/classes/java/time/format/DateTimeFormatterBuilder.java @@ -137,7 +137,6 @@ * <li>ChronologyText - the name of the chronology</li> * <li>Literal - a text literal</li> * <li>Nested and Optional - formats can be nested or made optional</li> - * <li>Other - the printer and parser interfaces can be used to add user supplied formatting</li> * </ul> * In addition, any of the elements may be decorated by padding, either with spaces or any other character. * <p> @@ -194,8 +193,8 @@ * The locale and chronology are used to lookup the locale specific format * for the requested dateStyle and/or timeStyle. * - * @param dateStyle the FormatStyle for the date - * @param timeStyle the FormatStyle for the time + * @param dateStyle the FormatStyle for the date, null for time-only pattern + * @param timeStyle the FormatStyle for the time, null for date-only pattern * @param chrono the Chronology, non-null * @param locale the locale, non-null * @return the locale and Chronology specific formatting pattern @@ -747,9 +746,9 @@ * defines the connection between each value and the text: * <pre> * Map<Long, String> map = new HashMap<>(); - * map.put(1, "JNY"); - * map.put(2, "FBY"); - * map.put(3, "MCH"); + * map.put(1L, "JNY"); + * map.put(2L, "FBY"); + * map.put(3L, "MCH"); * ... * builder.appendText(MONTH_OF_YEAR, map); * </pre> @@ -841,7 +840,7 @@ * <p> * The {@linkplain ResolverStyle resolver style} has no effect on instant parsing. * The end-of-day time of '24:00' is handled as midnight at the start of the following day. - * The leap-second time of '23:59:59' is handled to some degree, see + * The leap-second time of '23:59:60' is handled to some degree, see * {@link DateTimeFormatter#parsedLeapSecond()} for full details. * <p> * An alternative to this method is to format/parse the instant as a single @@ -864,7 +863,7 @@ * Appends the zone offset, such as '+01:00', to the formatter. * <p> * This appends an instruction to format/parse the offset ID to the builder. - * This is equivalent to calling {@code appendOffset("HH:MM:ss", "Z")}. + * This is equivalent to calling {@code appendOffset("+HH:MM:ss", "Z")}. * * @return this, for chaining, not null */ @@ -1049,7 +1048,7 @@ * "GMT+01:30" -- ZoneOffset.of("+01:30") * </pre> * <p> @@ -2291,7 +2474,7 @@ diff --git a/src/share/classes/java/time/format/DateTimeFormatterBuilder.java b/ * in the mechanism used to obtain the zone. * Note also that parsing accepts offsets, whereas formatting will never * produce one. @@ -1107,7 +1106,7 @@ * "GMT+01:30" -- ZoneOffset.of("GMT+01:30") * </pre> * <p> @@ -2300,6 +2483,96 @@ diff --git a/src/share/classes/java/time/format/DateTimeFormatterBuilder.java b/ * in the mechanism used to obtain the zone. * * @return this, for chaining, not null @@ -1132,7 +1131,7 @@ * for the locale set in the {@link DateTimeFormatter}. * If the temporal object being printed represents an instant, then the text * will be the summer or winter time text as appropriate. - * If the lookup for text does not find any suitable reuslt, then the + * If the lookup for text does not find any suitable result, then the * {@link ZoneId#getId() ID} will be printed instead. * If the zone cannot be obtained then an exception is thrown unless the * section of the formatter is optional. @@ -1168,7 +1167,7 @@ * for the locale set in the {@link DateTimeFormatter}. * If the temporal object being printed represents an instant, then the text * will be the summer or winter time text as appropriate. - * If the lookup for text does not find any suitable reuslt, then the + * If the lookup for text does not find any suitable result, then the * {@link ZoneId#getId() ID} will be printed instead. * If the zone cannot be obtained then an exception is thrown unless the * section of the formatter is optional. @@ -1182,7 +1181,7 @@ * zone. This method also allows a set of preferred {@link ZoneId} to be * specified for parsing. The matched preferred zone id will be used if the * textural zone name being parsed is not unique. - * + * <p> * If the zone cannot be parsed then an exception is thrown unless the * section of the formatter is optional. * @@ -1227,7 +1226,6 @@ * <p> * The calendar system name will be output during a format. * If the chronology cannot be obtained then an exception will be thrown. - * The calendar system name is obtained from the Chronology. * * @param textStyle the text style to use, not null * @return this, for chaining, not null @@ -1453,7 +1451,7 @@ * LLLLL 5 appendText(ChronoField.MONTH_OF_YEAR, TextStyle.NARROW_STANDALONE) * * w 1 append special localized WeekFields element for numeric week-of-year - * ww 1 append special localized WeekFields element for numeric week-of-year, zero-padded + * ww 2 append special localized WeekFields element for numeric week-of-year, zero-padded * W 1 append special localized WeekFields element for numeric week-of-month * d 1 appendValue(ChronoField.DAY_OF_MONTH) * dd 2 appendValue(ChronoField.DAY_OF_MONTH, 2) @@ -1880,7 +1878,6 @@ * <p> * During parsing, the padding and decorated element are parsed. * If parsing is lenient, then the pad width is treated as a maximum. - * If parsing is case insensitive, then the pad character is matched ignoring case. * The padding is parsed greedily. Thus, if the decorated element starts with * the pad character, it will not be parsed. * diff --git a/src/share/classes/java/time/format/DecimalStyle.java b/src/share/classes/java/time/format/DecimalStyle.java --- a/src/share/classes/java/time/format/DecimalStyle.java +++ b/src/share/classes/java/time/format/DecimalStyle.java @@ -62,7 +62,6 @@ package java.time.format; import java.text.DecimalFormatSymbols; -import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Locale; @@ -138,7 +137,7 @@ * of(Locale.getDefault(Locale.Category.FORMAT))}. * * @see java.util.Locale.Category#FORMAT - * @return the info, not null + * @return the decimal style, not null */ public static DecimalStyle ofDefaultLocale() { return of(Locale.getDefault(Locale.Category.FORMAT)); @@ -150,7 +149,7 @@ * This method provides access to locale sensitive decimal style symbols. * * @param locale the locale, not null - * @return the info, not null + * @return the decimal style, not null */ public static DecimalStyle of(Locale locale) { Objects.requireNonNull(locale, "locale"); @@ -340,7 +339,7 @@ //----------------------------------------------------------------------- /** - * Checks if this DecimalStyle is equal another DecimalStyle. + * Checks if this DecimalStyle is equal to another DecimalStyle. * * @param obj the object to check, null returns false * @return true if this is equal to the other date diff --git a/src/share/classes/java/time/temporal/IsoFields.java b/src/share/classes/java/time/temporal/IsoFields.java --- a/src/share/classes/java/time/temporal/IsoFields.java +++ b/src/share/classes/java/time/temporal/IsoFields.java -
jodastephen revised this gist
Feb 19, 2014 . 1 changed file with 81 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ # HG changeset patch # User scolebourne # Date 1392815488 0 # Node ID 2107e39f04bd48c5cc1abae541270a92f38f5fbc # Parent 164623eb3a9de2bc6c17831a2eb0e02cad770994 Fix typos and enhance Javadoc diff --git a/src/share/classes/java/time/DayOfWeek.java b/src/share/classes/java/time/DayOfWeek.java @@ -1386,6 +1386,15 @@ diff --git a/src/share/classes/java/time/OffsetTime.java b/src/share/classes/jav * If it is not possible to return the value, because the field is not supported * or for some other reason, an exception is thrown. * <p> @@ -575,7 +575,7 @@ * <p> * This method returns an object with the specified {@code ZoneOffset} and a {@code LocalTime} * adjusted by the difference between the two offsets. - * This will result in the old and new objects representing the same instant an an implied day. + * This will result in the old and new objects representing the same instant on an implied day. * This is useful for finding the local time in a different offset. * For example, if this time represents {@code 10:30+02:00} and the offset specified is * {@code +03:00}, then this method will return {@code 11:30+03:00}. @@ -737,7 +737,7 @@ //----------------------------------------------------------------------- @@ -1856,6 +1865,15 @@ diff --git a/src/share/classes/java/time/ZoneOffset.java b/src/share/classes/jav diff --git a/src/share/classes/java/time/ZonedDateTime.java b/src/share/classes/java/time/ZonedDateTime.java --- a/src/share/classes/java/time/ZonedDateTime.java +++ b/src/share/classes/java/time/ZonedDateTime.java @@ -418,7 +418,7 @@ * <p> * Converting an instant to a zoned date-time is simple as there is only one valid * offset for each instant. If the valid offset is different to the offset specified, - * the the date-time and offset of the zoned date-time will differ from those specified. + * then the date-time and offset of the zoned date-time will differ from those specified. * <p> * If the {@code ZoneId} to be used is a {@code ZoneOffset}, this method is equivalent * to {@link #of(LocalDateTime, ZoneId)}. @@ -469,6 +469,7 @@ * @param offset the zone offset, not null * @param zone the time-zone, not null @@ -2231,6 +2249,15 @@ diff --git a/src/share/classes/java/time/chrono/Chronology.java b/src/share/clas * * @param temporal the temporal to convert, not null * @return the chronology, not null @@ -622,7 +622,7 @@ * The parameters control the style of the returned text and the locale. * * @implSpec - * The default implementation behaves as the the formatter was used to + * The default implementation behaves as though the formatter was used to * format the chronology textual name. * * @param style the style of the text required, not null diff --git a/src/share/classes/java/time/chrono/Era.java b/src/share/classes/java/time/chrono/Era.java --- a/src/share/classes/java/time/chrono/Era.java +++ b/src/share/classes/java/time/chrono/Era.java @@ -2252,6 +2279,27 @@ diff --git a/src/share/classes/java/time/chrono/Era.java b/src/share/classes/jav * If it is not possible to return the value, because the field is not supported * or for some other reason, an exception is thrown. * <p> diff --git a/src/share/classes/java/time/format/DateTimeFormatterBuilder.java b/src/share/classes/java/time/format/DateTimeFormatterBuilder.java --- a/src/share/classes/java/time/format/DateTimeFormatterBuilder.java +++ b/src/share/classes/java/time/format/DateTimeFormatterBuilder.java @@ -1049,7 +1049,7 @@ * "GMT+01:30" -- ZoneOffset.of("+01:30") * </pre> * <p> - * Note that this method is is identical to {@code appendZoneId()} except + * Note that this method is identical to {@code appendZoneId()} except * in the mechanism used to obtain the zone. * Note also that parsing accepts offsets, whereas formatting will never * produce one. @@ -1107,7 +1107,7 @@ * "GMT+01:30" -- ZoneOffset.of("GMT+01:30") * </pre> * <p> - * Note that this method is is identical to {@code appendZoneId()} except + * Note that this method is identical to {@code appendZoneId()} except * in the mechanism used to obtain the zone. * * @return this, for chaining, not null diff --git a/src/share/classes/java/time/temporal/IsoFields.java b/src/share/classes/java/time/temporal/IsoFields.java --- a/src/share/classes/java/time/temporal/IsoFields.java +++ b/src/share/classes/java/time/temporal/IsoFields.java @@ -2352,6 +2400,15 @@ diff --git a/src/share/classes/java/time/temporal/TemporalField.java b/src/share */ TemporalUnit getRangeUnit(); @@ -179,7 +179,7 @@ * Checks if this field is supported by the temporal object. * <p> * This determines whether the temporal accessor supports this field. - * If this returns false, the the temporal cannot be queried for this field. + * If this returns false, then the temporal cannot be queried for this field. * <p> * There are two equivalent ways of using this method. * The first is to invoke this method directly. diff --git a/src/share/classes/java/time/temporal/TemporalUnit.java b/src/share/classes/java/time/temporal/TemporalUnit.java --- a/src/share/classes/java/time/temporal/TemporalUnit.java +++ b/src/share/classes/java/time/temporal/TemporalUnit.java @@ -2364,3 +2421,24 @@ diff --git a/src/share/classes/java/time/temporal/TemporalUnit.java b/src/share/ * @throws UnsupportedTemporalTypeException if the unit is not supported by the temporal */ <R extends Temporal> R addTo(R temporal, long amount); diff --git a/src/share/classes/java/time/zone/ZoneOffsetTransition.java b/src/share/classes/java/time/zone/ZoneOffsetTransition.java --- a/src/share/classes/java/time/zone/ZoneOffsetTransition.java +++ b/src/share/classes/java/time/zone/ZoneOffsetTransition.java @@ -83,7 +83,7 @@ * The discontinuity is normally a gap in spring and an overlap in autumn. * {@code ZoneOffsetTransition} models the transition between the two offsets. * <p> - * Gaps occur where there are local date-times that simply do not not exist. + * Gaps occur where there are local date-times that simply do not exist. * An example would be when the offset changes from {@code +03:00} to {@code +04:00}. * This might be described as 'the clocks will move forward one hour tonight at 1am'. * <p> @@ -334,7 +334,7 @@ /** * Does this transition represent a gap in the local time-line. * <p> - * Gaps occur where there are local date-times that simply do not not exist. + * Gaps occur where there are local date-times that simply do not exist. * An example would be when the offset changes from {@code +01:00} to {@code +02:00}. * This might be described as 'the clocks will move forward one hour tonight at 1am'. * -
jodastephen created this gist
Feb 13, 2014 .There are no files selected for viewing