8319753: Duration javadoc has "period" instead of "duration" in several places

Reviewed-by: rriggs
This commit is contained in:
Eamonn McManus 2023-11-13 20:53:30 +00:00
parent 115b0744c6
commit 965ae72964

View file

@ -305,7 +305,7 @@ public final class Duration
* @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) {
@ -352,7 +352,7 @@ public final class Duration
* considered to be exactly 24 hours.
* <p>
* 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
@ -476,7 +476,7 @@ public final class Duration
* For full accuracy, either the {@link ChronoUnit#NANOS NANOS} unit or the
* {@link ChronoField#NANO_OF_SECOND NANO_OF_SECOND} field should be supported.
* <p>
* 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
@ -671,7 +671,7 @@ public final class Duration
* 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);
@ -686,7 +686,7 @@ public final class Duration
* 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) {