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

Typo in Javadoc for java.util.Optional.equals()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u40
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b57
    • CPU:
      x86
    • OS:
      linux

      Backports

        Description

        FULL PRODUCT VERSION :
        The Optional class is introduced in Java 8. As of yesterday (3/18/2015), the Javadoc issue remained unfixed in the latest Java 9 sources.

        ADDITIONAL OS VERSION INFORMATION :
        This is not OS-specific - it is a bug in the Javadoc for the java.util.Optional class.

        A DESCRIPTION OF THE PROBLEM :
        https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html#equals-java.lang.Object-

        The generated Javadoc says:

        Returns:
            {code true} if the other object is "equal to" this object otherwise false

        Notice the '{code true}'. This is a simple typo, it should've been:

           {@code true}

        ADDITIONAL REGRESSION INFORMATION:
        Not a regression, since this is a class new to Java 8.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Navigate to the public Javadoc page for the java.util.Optional class
        2. Go to the documentation for the equals() method
        3. Observe '{code true}' in the Returns section, instead of just 'true'

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The 'true' keyword formatted as code.
        ACTUAL -
        {code true}, which is a typo from the intended {@code true}

        REPRODUCIBILITY :
        This bug can be reproduced always.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                psandoz Paul Sandoz
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: