Skip to content

Commit

Permalink
8319753: Duration javadoc has "period" instead of "duration" in sever…
Browse files Browse the repository at this point in the history
…al places

Reviewed-by: rriggs
  • Loading branch information
Eamonn McManus committed Nov 13, 2023
1 parent 115b074 commit 965ae72
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/java.base/share/classes/java/time/Duration.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public static Duration ofNanos(long nanos) {
* @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) {
Expand Down Expand Up @@ -352,7 +352,7 @@ public static Duration from(TemporalAmount amount) {
* 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
Expand Down Expand Up @@ -476,7 +476,7 @@ private static Duration create(boolean negate, long daysAsSecs, long hoursAsSecs
* 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
Expand Down Expand Up @@ -671,7 +671,7 @@ public int getNano() {
* 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);
Expand All @@ -686,7 +686,7 @@ public Duration withSeconds(long seconds) {
* 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) {
Expand Down

1 comment on commit 965ae72

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.