# HG changeset patch # User martin # Date 1541644724 28800 # Wed Nov 07 18:38:44 2018 -0800 # Node ID 23989cfc1211b82d807094705a90d51932b6d077 # Parent e59fb1f7e300fac7e443b7528b65155f1696e631 8213497: "period" related typos in Duration.java Reviewed-by: scolebourne Contributed-by: Kurt Kluever diff --git a/src/java.base/share/classes/java/time/Duration.java b/src/java.base/share/classes/java/time/Duration.java --- a/src/java.base/share/classes/java/time/Duration.java +++ b/src/java.base/share/classes/java/time/Duration.java @@ -303,7 +303,7 @@ * @param amount the amount of the duration, measured in terms of the unit, positive or negative * @param unit the unit that the duration is measured in, must have an exact duration, not null * @return a {@code Duration}, not null - * @throws DateTimeException if the period unit has an estimated duration + * @throws DateTimeException if the unit has an estimated duration * @throws ArithmeticException if a numeric overflow occurs */ public static Duration of(long amount, TemporalUnit unit) { @@ -350,7 +350,7 @@ * considered to be exactly 24 hours. *

* The string starts with an optional sign, denoted by the ASCII negative - * or positive symbol. If negative, the whole period is negated. + * or positive symbol. If negative, the whole duration is negated. * The ASCII letter "P" is next in upper or lower case. * There are then four sections, each consisting of a number and a suffix. * The sections have suffixes in ASCII of "D", "H", "M" and "S" for @@ -474,7 +474,7 @@ * For full accuracy, either the {@link ChronoUnit#NANOS NANOS} unit or the * {@link ChronoField#NANO_OF_SECOND NANO_OF_SECOND} field should be supported. *

- * The result of this method can be a negative period if the end is before the start. + * The result of this method can be a negative duration if the end is before the start. * To guarantee to obtain a positive duration call {@link #abs()} on the result. * * @param startInclusive the start instant, inclusive, not null @@ -653,7 +653,7 @@ * This instance is immutable and unaffected by this method call. * * @param seconds the seconds to represent, may be negative - * @return a {@code Duration} based on this period with the requested seconds, not null + * @return a {@code Duration} based on this duration with the requested seconds, not null */ public Duration withSeconds(long seconds) { return create(seconds, nanos); @@ -668,7 +668,7 @@ * This instance is immutable and unaffected by this method call. * * @param nanoOfSecond the nano-of-second to represent, from 0 to 999,999,999 - * @return a {@code Duration} based on this period with the requested nano-of-second, not null + * @return a {@code Duration} based on this duration with the requested nano-of-second, not null * @throws DateTimeException if the nano-of-second is invalid */ public Duration withNanos(int nanoOfSecond) {