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

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

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: None
    • Component/s: docs
    • Subcomponent:
    • CPU:
      generic
    • OS:
      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

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

              Dates

              Created:
              Updated:
              Resolved: