< prev index next >
src/java.base/share/classes/java/time/Duration.java
Print this page
*** 86,97 ****
import java.time.temporal.ChronoUnit;
import java.time.temporal.Temporal;
import java.time.temporal.TemporalAmount;
import java.time.temporal.TemporalUnit;
import java.time.temporal.UnsupportedTemporalTypeException;
- import java.util.Arrays;
- import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
--- 86,95 ----
*** 576,587 ****
* Private class to delay initialization of this list until needed.
* The circular dependency between Duration and ChronoUnit prevents
* the simple initialization in Duration.
*/
private static class DurationUnits {
! static final List<TemporalUnit> UNITS =
! Collections.unmodifiableList(Arrays.<TemporalUnit>asList(SECONDS, NANOS));
}
//-----------------------------------------------------------------------
/**
* Checks if this duration is zero length.
--- 574,584 ----
* Private class to delay initialization of this list until needed.
* The circular dependency between Duration and ChronoUnit prevents
* the simple initialization in Duration.
*/
private static class DurationUnits {
! static final List<TemporalUnit> UNITS = List.of(SECONDS, NANOS);
}
//-----------------------------------------------------------------------
/**
* Checks if this duration is zero length.
< prev index next >