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

Timestamp.from(Instant) should throw when conversion is not possible

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • 8u25
    • core-libs
    • b04
    • x86_64
    • linux_ubuntu
    • Verified

      FULL PRODUCT VERSION :
      java version "1.8.0_25"
      Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
      java version "1.8.0_25"
      Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)


      A DESCRIPTION OF THE PROBLEM :
      Timestamp.from(Instant.MIN)
      gives 169108098-07-04 06:51:43.0
      - should throw IllegalArgumentException.

      Timestamp.from(Instant.MAX)
      gives 169108098-07-04 06:51:43.0
      - should throw IllegalArgumentException.

      Javadoc is fine (IAE is documented).



      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      new Timestamp(Instant.MIN.toEpochMilli());
      new Timestamp(Instant.MAX.toEpochMilli());
      and so on...


            emcmanus Eamonn McManus
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: