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

LocalDate.ofEpochDay input validation

    Details

    • Subcomponent:
    • Resolved In Build:
      b130

      Description

      The boundaries of LocalDate.ofEpochDay(long) are not correctly checked. In addition, the boundaries specified by ChronoField.EPOCH_DAY are wrong.

      The following line must be added as the first line of LocalDate.ofEpochDay(long):

      EPOCH_DAY.checkValidValue(epochDay);

      The declaration of ChronoField.EPOCH_DAY must be changed to the following:

      EPOCH_DAY("EpochDay", DAYS, FOREVER, ValueRange.of(-365243219162L, 365241780471L)),

      Tests should be added to ensure that an exception is thrown when ofEpochDay() is invoked with an out of range value.

        Activity

        Hide
        ntv Nadeesh Tv (Inactive) added a comment -
        Just for a reference, EpochDay range = (LocalDate.MIN.toEpochDay() , LocalDate.MAX.toEpochDay())
        Show
        ntv Nadeesh Tv (Inactive) added a comment - Just for a reference, EpochDay range = (LocalDate.MIN.toEpochDay() , LocalDate.MAX.toEpochDay())
        Show
        ntv Nadeesh Tv (Inactive) added a comment - http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-July/042149.html
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/2316ff4c0a83
        User: ntv
        Date: 2016-07-28 11:22:18 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/2316ff4c0a83 User: ntv Date: 2016-07-28 11:22:18 +0000
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/2316ff4c0a83
        User: amurillo
        Date: 2016-08-03 16:28:12 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/2316ff4c0a83 User: amurillo Date: 2016-08-03 16:28:12 +0000

          People

          • Assignee:
            ntv Nadeesh Tv (Inactive)
            Reporter:
            scolebourne Stephen Colebourne
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: