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

The javadoc of ZoneRules.previousTransition() is wrong

    Details

    • Subcomponent:
    • Resolved In Build:
      b152

      Description

      A DESCRIPTION OF THE PROBLEM :
      The documentation rightly says:

      > Gets the previous transition before the specified instant.

      But then it incorrectly says:

      > This returns details of the previous transition **after** the specified instant

      and

      > Returns: the previous transition **after** the specified instant



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expect it to say

      > This returns details of the previous transition before the specified instant

      and

      > Returns: the previous transition before the specified instant
      ACTUAL -
      > This returns details of the previous transition **after** the specified instant

      and

      > Returns: the previous transition **after** the specified instant

      URL OF FAULTY DOCUMENTATION :
      https://docs.oracle.com/javase/8/docs/api/java/time/zone/ZoneRules.html#previousTransition-java.time.Instant-

        Activity

        Hide
        aroy Abhijit Roy (Inactive) added a comment -
        Checked this issue against JDK 8 and 9 API doc and could confirm the issue reported by the bug submitter.
        Result:
        JDK 8 : Issue found
        JDK 9 : issue found
        ==================================================================================================
        Link of API Doc:
        JDK 8 : https://docs.oracle.com/javase/8/docs/api/java/time/zone/ZoneRules.html#previousTransition-java.time.Instant-
        JDK 9 : http://download.java.net/java/jdk9/docs/api/java/time/zone/ZoneRules.html#previousTransition-java.time.Instant-

        ==========================================================================================================================================================================================
        Expected:
        ++++++++
        previousTransition
        public ZoneOffsetTransition previousTransition(Instant instant)
        Gets the previous transition before the specified instant.
        This returns details of the previous transition after the specified instant. For example, if the instant represents a point where "summer" daylight saving time applies, then the method will return the transition from the previous "winter" time.
        _____________________________________^ -->[before]

        Parameters:
        instant - the instant to get the previous transition after, not null, but null may be ignored if the rules have a single offset for all instants
        Returns:
        the previous transition after the specified instant, null if this is before the first transition
        ___________________^ --> [before]
        Show
        aroy Abhijit Roy (Inactive) added a comment - Checked this issue against JDK 8 and 9 API doc and could confirm the issue reported by the bug submitter. Result: JDK 8 : Issue found JDK 9 : issue found ================================================================================================== Link of API Doc: JDK 8 : https://docs.oracle.com/javase/8/docs/api/java/time/zone/ZoneRules.html#previousTransition-java.time.Instant- JDK 9 : http://download.java.net/java/jdk9/docs/api/java/time/zone/ZoneRules.html#previousTransition-java.time.Instant- ========================================================================================================================================================================================== Expected: ++++++++ previousTransition public ZoneOffsetTransition previousTransition(Instant instant) Gets the previous transition before the specified instant. This returns details of the previous transition after the specified instant. For example, if the instant represents a point where "summer" daylight saving time applies, then the method will return the transition from the previous "winter" time. _____________________________________^ -->[before] Parameters: instant - the instant to get the previous transition after, not null, but null may be ignored if the rules have a single offset for all instants Returns: the previous transition after the specified instant, null if this is before the first transition ___________________^ --> [before]
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/f0a1116d618e
        User: rriggs
        Date: 2017-01-05 20:58:02 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/f0a1116d618e User: rriggs Date: 2017-01-05 20:58:02 +0000
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/f0a1116d618e
        User: lana
        Date: 2017-01-11 20:48:03 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/f0a1116d618e User: lana Date: 2017-01-11 20:48:03 +0000

          People

          • Assignee:
            aroy Abhijit Roy (Inactive)
            Reporter:
            webbuggrp Webbug Group
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: