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

Generated JavaDoc for Optional.orElseThrow() is not correct

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8u40, 9
    • tools

      A DESCRIPTION OF THE PROBLEM :
      The javadoc signature for method java.util.Optional.orElseThrow() is shown as:

      public <X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X extends Throwable

      The text "extends Throwable" at the very end of that signature is invalid, and should be deleted from the API Specification.

      This issue also applies to the method with that same name in classes OptionalDouble, OptionalInt and OptionalLong in package java.util.

      The errors are in the current download file named jdk-8u40-docs-all.zip.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      public <X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X


      ACTUAL -
      public <X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X extends Throwable



      URL OF FAULTY DOCUMENTATION :
      https://docs.oracle.com/javase/8/docs/api/java/util/OptionalInt.html#orElseThrow-java.util.function.Supplier-

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

              Created:
              Updated: