java.time API: ChronoUnit::between does not specify possible exceptions

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 8u40
    • Component/s: core-libs
    • x86_64
    • windows_7

      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-

            Assignee:
            Ramanand Patil (Inactive)
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: