A DESCRIPTION OF THE PROBLEM :
The javadoc of the method "between" in java.time.temporal.ChronoUnit must specify the possible exceptions, i.e. it must copy the "Throws" part from the javadoc in TemporalUnit.
To demonstrate that all 3 exceptions can effectively be thrown:
ChronoUnit.MILLIS.between(Instant.MIN, Year.now());
throws DateTimeException
ChronoUnit.MILLIS.between(LocalDate.now(), LocalDate.now());
throws UnsupportedTemporalTypeException
ChronoUnit.MILLIS.between(Instant.MIN, Instant.MAX)
throws ArithmeticException
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/8/docs/api/java/time/temporal/ChronoUnit.html#between-java.time.temporal.Temporal-java.time.temporal.Temporal-
The javadoc of the method "between" in java.time.temporal.ChronoUnit must specify the possible exceptions, i.e. it must copy the "Throws" part from the javadoc in TemporalUnit.
To demonstrate that all 3 exceptions can effectively be thrown:
ChronoUnit.MILLIS.between(Instant.MIN, Year.now());
throws DateTimeException
ChronoUnit.MILLIS.between(LocalDate.now(), LocalDate.now());
throws UnsupportedTemporalTypeException
ChronoUnit.MILLIS.between(Instant.MIN, Instant.MAX)
throws ArithmeticException
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/8/docs/api/java/time/temporal/ChronoUnit.html#between-java.time.temporal.Temporal-java.time.temporal.Temporal-