JDK-4206856 : improper handling for HTML special characters '<', '>', and '&'
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.1.7,1.2.0
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,solaris_2.5.1
  • CPU: generic,sparc
  • Submitted: 1999-01-28
  • Updated: 2002-06-27
  • Resolved: 2001-03-06
Related Reports
Duplicate :  
Relates :  
Description
Every class's documentation has the section "Methods inherited from class
java.lang.Object".  This section starts with ", " -- why?  Because the first
entry is "<clinit>".  It is a good thing the tag is currently invalid.

In general, care must be taken by javadoc to ensure the text being generated
conforms to the character encoding defined in the HTML specification.  The
bug described here is likely a minor symptom of a pervasive problem.

One may be tempted to tackle to problem of abolishing incorrect HTML from the
output of javadoc.  However, I highly recommend limiting the scope of the
provoked bug fix to producing correct HTML from non-HTML string data.


Name: dbT83986			Date: 04/08/99


If you run javadoc with the "-private" option on a class that
contains a static initializer, it tries to generate documentation
for the compiler-generated method called "<clinit>". The HTML
looks like this:

<a name="<clinit>()"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="<clinit>"><b><clinit></b></a>

and browsers get mad at the unescaped greater-than signs.
At least NS and IE do.
======================================================================

Comments
PUBLIC COMMENTS .
10-06-2004

EVALUATION Timothy, As far as the case for <clinit> is concerned, it is b'cse javadoc currently doesen't handle static initilizer blocks and it is duplicate of bug# 4136244. But I don't know about the HTML special character '&' misuse in the generated code. Could you please point me to the generated code in which you have this error? atul.dambalkar@eng 1999-01-29 Neal, I'll let you close this out if it is identical to the one you fixed. doug.kramer@Eng 2001-02-27 <clinit> is gone. I'll leave the unicode problem for another day. neal.gafter@Eng 2001-03-05
27-02-2001