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

Javadoc reports an error on sealed generic interfaces

    XMLWordPrintable

Details

    Description

      ADDITIONAL SYSTEM INFORMATION :
      I'm running this under Windows 10, but I suspect it's not an OS-specific bug

      A DESCRIPTION OF THE PROBLEM :
      When generating javadoc for a sealed generic interface with a generic implementation, javadoc reports a compilation error. See below for a minimal reproducible example.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Call 'javadoc mypackage' on the code given below

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Javadoc output
      ACTUAL -
      .\mypackage\Interface.java:7: error: '{' expected
      public sealed interface Interface<T> permits Class<T> {
                                                        ^

      ---------- BEGIN SOURCE ----------
      Interface definition:

      ```
      package mypackage;

      /**
       * This is a sealed, generic interface. The only allowed implementation is
       * Class.
       */
      public sealed interface Interface<T> permits Class<T> {
      // empty by design
      }
      ```

      Implementing class definition:

      ```
      package mypackage;

      /**
       * This is the only allowed implementation of Interface
       */
      public final class Class<T> implements Interface<T> {
      // empty by design
      }
      ```
      ---------- END SOURCE ----------

      FREQUENCY : always


      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: