Javadoc doesn't handle non-public intermediate types well

XMLWordPrintable

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

        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.

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

                Created:
                Updated:
                Resolved: