Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8210580

java.time.ValueRange: exceptions do not match documentation

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      ADDITIONAL SYSTEM INFORMATION :
      Affects all OSs since library's inclusion in Java 8

      A DESCRIPTION OF THE PROBLEM :
      The exceptions thrown (or not thrown) by ValueRange.of (https://docs.oracle.com/javase/10/docs/api/java/time/temporal/ValueRange.html#of(long,long,long,long)) do not match the documentation.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Attempt to instantiate a ValueRange with minSmallest larger than minLargest
      Attempt to instantiate a ValueRange with minSmallest larger than maxSmallest



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The factory throws an exception
      The factory does not throw an exception
      (respectively)
      ACTUAL -
      The factory does not throw an exception
      The factory throws an exception
      (respectively)

      Although I agree with the exception we _are_ getting, and feel the documentation needs to be updated to include the unlisted case.

      ---------- BEGIN SOURCE ----------
      https://gist.github.com/Clockwork-Muse/3505cd56d254789df69725d5f9debc86
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None required - exception edge cases.

      FREQUENCY : always


      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: