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

Tutorial states that Instant has a plusHours method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • None
    • docs
    • x86
    • linux

      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

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

              Created:
              Updated:
              Resolved: