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

Tutorial states that Instant has a plusHours method

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: docs
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description

      A DESCRIPTION OF THE PROBLEM :
      The page gives the following example:

      Instant oneHourLater = Instant.now().plusHours(1);

      This example is incorrect and will not compile. plusHours is not a method for Instant

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Instant oneHourLater = Instant.now().plus(1, ChronoUnit.HOURS);
      ACTUAL -
      Instant oneHourLater = Instant.now().plusHours(1);

      URL OF FAULTY DOCUMENTATION :
      https://docs.oracle.com/javase/tutorial/datetime/iso/instant.html

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: