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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8u40
    • core-libs
    • b57
    • x86
    • linux

        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.

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

                Created:
                Updated:
                Resolved: