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

Example in the Documentation is wrong for java.time.ZonedDateTime.minusHours

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u60, 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b106

      Description

      A DESCRIPTION OF THE REQUEST :
      The java doc for
      public ZonedDateTime minusHours(long hours)
      ...
         * For example, consider a time-zone where the spring DST cutover means that the
           * local times 01:00 to 01:59 occur twice changing from offset +02:00 to +01:00.
           * <ul>
           * <li>Subtracting one hour from 02:30+01:00 will result in 01:30+02:00
           * <li>Subtracting one hour from 01:30+01:00 will result in 01:30+02:00
           * <li>Subtracting one hour from 01:30+02:00 will result in 00:30+01:00
           * <li>Subtracting three hours from 02:30+01:00 will result in 00:30+02:00
      ...
      the first example is wrong. It should read
           * <li>Subtracting one hour from 02:30+01:00 will result in 01:30+01:00

      JUSTIFICATION :
      Wrong documentation


        Attachments

          Activity

            People

            • Assignee:
              rriggs Roger Riggs
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: