2

Something a coworker of mine found:

Using Java 8, the javadoc for this class doesn't generate correct html:

public class JavadocBounds {
    /**
     * A method with a parameter of type {@link Callback}<T extends {@link ResultCode}>.
     */
    public <T extends ResultCode> void method(Callback<T> callback) {}

    static class Callback<T> {}

    static class ResultCode {}
}

This works fine (without the generic's bound):

/**
 * A method with a parameter of type {@link Callback}<{@link ResultCode}>.
 */

Are we getting the syntax wrong?

Is this fixed in later Java versions?

Is this relevant enough to post a bug? If so, where?

Andrii Abramov
  • 10,019
  • 9
  • 74
  • 96
daniu
  • 14,137
  • 4
  • 32
  • 53

2 Answers2

0

The problem may be with the literal < and > characters, which should be escaped as &lt; and &gt;. Probably, if < is followed by a letter (as in the first case), it is interpreted as a HTML tag and things go wrong.

rrobby86
  • 1,356
  • 9
  • 14
0

Javadoc is working fine. It is ignoring < and >. In order to include these signs, you have to be using &lt; for < and &gt; for > sign.

Nisheeth Shah
  • 600
  • 1
  • 9
  • 22