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

Official documentation contains code that doesn't compile : Temporal Query

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • None
    • 8
    • docs
    • generic
    • generic

    Description

      A DESCRIPTION OF THE PROBLEM :
      In the link https://docs.oracle.com/javase/tutorial/datetime/iso/queries.html there's the following example:

        TemporalQueries query = TemporalQueries.precision();

      The same page, at the top, also says: "The Java Tutorials have been written for JDK 8".

      But this code doesn't compile in JDK 8, it gives the error:

       Type mismatch: cannot convert from TemporalQuery<TemporalUnit> to TemporalQueries

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The variable should have the correct type:

      TemporalQuery<TemporalUnit> query = TemporalQueries.precision();
      ACTUAL -
      TemporalQueries query = TemporalQueries.precision();

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

      Attachments

        Activity

          People

            bhoran Bernard Horan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: