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

Javadoc doesn't handle non-public intermediate types well

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 12, 13
    • Fix Version/s: 14
    • Component/s: tools
    • Labels:
      None

      Backports

        Description

        Consider the hierarchy below:

        $ cat test/Foo.java
        package test;

        public interface Foo {
           /**
            * A foo.
            */
           Foo foo();

           /**
            * A bar.
            */
           int bar();
        }

        $ cat test/Bar.java
        package test;

        /*package*/ class Bar<F extends Foo> implements Foo {
           @Override
           public F foo() { return null; }

           @Override
           public int bar() { return 42; }
        }

        $ cat test/Baz.java
        package test;

        public class Baz extends Bar<Baz> { }


        If we generate the javadoc for these classes, the javadoc for Baz will have several issues:

        * the 'foo' member will be shown in black, and will not be clickable.
        * same fate for 'bar' member, but actually, this shouldn't even be shown?
        * the signature of the 'foo' member will mention the type-variable F, which has been bound by Baz

        (please see attached image)

        The workaround is to add dumb overrides which delegate to the superclass methods.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                hannesw Hannes Wallnoefer
                Reporter:
                mcimadamore Maurizio Cimadamore
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: