javadoc handles nested generic types incorrectly

Martin Buchholz martinrb at google.com
Thu Oct 9 15:04:38 PDT 2008


Hi Javadoc maintainers,

This is a bug report.

My colleague Jared Levy reports:

The following file yields invalid Javadoc, even with jdk1.7.0-b36

---------------------------------
import java.util.Map;

/** Contains {@link #foo} */
public class Nested {
  public static <A> void foo(Map<A, Map<A, A>> map) {}
}
---------------------------------

The generated Nested.html contains:

Contains <A HREF="Nested.html#foo(java.util.Map)"><CODE>foo(java.util.Map<A,
java.util.Map<A, A>>)</CODE></A>

Clearly some of the < and > characters need to be replaced with &lt; and &gt;
Firefox confusingly displays exactly one of the four expected angle brackets.
I hope your mail reader doesn't mangle this pure text message.

Martin



More information about the compiler-dev mailing list